django-countries==7.3.2
# A version compatible with Django 2.2+, with long help text and editable max_length.
--e git+https://github.com/rczajka/django-forms-builder@30beb889cbf297be35963c15501c764a0689b539#egg=django-forms-builder
+-e git+https://github.com/rczajka/django-forms-builder@9c5cc4763e586b00b95366299f88f092471b7798#egg=django-forms-builder
oauthlib>=3.0.1,<3.1
{% for fragment in cites %}
<div class="l-author__quotes__slider__item">
- {% include "catalogue/2022/fragment_box.html" %}
+ {% include "catalogue/2022/fragment_slider_box.html" %}
</div>
{% endfor %}
{% if book.is_picture %}
{% if book.image_file %}
{% thumbnail book.image_file "170x240" crop="center" as im %}
- <img style="float: left; margin:{{ im|margin:"170x240" }}" src="{{ im.url }}" width="{{ im.x }}" height="{{ im.y }}" />
+ <img src="{{ im.url }}" width="{{ im.x }}" height="{{ im.y }}" />
{% endthumbnail %}
{% endif %}
{% else %}
<div class="l-author__quotes">
<div class="l-author__quotes__slider">
{% for fragment in cites %}
- {% include "catalogue/2022/fragment_box.html" %}
+ {% include "catalogue/2022/fragment_slider_box.html" %}
{% endfor %}
</div>
</div>
--- /dev/null
+{% extends '2022/base.html' %}
+{% load pagination_tags %}
+
+{% block global-content %}
+ <div class="l-container">
+ <div class="l-breadcrumb">
+ <a href="/"><span>Strona główna</span></a>
+ <a href="/katalog/lektury/"><span>Literatura</span></a>
+ {% for ancestor in fragment.book.ancestors %}
+ <a href="{{ ancestor.get_absolute_url }}">{{ ancestor.title }}</a>
+ {% endfor %}
+ <a href="{{ fragment.book.get_absolute_url }}"><span>{{ book.title }}</span></a>
+ </div>
+ </div>
+
+ <main class="l-main">
+
+ <div class="l-section">
+ <div class="l-author__header">
+ <h1>
+ <span>Motyw:</span> {{ theme.name }}
+ <span>w utworze</span>
+ <a href="{{ book.get_absolute_url }}">{{ book }}</a>
+ </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 -->
+
+ {% autopaginate fragments 10 %}
+
+ <div class="l-section l-section--col">
+ <div class="l-theme">
+ <div class="l-theme__col">
+ <div class="l-books__col">
+
+ {% for fragment in fragments %}
+ {% include 'catalogue/2022/fragment_box.html' %}
+ {% endfor %}
+ {% paginate using '2022/paginate.html' %}
+ </div>
+ </div>
+ <div class="l-theme__col">
+ <div class="l-theme__info">
+ <h3>Motyw: {{ theme.name }}</h3>
+ {{ theme.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">
+ <img src="images/motyw.jpg" alt="">
+ <img src="images/motyw.jpg" alt="">
+ <img src="images/motyw.jpg" alt="">
+ </div>
+ -->
+ </div>
+ </div>
+ </div>
+ </div>
+ </main>
+
+{% endblock %}
-<a class="l-author__quotes__slider__item" href="{{ fragment.get_absolute_url }}">
- <em>
- {% if fragment.short_text %}
+<article class="l-books__item">
+ <figure class="l-books__item__img">
+ <a href="{{ fragment.get_absolute_url }}">
+ {% if fragment.book.cover_clean %}
+ <img src="{{ fragment.book.cover_clean.url }}" alt="{{ fragment.book.title }}">
+ {% endif %}
+ </a>
+ </figure>
+ <div class="l-books__item__content">
+ <div class="l-books__item__actions">
+ <a href="{{ fragment.book.get_absolute_url }}" class="icon icon-book-alt"></a>
+ {% if fragment.book.has_mp3_file %}
+ <a href="{{ fragment.book.get_absolute_url }}" class="icon icon-audio"></a>
+ {% endif %}
+ </div>
+ <h3>
+ {% for author in fragment.book.authors %}
+ <a href="{{ author.get_absolute_url }}">{{ author }}</a>{% if not forloop.last %}, {% endif %}
+ {% endfor %}
+ </h3>
+ <h2><a href="{{ fragment.book.get_absolute_url }}">{{ fragment.book.title }}</a></h2>
+ <div class="fragment-text">
{{ fragment.short_text|safe }}
- {% else %}
- {{ fragment.text|safe }}
- {% endif %}
- </em>
- <p>{{ fragment.book.pretty_title }}</p>
-</a>
+ </div>
+ <a href="{{ fragment.get_absolute_url }}">Czytaj więcej</a>
+ </div>
+</article>
--- /dev/null
+<a class="l-author__quotes__slider__item" href="{{ fragment.get_absolute_url }}">
+ <em>
+ {% if fragment.short_text %}
+ {{ fragment.short_text|safe }}
+ {% else %}
+ {{ fragment.text|safe }}
+ {% endif %}
+ </em>
+ <p>{{ fragment.book.pretty_title }}</p>
+</a>
<div class="l-books__col">
{% for fragment in object_list %}
- <article class="l-books__item">
- <figure class="l-books__item__img">
- <a href="{{ fragment.get_absolute_url }}">
- {% if fragment.book.cover_clean %}
- <img src="{{ fragment.book.cover_clean.url }}" alt="{{ fragment.book.title }}">
- {% endif %}
- </a>
- </figure>
- <div class="l-books__item__content">
- <div class="l-books__item__actions">
- <a href="#" class="icon icon-book-alt"></a>
- {% if fragment.book.has_mp3_file %}
- <a href="#" class="icon icon-audio"></a>
- {% endif %}
- </div>
- <h3>
- {% for author in fragment.book.authors %}
- <a href="{{ author.get_absolute_url }}">{{ author }}</a>{% if not forloop.last %}, {% endif %}
- {% endfor %}
- </h3>
- <h2><a href="{{ fragment.book.get_absolute_url }}">{{ fragment.book.title }}</a></h2>
- <div class="fragment-text">
- {{ fragment.short_text|safe }}
- </div>
- <a href="{{ fragment.get_absolute_url }}">Czytaj więcej</a>
- </div>
- </article>
+ {% include 'catalogue/2022/fragment_box.html' %}
{% endfor %}
{% paginate using '2022/paginate.html' %}
</div>
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
{% block bodyid %}catalogue-catalogue{% endblock %}
-{% block body %}
+{% block body %}{% block main %}
<h1>{% trans "All works" %}</h1>
- <div class="normal-text catalogue-catalogue">
+ <div class="normal-text catalogue-catalogue l-container">
<p>
<a href="{% url 'reporting_catalogue_pdf' %}">
{% trans "Download the catalogue in PDF format." %}
<h2>{% trans "Art" %}</h2>
{% plain_list pictures by_author=True paged=False initial_blocks=True %}
</div>
-{% endblock %}
+{% endblock %}{% endblock %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
{% block bodyid %}recent-list{% endblock %}
-{% block body %}
+{% block body %}{% block main %}
<h1>{% trans "Recent audiobooks" %}</h1>
- <div id="books-list">
- {% work_list object_list %}
- </div>
-{% endblock %}
+ {% if request.EXPERIMENTS.layout %}
+ <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>
+ {% else %}
+ <div id="books-list">
+ {% work_list object_list %}
+ </div>
+ {% endif %}
+{% endblock %}{% endblock %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
{% block bodyid %}recent-list{% endblock %}
-{% block body %}
+{% block body %}{% block main %}
<h1>{% trans "Recent DAISY files" %}</h1>
- <div id="books-list">
- {% work_list object_list %}
- </div>
-{% endblock %}
+ {% if request.EXPERIMENTS.layout %}
+ <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>
+ {% else %}
+ <div id="books-list">
+ {% work_list object_list %}
+ </div>
+ {% endif %}
+{% endblock %}{% endblock %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
{% block bodyid %}recent-list{% endblock %}
-{% block body %}
+{% block body %}{% block main %}
<h1>{% trans "Recent publications" %}</h1>
{% url 'recent_audiobooks_list' as a %}
{% url 'recent_daisy_list' as d %}
<p class='normal-text'>
{% blocktrans %}You can also see <a href="{{a}}">recent audiobooks</a>
- and <a href="{{d}}">recent DAISY files</a>.{% endblocktrans %}
+ and <a href="{{d}}">recent DAISY files</a>.{% endblocktrans %}
</p>
- <div id="books-list">
- {% work_list object_list %}
- </div>
-{% endblock %}
+ {% if request.EXPERIMENTS.layout %}
+ <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>
+ {% else %}
+ <div id="books-list">
+ {% work_list object_list %}
+ </div>
+ {% endif %}
+{% endblock %}{% endblock %}
urlpatterns = [
path('obraz/strona/', picture.views.picture_page, name='picture_page'),
# pictures - currently pictures are coupled with catalogue, hence the url is here
- path('obraz/', picture.views.picture_list_thumb, name='picture_list_thumb'), # TODO: catalogue view
+ path('obraz/', picture.views.picture_list_thumb, name='picture_list_thumb'),
path('obraz/<slug:slug>.html', picture.views.picture_viewer, name='picture_viewer'),
path('obraz/<slug:slug>/', picture.views.picture_detail, name='picture_detail'),
path('szukaj/', RedirectView.as_view(
url='/szukaj/', query_string=True, permanent=True)),
- path('', views.catalogue, name='catalogue'), # TODO catalogue
+ path('', views.catalogue, name='catalogue'),
- # TODO: catalogue
path('autor/', views.tag_catalogue, {'category': 'author'}, name='author_catalogue'),
path('epoka/', views.tag_catalogue, {'category': 'epoch'}, name='epoch_catalogue'),
path('gatunek/', views.tag_catalogue, {'category': 'genre'}, name='genre_catalogue'),
path('lektury/', views.literature, name='book_list'),
path('lektury/<slug:slug>/', views.collection, name='collection'),
path('audiobooki/', views.audiobooks, name='audiobook_list'),
- path('daisy/', views.daisy_list, name='daisy_list'), # TODO: catalogue
+ path('daisy/', views.daisy_list, name='daisy_list'),
path('jtags/', search.views.hint, {'param': 'q', 'mozhint': True}, name='jhint'),
- path('nowe/', ListView.as_view( # TODO
- queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at'),
+ path('nowe/', ListView.as_view(
+ queryset=Book.objects.filter(parent=None, findable=True).order_by('-created_at')[:100],
template_name='catalogue/recent_list.html'), name='recent_list'),
- path('nowe/audiobooki/', ListView.as_view( # TODO
- queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+ path('nowe/audiobooki/', ListView.as_view(
+ queryset=Book.objects.filter(media__type='ogg').annotate(m=Max('media__uploaded_at')).order_by('-m')[:100],
template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
- path('nowe/daisy/', ListView.as_view( # TODO
- queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+ path('nowe/daisy/', ListView.as_view(
+ queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m')[:100],
template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
path('custompdf/<slug:slug>/', views.CustomPDFFormView(), name='custom_pdf_form'),
fragments = Fragment.tagged.with_all([theme]).filter(
Q(book=book) | Q(book__ancestor=book))
+ if request.EXPERIMENTS['layout'].value:
+ template_name = 'catalogue/2022/book_fragments.html'
+ else:
+ template_name = 'catalogue/book_fragments.html'
+
return render(
request,
- 'catalogue/book_fragments.html',
+ template_name,
{
'book': book,
'theme': theme,
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% block titleextra %}{% trans "Notifications" %}{% endblock %}
<tr><td></td><td><button type="submit">Wyślij</button></td></tr>
</table>
</form>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
-{% extends "base/base.html" %}
+{% extends request.EXPERIMENTS.layout|yesno:"2022/base_simple.html,base/base.html" %}
{% load i18n %}
{% block titleextra %}{% trans "Notifications" %}{% endblock %}
{% block body %}
<h1>Wysłano powiadomienie</h1>
<p>Gratulacje!</p>
-{% endblock %}
\ No newline at end of file
+{% endblock %}
FORMS_BUILDER_HELPTEXT_MAX_LENGTH = 2048
FORMS_BUILDER_REQUIRED_CSS_CLASS = 'required'
FORMS_BUILDER_INACTIVE_VISIBLE = True
+FORMS_BUILDER_TEMPLATE_NAME_P = 'forms/p.html'
--- /dev/null
+{{ errors }}
+{% if errors and not fields %}
+ <p>{% for field in hidden_fields %}{{ field }}{% endfor %}</p>
+{% endif %}
+{% for field, errors in fields %}
+ {{ errors }}
+ <p{% with classes=field.css_classes %}{% if classes %} class="{{ classes }}"{% endif %}{% endwith %}>
+ {% if field.label %}{{ field.label_tag }}{% endif %}
+ {% if field.help_text %}
+ <br><span class="helptext">{{ field.help_text|safe }}</span>
+ {% endif %}
+ {{ field }}
+ {% if forloop.last %}
+ {% for field in hidden_fields %}{{ field }}{% endfor %}
+ {% endif %}
+ </p>
+{% endfor %}
+{% if not fields and not errors %}
+ {% for field in hidden_fields %}{{ field }}{% endfor %}
+{% endif %}