fixes
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 3 Nov 2022 13:30:10 +0000 (14:30 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 3 Nov 2022 13:30:10 +0000 (14:30 +0100)
src/catalogue/models/collection.py
src/catalogue/templates/catalogue/2022/collections.html
src/social/templates/social/carousel_2022.html
src/wolnelektury/templates/2022/main_page.html

index 412a976..f1a582c 100644 (file)
@@ -56,6 +56,9 @@ class Collection(models.Model):
         from catalogue.models import Book
         return Book.objects.filter(self.get_query())
 
         from catalogue.models import Book
         return Book.objects.filter(self.get_query())
 
+    def get_5_books(self):
+        return self.get_books()[:5]
+
     @cached_render('catalogue/collection_box.html')
     def box(self):
         return {
     @cached_render('catalogue/collection_box.html')
     def box(self):
         return {
index ba25bcb..5fb4078 100644 (file)
@@ -26,7 +26,7 @@
             </p>
           </div>
         <div class="l-books">
             </p>
           </div>
         <div class="l-books">
-          {% for book in collection.get_books %}
+          {% for book in collection.get_5_books %}
             {% include 'catalogue/2022/book_box.html' %}
           {% endfor %}
         </div>
             {% include 'catalogue/2022/book_box.html' %}
           {% endfor %}
         </div>
index acdf5fe..edaa3bb 100644 (file)
@@ -1,3 +1,7 @@
+{% if banner %}
 <a href="{{ banner.link }}">
 <a href="{{ banner.link }}">
+  {% if banner.picture %}
   <img src="{{ banner.image.url }}">
   <img src="{{ banner.image.url }}">
+  {% endif %}
 </a>
 </a>
+{% endif %}
index b541467..8112c09 100644 (file)
       <section class="l-section">
         <div class="l-collections js-collections">
           <div class="l-collections__header">
       <section class="l-section">
         <div class="l-collections js-collections">
           <div class="l-collections__header">
-            <h3>{{ recommended_collection.title }}</h3>
+            <h3><a href="{{ recommended_collection.get_absolute_url }}">{{ recommended_collection.title }}</a></h3>
             {% comment %}
             <div class="l-your-books__header__actions">
               <button class="js-prev-slide"><i class="icon icon-arrow-left"></i></button>
             {% comment %}
             <div class="l-your-books__header__actions">
               <button class="js-prev-slide"><i class="icon icon-arrow-left"></i></button>
             {% endcomment %}
           </div>
           <div class="l-books">
             {% endcomment %}
           </div>
           <div class="l-books">
-            {% for book in recommended_collection.get_books %}
+            {% for book in recommended_collection.get_5_books %}
               {% include 'catalogue/2022/book_box.html' %}
             {% endfor %}
           </div>
               {% include 'catalogue/2022/book_box.html' %}
             {% endfor %}
           </div>
               <h3>
                 Zapisz się na nasz <strong>Newsletter!</strong>
               </h3>
               <h3>
                 Zapisz się na nasz <strong>Newsletter!</strong>
               </h3>
-              <a href="{% url 'subscribe' %}/?pk_campaign=home" class="l-button l-button--default">Weź udział</a>
+              <a href="{% url 'subscribe' %}?pk_campaign=home" class="l-button l-button--default">Weź udział</a>
             </div>
           </div>
         </div>
             </div>
           </div>
         </div>
           </ul>
         </div>
 
           </ul>
         </div>
 
-        {% sponsor_page 'footer' %}
+        {#% sponsor_page 'footer' %#}
 
       </div>
     </section>
 
       </div>
     </section>