working links page

This commit is contained in:
Christoph J. Scherr 2023-06-05 19:33:51 +02:00
parent e8df977bed
commit d8b46f76ed
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
4 changed files with 29 additions and 93 deletions

View File

@ -2,9 +2,9 @@
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<div class="container-lg mt-5"> <div class="container-lg mt-5">
<h4 class="">{% trans "Featured" %}</h4> <h4 class="">{% trans "Featured" %}</h4>
<div class="row my-4"> <div class="row row-cols-1 row-cols-md-6 my-4">
{% for post in featured_posts %} {% for post in featured_posts %}
<div class="card col m-2 p-0" style="width: 18rem;"> <div class="card col m-2 p-0">
<a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href=" {% url 'blog:post' post.category.slug post.slug %}"> <a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href=" {% url 'blog:post' post.category.slug post.slug %}">
<img src="{{ post.thumbnail.url }}" class="card-img-top img-fluid" style="max-height: 150px;" alt="thumbnail"> <img src="{{ post.thumbnail.url }}" class="card-img-top img-fluid" style="max-height: 150px;" alt="thumbnail">
<div class="card-body" style="height: 100px;"> <div class="card-body" style="height: 100px;">

View File

@ -3,9 +3,6 @@
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
{% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %} {% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %}
{% block title %}{% translate "cscherr.de" %} - {% translate "Blog" %}{% endblock title %} {% block title %}{% translate "cscherr.de" %} - {% translate "Blog" %}{% endblock title %}
{% block nav %}
{% include 'blog/nav.html' %}
{% endblock nav %}
{% block main %} {% block main %}
<div class="container-xl"> <div class="container-xl">
<div class="jumbotron text-center"> <div class="jumbotron text-center">

View File

@ -90,6 +90,7 @@ class Link(Searchable):
# the actual link # the actual link
url = models.URLField(unique=True, null=False, primary_key=True) url = models.URLField(unique=True, null=False, primary_key=True)
favicon = models.ImageField(blank=True, upload_to="img/links/favicons")
def __str__(self): def __str__(self):
return f"{{<{self.__class__.__name__}>\"{self.title_en}\"}}" return f"{{<{self.__class__.__name__}>\"{self.title_en}\"}}"

View File

@ -4,24 +4,16 @@
{% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %} {% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %}
{% block title %}{% translate "cscherr.de" %} - {% translate "Links" %}{% endblock title %} {% block title %}{% translate "cscherr.de" %} - {% translate "Links" %}{% endblock title %}
{% block main %} {% block main %}
<div class="container-xl"> <div class="container-fluid mt-5">
<div class="jumbotron text-center"> <h4 class="">{% trans "Links" %}</h4>
<h1>{% translate "cscherr.de" %}</h1> <div class="row row-cols-1 row-cols-md-6 my-4">
<p>Untertitel</p>
</div>
<div class="row text-center">
<h4>
{% translate "Wer bin ich?" %}
<small class="text-body-secondary">{% translate "Professionell" %}</small>
</h4>
</div>
<div class="row my-4">
{% for link in links %} {% for link in links %}
<a href="{{ link.url }}" class="text-reset link-offset-2 link-underline link-underline-opacity-0" target="_blank"> <div class="card col m-2 p-0">
<div class="card col m-2 p-0" style="width: 18rem;"> <a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href="{{ link.url }}">
<div class="card-body"> <div class="card-body" style="height: 150px;">
{% if LANGUAGE_CODE == "de" %} {% if LANGUAGE_CODE == "de" %}
<h5 class="card-title">{{ link.title_de }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5> <h5 class="card-title">{{ link.title_de }}<small class="text-body-secondary">{{ link.subtitle }}</small></h5>
<img src="{{ link.favicon.url }}" class="card-img-top img-fluid" style="max-height: 64px;" alt="">
<hr> <hr>
<p class="card-text">{{ link.desc_de }}</p> <p class="card-text">{{ link.desc_de }}</p>
{% elif LANGUAGE_CODE == "en" %} {% elif LANGUAGE_CODE == "en" %}
@ -33,81 +25,27 @@
<hr> <hr>
<p class="card-text">{{ link.desc_en }}</p> <p class="card-text">{{ link.desc_en }}</p>
{% endif %} {% endif %}
<div class="m-2"></div>
<i class="bi-box-arrow-up-right"></i>
<a href="{{ link.url }}" class="">{% translate "visit" %}</a>
</div> </div>
</div> <div class="container pt-5">
</a> <ul class="list-group list-group-flush">
{% for keyword in link.keywords.all %}
{% if LANGUAGE_CODE == "de" %}
<li class="list-group-item">{{ keyword.text_de }}</li>
{% elif LANGUAGE_CODE == "en" %}
<li class="list-group-item">{{ keyword.text_en }}</li>
{% else %}
<li class="list-group-item">{{ keyword.text_en }}</li>
{% endif %}
{% endfor %}
<li class="list-group-item">
<i class="bi-box-arrow-up-right"></i>
{% translate "visit" %}
</li>
</ul>
</div>
</a>
</div>
{% endfor %} {% endfor %}
</div> </div>
<div class="row my-4">
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
<div class="card col m-2 p-0" style="width: 18rem;">
<div class="card-body" style="height: 100px;">
<h5 class="card-title">sus<small class="text-body-secondary">amog</small></h5>
<p class="card-text">sus</p>
</div>
</div>
</div>
</div> </div>
{% endblock main %} {% endblock main %}