sorl-thumbnail==12.8.0
# home-brewed & dependencies
-librarian==2.5.1
+librarian==2.6
# celery tasks
celery[redis]==5.2.7
{% endif %}
</div>
</figure>
- <div class="l-books__item__content">
+ <div class="l-books__item__content s">
<h3>
{% for author in fragment.book.authors %}
<a href="{{ author.get_absolute_url }}">{{ author }}</a>{% if not forloop.last %}, {% endif %}
<div class="with-filter">
<div class="row">
<h2 class="header">{% nice_title_from_tags tags categories %}</h2>
- {% if suggest %}
+ {% if suggested_tags %}
<div class="filter-container">
- {% for tag in suggest %}
+ {% for tag in suggested_tags %}
<span class="filter filter-category-{{ tag.category }}">
<a href="{% catalogue_url view.list_type tags tag %}">{{ tag }}</a>
</span>
-{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
+{% extends "2022/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
-{% block titleextra %}{% trans "Recent audiobooks" %}{% endblock %}
+{% block settings %}
+ {% load title %}
+ {% trans "Recent audiobooks" as title %}
+ {% title title %}
+{% endblock %}
-{% block bodyid %}recent-list{% endblock %}
+{% block main %}
+ <div class="l-article__title">
+ <h1>{% trans "Recent audiobooks" %}</h1>
+ </div>
-{% block body %}{% block main %}
- <h1>{% trans "Recent audiobooks" %}</h1>
-
- {% 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 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>
- {% endif %}
-{% endblock %}{% endblock %}
+ </div>
+{% endblock %}
-{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
+{% extends "2022/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
-{% block titleextra %}{% trans "Recent DAISY files" %}{% endblock %}
+{% block settings %}
+ {% load title %}
+ {% trans "Recent DAISY files" as title %}
+ {% title title %}
+{% endblock %}
-{% block bodyid %}recent-list{% endblock %}
-{% block body %}{% block main %}
- <h1>{% trans "Recent DAISY files" %}</h1>
+{% block main %}
+ <div class="l-article__title">
+ <h1>{% trans "Recent DAISY files" %}</h1>
+ </div>
- {% 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 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>
- {% else %}
- <div id="books-list">
- {% work_list object_list %}
- </div>
- {% endif %}
-{% endblock %}{% endblock %}
+ </div>
+{% endblock %}
-{% extends request.EXPERIMENTS.layout|yesno:"2022/base.html,base/base.html" %}
+{% extends "2022/base.html" %}
{% load i18n %}
{% load catalogue_tags %}
-{% block titleextra %}{% trans "Recent publications" %}{% endblock %}
+{% block settings %}
+ {% load title %}
+ {% trans "Recent publications" as title %}
+ {% title title %}
+{% endblock %}
-{% block bodyid %}recent-list{% endblock %}
-
-{% block body %}{% block main %}
- <h1>{% trans "Recent publications" %}</h1>
+{% block main %}
+ <div class="l-article__title">
+ <h1>{% trans "Recent publications" %}</h1>
+ </div>
{% url 'recent_audiobooks_list' as a %}
{% url 'recent_daisy_list' as d %}
- <p class='normal-text'>
+ <div class="l-main">
+ <p>
{% blocktrans %}You can also see <a href="{{a}}">recent audiobooks</a>
and <a href="{{d}}">recent DAISY files</a>.{% endblocktrans %}
</p>
+ </div>
- {% 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 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>
- {% endif %}
-{% endblock %}{% endblock %}
+ </div>
+{% endblock %}
def search(self, qs):
term = self.request.GET.get('search')
if term:
- meta_rels = TagRelation.objects.exclude(tag__category='set')
+ meta_rels = TagRelation.objects.filter(tag__category='author')
# TODO: search tags in currently displaying language
if self.is_themed:
- #qs = qs.annotate(
- # meta=FilteredRelation('book__tag_relations', condition=Q(tag_relations__in=meta_rels))
- #)
+ rels = meta_rels.filter(tag__name_pl__icontains=term)
qs = qs.filter(
Q(book__title__icontains=term) |
- #Q(meta__tag_relations__tag__name_pl__icontains=term) |
+ Q(tag_relations__in=rels) |
Q(text__icontains=term)
).distinct()
else:
def get_suggested_tags(self, queryset):
tag_ids = [t.id for t in self.ctx['tags']]
- related_tags = list(get_top_level_related_tags(self.ctx['tags']))
- if not self.is_themed:
+ if self.is_themed:
+ related_tags = []
+ current_books = self.get_queryset().values_list('book', flat=True).distinct()
+ containing_books = Book.objects.filter(Q(id__in=current_books) | Q(children__in=current_books))
+
+ related_tags.extend(list(
+ Tag.objects.usage_for_queryset(
+ containing_books,
+ ).exclude(category='set').exclude(pk__in=tag_ids)
+ ))
+ if self.request.user.is_authenticated:
+ related_tags.extend(list(
+ Tag.objects.usage_for_queryset(
+ containing_books
+ ).filter(
+ user=self.request.user
+ ).exclude(name='').exclude(pk__in=tag_ids)
+ ))
+ else:
+ related_tags = list(get_top_level_related_tags(self.ctx['tags']))
if self.request.user.is_authenticated:
qs = Book.tagged.with_all(self.ctx['tags']).filter(findable=True)
related_tags.extend(list(
-{% extends request.EXPERIMENTS.layout.value|yesno:"2022/base_simple.html,base/base.html" %}
+{% extends "2022/base_simple.html" %}
{% load i18n %}
{% load static from static %}
{% block settings %}
{% load title %}
- {% trans "Your file is being prepared, please wait." as title %}
- {% title title %}
-{% endblock %}
-
-{% block titleextra %}
{% if file_url %}
- {% trans "The file is ready for download!" %}
+ {% trans "The file is ready for download!" as title %}
{% else %}
{% if waiting %}
- {% trans "Your file is being prepared, please wait." %}
+ {% trans "Your file is being prepared, please wait." as title %}
{% else %}
- {% trans "Something went wrong." %}
+ {% trans "Something went wrong." as title %}
{% endif %}
{% endif %}
+
+ {% title title %}
{% endblock %}
(100, 'contact.fields.HeaderField', 'Header'),
(101, 'contact.fields.SeparatorField', 'Separator'),
]
-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'