X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/251b72488d27f769ed0574f39a91f5d2da3d27a6..51ac945348ac0e1de1daaa181a8a81c2dc0801c0:/src/catalogue/views.py?ds=sidebyside diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 904cdc531..62d34bb50 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -66,7 +66,10 @@ def daisy_list(request): def collection(request, slug): coll = get_object_or_404(Collection, slug=slug) - return render(request, 'catalogue/collection.html', {'collection': coll}) + return render(request, 'catalogue/collection.html', { + 'collection': coll, + 'active_menu_item': 'collections', + }) def differentiate_tags(request, tags, ambiguous_slugs): @@ -285,13 +288,15 @@ def book_detail(request, slug): return render( request, - 'catalogue/book_detail.html', + 'catalogue/2021/book_detail.html' if request.EXPERIMENTS['layout'] == 'new' else 'catalogue/book_detail.html', { 'book': book, 'book_children': book.children.all().order_by('parent_number', 'sort_key'), 'active_menu_item': 'books', 'club_form': ScheduleForm() if book.preview else None, 'club': Club.objects.first() if book.preview else None, + + 'EXPERIMENTS_SWITCHABLE_layout': True, }) @@ -455,13 +460,14 @@ def collections(request): objects = Collection.objects.filter(listed=True) if len(objects) > 3: - best = random.sample(list(objects), 3) + best = random.sample(list(objects), 4) else: best = objects return render(request, 'catalogue/collections.html', { 'objects': objects, 'best': best, + 'active_menu_item': 'collections' })