{% endif %}
</div>
-{% if list_type == 'default' and not tags %}
+{% if list_type == 'books' and not tags %}
<section>
<h1>{% trans "Recent publications" %}</h1>
{% for book in last_published %}
# @register.inclusion_tag('catalogue/tag_list.html')
-def tag_list(tags, choices=None, category=None, list_type='default'):
+def tag_list(tags, choices=None, category=None, list_type='books'):
# print(tags, choices, category)
if choices is None:
choices = []
@register.inclusion_tag('catalogue/inline_tag_list.html')
-def inline_tag_list(tags, choices=None, category=None, list_type='default'):
+def inline_tag_list(tags, choices=None, category=None, list_type='books'):
return tag_list(tags, choices, category, list_type)
@register.inclusion_tag('catalogue/plain_list.html', takes_context=True)
-def plain_list(context, object_list, with_initials=True, by_author=False, choice=None, book=None, list_type='default',
+def plain_list(context, object_list, with_initials=True, by_author=False, choice=None, book=None, list_type='books',
paged=True, initial_blocks=False):
names = [('', [])]
last_initial = None
'books': Book.objects.filter(parent=None).order_by('sort_key_author', 'sort_key'),
'pictures': Picture.objects.order_by('sort_key_author', 'sort_key'),
'collections': Collection.objects.all(),
+ 'active_menu_item': 'all_works',
})
# TODO: Rewrite this hellish piece of code which tries to do everything
-def tagged_object_list(request, tags='', list_type='default'):
+def tagged_object_list(request, tags='', list_type='books'):
raw_tags = tags
# preliminary tests and conditions
gallery = list_type == 'gallery'
return redirect('tagged_object_list_gallery', raw_tags)
# this is becoming more and more hacky
- if list_type == 'default' and not tags:
+ if list_type == 'books' and not tags:
last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:20]
else:
last_published = None
'list_type': list_type,
'daisy': daisy,
'last_published': last_published,
+ 'active_menu_item': 'theme' if theme_is_set else list_type,
},
context_instance=RequestContext(request))
'best': best,
'title': constants.CATEGORIES_NAME_PLURAL[category],
'whole_category': constants.WHOLE_CATEGORY[category],
+ 'active_menu_item': 'theme' if category == 'theme' else None,
})
display: inline-block;
@include size(width, 20%);
+ &.active {
+ background-color: white;
+ }
+
a {
text-align: center;
display: block;
<ul id="main-menu">
- <li><a href="{% url 'book_list' %}">{% trans "Literature" %}</a></li>
- <li><a href="{% url 'theme_catalogue' %}">{% trans "Themes" %}</a></li>
- <li><a href="{% url 'audiobook_list' %}">{% trans "Audiobooks" %}</a></li>
- <li><a href="{% url 'gallery' %}">{% trans "Gallery" %}</a></li>
- <li><a href="{% url 'catalogue' %}">Wszystkie utwory</a></li>
+ <li{% if active_menu_item == 'books' %} class="active"{% endif %}>
+ <a href="{% url 'book_list' %}">{% trans "Literature" %}</a>
+ </li>
+ <li{% if active_menu_item == 'theme' %} class="active"{% endif %}>
+ <a href="{% url 'theme_catalogue' %}">{% trans "Themes" %}</a>
+ </li>
+ <li{% if active_menu_item == 'audiobooks' %} class="active"{% endif %}>
+ <a href="{% url 'audiobook_list' %}">{% trans "Audiobooks" %}</a>
+ </li>
+ <li{% if active_menu_item == 'gallery' %} class="active"{% endif %}>
+ <a href="{% url 'gallery' %}">{% trans "Gallery" %}</a>
+ </li>
+ <li{% if active_menu_item == 'all_works' %} class="active"{% endif %}>
+ <a href="{% url 'catalogue' %}">{% trans "All works" %}</a>
+ </li>
</ul>