From: Radek Czajka Date: Tue, 27 Aug 2024 10:55:46 +0000 (+0200) Subject: Leftovers X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/c879af9dad38cf87b7c0d4669739ad2cffeff722?ds=inline;hp=0fc6db6bec64211a85a2f09dc615ddaa67e5215a Leftovers --- diff --git a/src/catalogue/templates/catalogue/catalogue.html b/src/catalogue/templates/catalogue/catalogue.html index 294df7712..278029b5c 100644 --- a/src/catalogue/templates/catalogue/catalogue.html +++ b/src/catalogue/templates/catalogue/catalogue.html @@ -29,8 +29,5 @@

{% trans "Kolekcje" %}

{% plain_list collections paged=False %} - -

{% trans "Sztuka" %}

- {% plain_list pictures by_author=True paged=False initial_blocks=True %} {% endblock %}{% endblock %} diff --git a/src/catalogue/urls.py b/src/catalogue/urls.py index bb00c8a36..91c66a2fe 100644 --- a/src/catalogue/urls.py +++ b/src/catalogue/urls.py @@ -23,7 +23,6 @@ urlpatterns = [ path('rodzaj/', views.tag_catalogue, {'category': 'kind'}, name='kind_catalogue'), path('motyw/', views.tag_catalogue, {'category': 'theme'}, name='theme_catalogue'), - path('galeria/', views.GalleryView.as_view(), name='gallery'), path('kolekcje/', views.collections, name='catalogue_collections'), path('lektury/', views.LiteratureView.as_view(), name='book_list'), @@ -64,8 +63,6 @@ urlpatterns = [ path('isbn///', views.get_isbn), # This should be the last pattern. - re_path(r'^galeria/(?P[a-zA-Z0-9-/]*)/$', views.tagged_object_list, {'list_type': 'gallery'}, - name='tagged_object_list_gallery'), re_path(r'^audiobooki/(?P[a-zA-Z0-9-/]*)/$', views.tagged_object_list, {'list_type': 'audiobooks'}, name='tagged_object_list_audiobooks'), re_path(r'^(?P[a-zA-Z0-9-/]*)/$', views.tagged_object_list, {'list_type': 'books'}, diff --git a/src/catalogue/views.py b/src/catalogue/views.py index fc01ad65e..e8808b4de 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -23,7 +23,6 @@ from club.forms import DonationStep1Form from club.models import Club from annoy.models import DynamicTextInsert from pdcounter import views as pdcounter_views -from picture.models import Picture, PictureArea from wolnelektury.utils import is_ajax from catalogue import constants from catalogue import forms @@ -39,7 +38,6 @@ staff_required = user_passes_test(lambda user: user.is_staff) def catalogue(request): return render(request, 'catalogue/catalogue.html', { 'books': Book.objects.filter(findable=True, parent=None), - 'pictures': Picture.objects.all(), 'collections': Collection.objects.filter(listed=True), 'active_menu_item': 'all_works', }) @@ -195,22 +193,6 @@ class BookList(ObjectListView): return qs -class ArtList(ObjectListView): - template_name = 'catalogue/book_list.html' - dynamic_template_name = 'catalogue/dynamic_book_list.html' - title = gettext_lazy('Sztuka') - list_type = 'gallery' - - def get_queryset(self): - return Picture.objects.all() - - def search(self, qs): - term = self.request.GET.get('search') - if term: - qs = qs.filter(Q(title__icontains=term) | Q(tag_relations__tag__name_pl__icontains=term)).distinct() - return qs - - class LiteratureView(BookList): def get_suggested_tags(self, queryset): tags = list(get_top_level_related_tags([])) @@ -228,14 +210,6 @@ class AudiobooksView(LiteratureView): return Book.objects.filter(findable=True, media__type='mp3').distinct() -class GalleryView(ArtList): - def get_suggested_tags(self, queryset): - return Tag.objects.usage_for_queryset( - queryset, - counts=True - ).exclude(pk__in=[t.id for t in self.ctx['tags']]).order_by('-count') - - class TaggedObjectList(BookList): def analyse(self): super().analyse()