{% block breadcrumbs %}
<a href="/katalog/"><span>Katalog</span></a>
{% if tags %}
- <a href="{{ tags.0.get_absolute_catalogue_url }}"><span>{{ tags.0.get_category_display|title }}</span></a>
+ <a href="{{ main_tag.get_absolute_catalogue_url }}"><span>{{ main_tag.get_category_display|title }}</span></a>
{% endif %}
{% endblock %}
{% block main %}
<div class="l-section">
<div class="l-author__header">
- {% if tags.0.photo %}
+ {% if main_tag.photo %}
<figure>
- <img src="{{ tags.0.photo.url }}" alt="{{ tags.0.name }}">
+ <img src="{{ main_tag.photo.url }}" alt="{{ main_tag.name }}">
</figure>
{% endif %}
<h1>
- {% if tags %}
- {{ tags.0.name }}
+ {% if main_tag %}
+ {{ main_tag.name }}
{% else %}
{{ title }}
{% endif %}
<input type="text" placeholder="filtry, tytuł" class="quick-filter" data-for="book-list" data-filters="with-filter">
<div class="filter-container">
{% for tag in tags %}
- {% if forloop.counter > 1 %}
+ {% if tag is not main_tag %}
<span class="filter filter-category-{{ tag.category }}">
<a href="{% catalogue_url list_type tag %}">{{ tag }}</a>
<a href="{% catalogue_url list_type tags -tag %}">✖</a>
{% endfor %}
</div>
- </span>
</div>
<div class="l-books__sorting">
<span>Sortuj:</span>
{% if tags %}
<section class="l-section">
<div class="l-author">
- {% with tag=tags.0 %}
+ {% with tag=main_tag %}
{% include 'catalogue/2022/author_box.html' %}
{% endwith %}
- {% choose_cites 3 author=tags.0 as cites %}
+ {% choose_cites 3 author=main_tag as cites %}
{% if cites %}
<div class="row">
<div class="l-author__quotes">
{% extends '2022/base.html' %}
+{% load catalogue_tags %}
{% load pagination_tags %}
{% block global-content %}
<a href="/"><span>Strona główna</span></a>
<a href="/katalog/"><span>Katalog</span></a>
<a href="/katalog/motyw/"><span>Motyw</span></a>
- <span>{{ tags.0.name }}</span>
+ <span>{{ main_tag.name }}</span>
</div>
</div>
<div class="l-section">
<div class="l-author__header">
- <h1><span>Motyw:</span> {{ tags.0.name }}</h1>
+ <h1><span>Motyw:</span> {{ main_tag.name }}</h1>
</div>
</div>
- <!-- div class="l-section">
- <div class="l-books__header">
- <div class="l-books__input">
- <i class="icon icon-filter"></i>
- <input type="text" placeholder="filtry, tytuł">
- </div>
- <div class="l-books__sorting">
- <span>Sortuj:</span>
- <div>
- <button>autorzy</button>
- <button>epoki</button>
- <button>gatunki</button>
- <button>rodzaje</button>
- <button class="is-active">motywy</button>
- </div>
- </div>
- </div>
- </div -->
+
+ <div class="l-section">
+ <div class="l-books__header">
+ <div class="l-books__input">
+ <i class="icon icon-filter"></i>
+ <input type="text" placeholder="filtry, tytuł" class="quick-filter" data-for="book-list" data-filters="with-filter">
+ <div class="filter-container">
+ {% for tag in tags %}
+ {% if tag is not main_tag %}
+ <span class="filter filter-category-{{ tag.category }}">
+ <a href="{% catalogue_url list_type tag %}">{{ tag }}</a>
+ <a href="{% catalogue_url list_type tags -tag %}">✖</a>
+ </span>
+ {% endif %}
+ {% endfor %}
+ </div>
+
+ </div>
+ </div>
+ </div>
+ <div class="l-author with-filter">
+ <div class="row">
+ <h2>{% nice_title_from_tags tags categories %}</h2>
+ {% if suggest %}
+ <div class="filter-container">
+ {% for tag in suggest %}
+ <span class="filter filter-category-{{ tag.category }}">
+ <a href="{% catalogue_url list_type tags tag %}">{{ tag }}</a>
+ </span>
+ {% endfor %}
+ </div>
+ {% endif %}
+ </div>
+ </div>
{% autopaginate object_list 10 %}
</div>
<div class="l-theme__col">
<div class="l-theme__info">
- <h3>Motyw: {{ tags.0.name }}</h3>
- {{ tags.0.description|safe }}
+ <h3>Motyw: {{ main_tag.name }}</h3>
+ {{ main_tag.description|safe }}
<!--
<h3>Motyw w sztuce <i class="icon icon-arrow-left"></i> <i class="icon icon-arrow-right"></i></h3>
<div class="l-theme__info__slider">
'suggest': suggest,
'list_type': list_type,
'tags': tags,
+ 'main_tag': tags[0],
'formats_form': forms.DownloadFormatsForm(),
'best': best,
if extra:
result.update(extra)
- is_theme = len(tags) == 1 and tags[0].category == 'theme'
- has_theme = any((x.category == 'theme' for x in tags))
- new_layout = request.EXPERIMENTS['layout']
-
- if is_theme and new_layout.value:
- template = 'catalogue/2022/theme_detail.html'
- elif new_layout.value and not has_theme:
- template = 'catalogue/2022/author_detail.html'
+ if request.EXPERIMENTS['layout'].value:
+ has_theme = any(((theme := x).category == 'theme' for x in tags))
+ if has_theme:
+ result['main_tag'] = theme
+ template = 'catalogue/2022/theme_detail.html'
+ else:
+ template = 'catalogue/2022/author_detail.html'
else:
template = 'catalogue/tagged_object_list.html'