Commit 086e009b authored by Thijs de Jong's avatar Thijs de Jong
Browse files

Merge branch 'fix/thabloid-grid-items' into 'master'

Fix thabloids out-of-item rendering

See merge request !1261
parents ffda807d 35cc97d3
...@@ -57,7 +57,9 @@ ...@@ -57,7 +57,9 @@
<div class="row"> <div class="row">
{% for thabloid in thabloids %} {% for thabloid in thabloids %}
{% thabloid_card year thabloid %} <div class="mix {% if thabloid.year >= year|add:-3 %}year-{{ thabloid.year }}{% else %}year-older{% endif %} col-6 col-md-3 my-3">
{% thabloid_card year thabloid %}
</div>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
......
...@@ -9,10 +9,6 @@ register = template.Library() ...@@ -9,10 +9,6 @@ register = template.Library()
@register.inclusion_tag('includes/grid_item.html') @register.inclusion_tag('includes/grid_item.html')
def thabloid_card(year, thabloid): def thabloid_card(year, thabloid):
class_name = 'year-older'
if thabloid.year >= year - 3:
class_name = 'year-{}'.format(thabloid.year)
view_url = reverse('thabloid:pages', args=[thabloid.year, thabloid.issue]) view_url = reverse('thabloid:pages', args=[thabloid.year, thabloid.issue])
buttons = ( buttons = (
'<div class="text-center mt-2">' '<div class="text-center mt-2">'
...@@ -33,5 +29,5 @@ def thabloid_card(year, thabloid): ...@@ -33,5 +29,5 @@ def thabloid_card(year, thabloid):
meta_text=buttons, meta_text=buttons,
url=None, url=None,
image_url=get_thumbnail_url(thabloid.cover, '255x360'), image_url=get_thumbnail_url(thabloid.cover, '255x360'),
class_name=f'thabloid-card mix {class_name} col-6 col-md-3 my-3', class_name=f'thabloid-card',
) )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment