--- /dev/null
+# Generated by Django 4.0.8 on 2022-10-28 13:03
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('catalogue', '0039_collection_authors'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='collection',
+ name='description',
+ field=models.TextField(blank=True, default='', verbose_name='description'),
+ preserve_default=False,
+ ),
+ ]
--- /dev/null
+# Generated by Django 4.0.8 on 2022-10-28 13:06
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('catalogue', '0040_alter_collection_description'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='collection',
+ name='authors',
+ field=models.ManyToManyField(blank=True, limit_choices_to={'category': 'author'}, to='catalogue.tag'),
+ ),
+ ]
"""A collection of books, which might be defined before publishing them."""
title = models.CharField(_('title'), max_length=120, db_index=True)
slug = models.SlugField(_('slug'), max_length=120, primary_key=True)
- description = models.TextField(_('description'), null=True, blank=True)
+ description = models.TextField(_('description'), blank=True)
book_slugs = models.TextField(_('book slugs'))
authors = models.ManyToManyField(
'Tag',
- limit_choices_to={'category': 'author'}
+ limit_choices_to={'category': 'author'},
+ blank=True
)
kind = models.CharField(_('kind'), max_length=10, blank=False, default='book', db_index=True,
choices=(('book', _('book')), ('picture', _('picture'))))
{% load choose_cites from social_tags %}
-{% block global-content %}
- <div class="l-container">
- <div class="l-breadcrumb">
- <a href="/"><span>Strona główna</span></a>
- <a href="/katalog/"><span>Katalog</span></a>
- <a href="/katalog/autor/"><span>Autor</span></a>
- </div>
- </div>
- <main class="l-main">
+{% block breadcrumbs %}
+ <a href="/katalog/"><span>Katalog</span></a>
+ <a href="/katalog/autor/"><span>Autor</span></a>
+{% endblock %}
+{% block main %}
<div class="l-section">
<div class="l-author__header">
{% if tags.0.photo %}
{% endif %}
</div>
</section>
- </main>
{% endblock %}
--- /dev/null
+{% extends '2022/base.html' %}
+
+
+{% block breadcrumbs %}
+ <a href="/katalog/"><span>Katalog</span></a>
+ <a href="/katalog/kolekcje/"><span>Kolekcje</span></a>
+{% endblock %}
+
+
+{% block main %}
+
+ <div class="l-section">
+ <div class="l-author__header">
+ <h1>{{ collection.title }}</h1>
+ </div>
+ </div>
+
+ <div class="l-author__info">
+ <p>
+ {{ collection.description|safe }}
+ </p>
+ </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">
+ </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-section l-section--col">
+ <div class="l-books__grid" id="book-list">
+ {% for book in collection.get_books %}
+ {% include "catalogue/2022/book_box.html" %}
+ {% endfor %}
+ </div>
+ </div>
+
+
+{% endblock %}
--- /dev/null
+{% extends '2022/base.html' %}
+
+
+{% block breadcrumbs %}
+ <a href="/katalog/"><span>Katalog</span></a>
+{% endblock %}
+
+
+{% block main %}
+
+ <div class="l-section">
+ <div class="l-author__header">
+ <h1>Kolekcje</h1>
+ </div>
+ </div>
+
+ {% for collection in objects %}
+ <section class="l-section">
+ <div class="l-collections js-collections">
+ <div class="l-collections__header">
+ <h3><a href="{{ collection.get_absolute_url }}">{{ collection.title }}</a></h3>
+ </div>
+ <div class="l-author__info">
+ <p>
+ {{ collection.description|safe }}
+ </p>
+ </div>
+ <div class="l-books">
+ {% for book in collection.get_books %}
+ {% include 'catalogue/2022/book_box.html' %}
+ {% endfor %}
+ </div>
+ </div>
+ </section>
+ {% endfor %}
+
+
+{% endblock %}
def collection(request, slug):
coll = get_object_or_404(Collection, slug=slug)
- return render(request, 'catalogue/collection.html', {
+ if request.EXPERIMENTS['layout'].value:
+ template_name = 'catalogue/2022/collection.html'
+ else:
+ template_name = 'catalogue/collection.html'
+ return render(request, template_name, {
'collection': coll,
'active_menu_item': 'collections',
})
else:
best = objects
- return render(request, 'catalogue/collections.html', {
+ if request.EXPERIMENTS['layout'].value:
+ template_name = 'catalogue/2022/collections.html'
+ else:
+ template_name = 'catalogue/collections.html'
+
+ return render(request, template_name, {
'objects': objects,
'best': best,
'active_menu_item': 'collections'
--- /dev/null
+# Generated by Django 4.0.8 on 2022-10-28 13:03
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('social', '0014_auto_20221014_1004'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='carousel',
+ name='placement',
+ field=models.SlugField(choices=[('main', 'main'), ('main_2022', 'main 2022')], verbose_name='placement'),
+ ),
+ ]
shelfSlider.slick('slickPrev');
});
- let collectionsSlider = $('.js-collections .l-books');
- let collectionsNextSlide = $('.js-collections .js-next-slide');
- let collectionsPrevSlide = $('.js-collections .js-prev-slide');
+
+ $('.js-collections').each(function() {
+ let collectionsSlider = $('.l-books', this);
+ if ($collectionsSlider.children().length < 2) return;
+ let collectionsNextSlide = $('.js-next-slide', this);
+ let collectionsPrevSlide = $('.js-prev-slide', this);
collectionsSlider.slick({
slidesToScroll: 1,
event.preventDefault();
collectionsSlider.slick('slickPrev');
});
-
+ });
let newBooksSlider = $('.js-new-books-slider .l-books');
let newBooksNextSlide = $('.js-new-books-slider .js-next-slide');
let newBooksPrevSlide = $('.js-new-books-slider .js-prev-slide');