cards are pretty good now
This commit is contained in:
parent
9e28fbad2b
commit
1ec6813323
|
@ -4,35 +4,36 @@
|
||||||
<h4 class="">{% trans "Featured" %}</h4>
|
<h4 class="">{% trans "Featured" %}</h4>
|
||||||
<div class="row my-4">
|
<div class="row my-4">
|
||||||
{% for post in featured_posts %}
|
{% for post in featured_posts %}
|
||||||
<div class="card mx-2 p-0" style="width: 18rem;">
|
<div class="card m-2 p-0" style="width: 18rem;">
|
||||||
<img src="{{ post.thumbnail.url }}" class="card-img-top img-fluid m-auto d-block mt-0" style="max-height: 45%;" alt="thumbnail">
|
<a class="text-reset link-offset-2 link-underline link-underline-opacity-0" href=" {% url 'blog:post' post.category.slug post.slug %}">
|
||||||
<div class="card-body">
|
<img src="{{ post.thumbnail.url }}" class="card-img-top img-fluid" style="max-height: 150px;" alt="thumbnail">
|
||||||
{% if LANGUAGE_CODE == "de" %}
|
<div class="card-body" style="height: 100px;">
|
||||||
<h5 class="card-title">{{ post.title_de }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
|
||||||
<p class="card-text">{{ post.desc_de }}</p>
|
|
||||||
{% elif LANGUAGE_CODE == "en" %}
|
|
||||||
<h5 class="card-title">{{ post.title_en }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
|
||||||
<p class="card-text">{{ post.desc_en }}</p>
|
|
||||||
{% else %}
|
|
||||||
<h5 class="card-title">{{ post.title_en }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
|
||||||
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<ul class="list-group list-group-flush">
|
|
||||||
<li class="list-group-item">{% translate "category" %}: <b>{{ post.category.name }}</b></li>
|
|
||||||
{% for keyword in post.keywords.all %}
|
|
||||||
{% if LANGUAGE_CODE == "de" %}
|
{% if LANGUAGE_CODE == "de" %}
|
||||||
<li class="list-group-item">{{ keyword.text_de }}</li>
|
<h5 class="card-title">{{ post.title_de }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
||||||
|
<p class="card-text">{{ post.desc_de }}</p>
|
||||||
{% elif LANGUAGE_CODE == "en" %}
|
{% elif LANGUAGE_CODE == "en" %}
|
||||||
<li class="list-group-item">{{ keyword.text_en }}</li>
|
<h5 class="card-title">{{ post.title_en }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
||||||
|
<p class="card-text">{{ post.desc_en }}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="list-group-item">{{ keyword.text_en }}</li>
|
<h5 class="card-title">{{ post.title_en }}<small class="text-body-secondary">{{ post.subtitle }}</small></h5>
|
||||||
|
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
</div>
|
||||||
<li class="list-group-item">
|
<div class="container pt-5">
|
||||||
<a class="" href=" {% url 'blog:post' post.category.slug post.slug %}">{% translate "go to blogpost" %}</a>
|
<ul class="list-group list-group-flush">
|
||||||
</li>
|
<li class="list-group-item">{% translate "category" %}: <b>{{ post.category.name }}</b></li>
|
||||||
</ul>
|
{% for keyword in post.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 %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 62 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 MiB |
|
@ -0,0 +1,35 @@
|
||||||
|
# Generated by Django 3.2.19 on 2023-06-04 21:12
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('start', '0003_searchable_public'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='keyword',
|
||||||
|
options={'verbose_name': 'Keyword', 'verbose_name_plural': 'keywords'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='searchable',
|
||||||
|
options={'verbose_name': 'Searchable', 'verbose_name_plural': 'Searchables'},
|
||||||
|
),
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name='staticsite',
|
||||||
|
options={'verbose_name': 'static site', 'verbose_name_plural': 'static sites'},
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='searchable',
|
||||||
|
name='desc_de',
|
||||||
|
field=models.CharField(default='Beschreibung DE', max_length=250),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='searchable',
|
||||||
|
name='desc_en',
|
||||||
|
field=models.CharField(default='Description EN', max_length=250),
|
||||||
|
),
|
||||||
|
]
|
|
@ -30,8 +30,8 @@ class Searchable(models.Model):
|
||||||
title_en = models.CharField(max_length=50, default="title en")
|
title_en = models.CharField(max_length=50, default="title en")
|
||||||
subtitle_de = models.CharField(max_length=50, blank=True)
|
subtitle_de = models.CharField(max_length=50, blank=True)
|
||||||
subtitle_en = models.CharField(max_length=50, blank=True)
|
subtitle_en = models.CharField(max_length=50, blank=True)
|
||||||
desc_de = models.CharField(max_length=250, unique=True, default="Beschreibung DE")
|
desc_de = models.CharField(max_length=250, unique=False, default="Beschreibung DE")
|
||||||
desc_en = models.CharField(max_length=250, unique=True, default="Description EN")
|
desc_en = models.CharField(max_length=250, unique=False, default="Description EN")
|
||||||
# may be empty/blank for some entries
|
# may be empty/blank for some entries
|
||||||
date = models.DateField(blank=True, null=True)
|
date = models.DateField(blank=True, null=True)
|
||||||
keywords = models.ManyToManyField(Keyword)
|
keywords = models.ManyToManyField(Keyword)
|
||||||
|
|
Loading…
Reference in New Issue