Moving forward.
[wolnelektury.git] / src / catalogue / templates / catalogue / 2022 / author_detail.html
index 54486fb..716a4b5 100644 (file)
@@ -6,72 +6,82 @@
 
 {% block breadcrumbs %}
   <a href="/katalog/"><span>Katalog</span></a>
-  <a href="{{ tags.0.get_absolute_catalogue_url }}"><span>{{ tags.0.get_category_display|title }}</span></a>
+  {% if tags %}
+    <a href="{{ tags.0.get_absolute_catalogue_url }}"><span>{{ tags.0.get_category_display|title }}</span></a>
+  {% endif %}
 {% endblock %}
 
 {% block main %}
-    <div class="l-section">
-      <div class="l-author__header">
-        {% if tags.0.photo %}
-          <figure>
-            <img src="{{ tags.0.photo.url }}" alt="{{ tags.0.name }}">
-          </figure>
+  <div class="l-section">
+    <div class="l-author__header">
+      {% if tags.0.photo %}
+        <figure>
+          <img src="{{ tags.0.photo.url }}" alt="{{ tags.0.name }}">
+        </figure>
+      {% endif %}
+      <h1>
+        {% if tags %}
+          {{ tags.0.name }}
+        {% else %}
+          {{ title }}
         {% endif %}
-        <h1>{{ tags.0.name }}</h1>
-      </div>
+      </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ł" class="quick-filter" data-for="book-list" data-filters="with-filter">
-          <div class="filter-container">
-            {% for tag in tags %}
-              {% if forloop.counter > 1 %}
-                <span class="filter">
-                  <a href="{{ tag.get_absolute_url }}">{{ tag }}</a>
-                  <a href="{% catalogue_url 'books' tags -tag %}">✖</a>
-                </span>
-              {% endif %}
-            {% endfor %}
-          </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 forloop.counter > 1 %}
+              <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>
 
-          </span>
+  </span>
+      </div>
+      <div class="l-books__sorting">
+        <span>Sortuj:</span>
+        <div>
+          <button data-order="data-pop">najpopularniejsze</button>
+          <button class="is-active">alfabetycznie</button>
+          <!--button>chronologicznie</button-->
         </div>
-        <div class="l-books__sorting">
-             <span>Sortuj:</span>
-             <div>
-             <button data-order="data-pop">najpopularniejsze</button>
-             <button class="is-active">alfabetycznie</button>
-             <!--button>chronologicznie</button-->
-             </div>
-             </div>
       </div>
     </div>
-    <div class="l-author with-filter">
+  </div>
+  <div class="l-author with-filter">
 
-      <div class="row">
-        <h2>{% nice_title_from_tags tags categories %}</h2>
+    <div class="row">
+      <h2>{% nice_title_from_tags tags categories %}</h2>
+      {% if suggest %}
         <div class="filter-container">
           {% for tag in suggest %}
-            <span class="filter">
-              <a href="{% catalogue_url 'books' tags tag %}">{{ tag }}</a>
+            <span class="filter filter-category-{{ tag.category }}">
+              <a href="{% catalogue_url list_type tags tag %}">{{ tag }}</a>
             </span>
           {% endfor %}
         </div>
-      </div>
+      {% endif %}
     </div>
+  </div>
 
-    <div class="l-section l-section--col">
-      <div class="l-books__grid" id="book-list">
-        {% for book in object_list %}
-          {% include "catalogue/2022/book_box.html" %}
-        {% endfor %}
-      </div>
+  <div class="l-section l-section--col">
+    <div class="l-books__grid" id="book-list">
+      {% for book in object_list %}
+        {% include "catalogue/2022/book_box.html" %}
+      {% endfor %}
     </div>
+  </div>
 
-    {% if tags %}
+  {% if tags %}
     <section class="l-section">
       <div class="l-author">
         {% with author=tags.0 %}
         {% endwith %}
         {% choose_cites 3 author=tags.0 as cites %}
         {% if cites %}
-        <div class="row">
-          <div class="l-author__quotes">
-            <div class="l-author__quotes__slider">
+          <div class="row">
+            <div class="l-author__quotes">
+              <div class="l-author__quotes__slider">
 
-              {% for fragment in cites %}
-                <div class="l-author__quotes__slider__item">
-                  {% include "catalogue/2022/fragment_box.html" %}
-                </div>
-              {% endfor %}
+                {% for fragment in cites %}
+                  <div class="l-author__quotes__slider__item">
+                    {% include "catalogue/2022/fragment_box.html" %}
+                  </div>
+                {% endfor %}
 
+              </div>
             </div>
           </div>
-        </div>
         {% endif %}
       </div>
     </section>