}
+@register.inclusion_tag('catalogue/menu.html')
+def catalogue_menu():
+ tags = Tag.objects.filter(
+ category__in=('author', 'epoch', 'genre', 'kind', 'theme')
+ ).exclude(book_count=0)
+ return split_tags(tags)
+
+
+
@register.simple_tag
def tag_url(category, slug):
return reverse('catalogue.views.tagged_object_list', args=[
font-size: 1.1em;
}
-#themes-list-toggle:after {
+.theme-list-link:after {
padding-left: 1em;
content: "↓";
font-family: WL-Nav;
vertical-align: middle;
}
-#themes-list-wrapper {
- position: relative;
+.theme-list-link {
font-size: 1.1em;
}
-#themes-list {
+.hidden-box-wrapper {
+ position: relative;
+}
+.hidden-box {
position: absolute;
display: none;
border: 1px solid #ddd;
box-shadow: 2px 2px 2px #ddd;
z-index: 500;
}
-#themes-list ul {
+.hidden-box ul {
list-style: none;
padding: 0;
margin: 0;
margin-left: 14em;
}
-.book-wide-box #themes-list-wrapper {
- margin-left: 14em;
+.book-wide-box #theme-list-wrapper {
+ margin-left: 15.4em;
}
height: 4.9em;
}
-ul#catalogue {
+ul#menu {
list-style: none;
padding: 0;
margin: 0 0 0 .6em;
}
-ul#catalogue li {
+li.menu {
background-color: #e2e2e2;
float: left;
}
-ul#catalogue a {
+a.menu {
display: block;
padding-left: 1.4em;
padding-right: 1.4em;
height: 3.1em;
padding-top: 1.8em;
}
-ul#catalogue span {
+a.menu span {
font-size: 1.1em;
}
+ (function() {
+ var $current = null;
+ $('.hidden-box-wrapper').each(function() {
+ var $hidden = $('.hidden-box', this);
+ $('.hidden-box-trigger', this).click(function(event) {
+ event.preventDefault();
+ if ($current == $hidden) {
+ $current = null;
+ $hidden.hide('fast');
+ } else {
+ $current && $current.hide('fast');
+ $hidden.show('fast');
+ $current = $hidden;
+ }
+ });
+ });
+ })();
<div id="tagline">
<span>
- {% cache 300 tagline %}
+ {% cache 300 tagline LANGUAGE_CODE %}
{% url book_list as b %}
{% url book_list as r %}
{% count_books book_count %}
<div id="main-content">
<div id="nav-line">
- <ul id="catalogue">
- <li><a href="{% url catalogue %}#autorzy"><span class='mono'>{% trans "Authors" %}</span></a></li>
- <li><a href="{% url catalogue %}#gatunki"><span class='mono'>{% trans "Genres" %}</span></a></li>
- <li><a href="{% url catalogue %}#rodzaje"><span class='mono'>{% trans "Kinds" %}</span></a></li>
- <li><a href="{% url catalogue %}#epoki"><span class='mono'>{% trans "Epochs" %}</span></a></li>
- <li><a href="{% url catalogue %}#motywy"><span class='mono'>{% trans "Themes" %}</span></a></li>
- <li><a href="{% url book_list %}"><span class='mono'>{% trans "All books" %}</span></a></li>
- <li><a href="{% url audiobook_list %}"><span class='mono'>{% trans "Audiobooks" %}</span></a></li>
- <li><a href="{% url daisy_list %}"><span class='mono'>{% trans "DAISY" %}</span></a></li>
- </ul>
+ {% cache 300 catalogue-menu LANGUAGE_CODE %}
+ {% catalogue_menu %}
+ {% endcache %}
<form action="{% url django.views.i18n.set_language %}" method="post">
<div id="lang-menu">
{% block book-box-extra-info %}
{% if themes %}
- <div id="themes-list-wrapper">
- <p><a class="mono" id="themes-list-toggle"
+ <div class="hidden-box-wrapper" id="theme-list-wrapper">
+ <p><a class="mono hidden-box-trigger theme-list-link"
href="#">{% trans "motifs and themes" %}</a></p>
- <div id="themes-list">
+ <div class="hidden-box">
<ul>
{% for theme in themes %}
<li><a href="{% url book_fragments book.slug theme.slug %}">{{ theme }} ({{ theme.count }})</a></li>
--- /dev/null
+{% load i18n %}
+{% load tag_list from catalogue_tags %}
+
+<ul id="menu">
+ <li class="hidden-box-wrapper menu">
+ <a href="{% url catalogue %}#autorzy" class="hidden-box-trigger menu">
+ <span class='mono'>{% trans "Authors" %}</span></a>
+ <div class="hidden-box">{% tag_list author %}</div>
+ </li>
+ <li class="hidden-box-wrapper menu">
+ <a href="{% url catalogue %}#gatunki" class="hidden-box-trigger menu">
+ <span class='mono'>{% trans "Genres" %}</span></a>
+ <div class="hidden-box">{% tag_list genre %}</div>
+ </li>
+ <li class="hidden-box-wrapper menu">
+ <a href="{% url catalogue %}#rodzaje" class="hidden-box-trigger menu">
+ <span class='mono'>{% trans "Kinds" %}</span></a>
+ <div class="hidden-box">{% tag_list kind %}</div>
+ </li>
+ <li class="hidden-box-wrapper menu">
+ <a href="{% url catalogue %}#epoki" class="hidden-box-trigger menu">
+ <span class='mono'>{% trans "Epochs" %}</span></a>
+ <div class="hidden-box">{% tag_list epoch %}</div>
+ </li>
+ <li class="hidden-box-wrapper menu">
+ <a href="{% url catalogue %}#motywy" class="hidden-box-trigger menu">
+ <span class='mono'>{% trans "Themes" %}</span></a>
+ <div class="hidden-box">{% tag_list theme %}</div>
+ </li>
+ <li class="menu">
+ <a href="{% url book_list %}" class="menu">
+ <span class='mono'>{% trans "All books" %}</span></a>
+ </li>
+ <li class="menu">
+ <a href="{% url audiobook_list %}" class="menu">
+ <span class='mono'>{% trans "Audiobooks" %}</span></a>
+ </li>
+ <li class="menu">
+ <a href="{% url daisy_list %}" class="menu">
+ <span class='mono'>{% trans "DAISY" %}</span></a>
+ </li>
+</ul>
\ No newline at end of file
</div>
{% if categories.theme %}
- <div id="themes-list-wrapper">
- <p><a href="#" id="themes-list-toggle" class="mono">{% trans "Motifs and themes" %}</a></p>
- <div id="themes-list">
+ <div class="hidden-box-wrapper">
+ <p><a href="#" class="hidden-box-trigger theme-list-link" class="mono">
+ {% trans "Motifs and themes" %}</a></p>
+ <div class="hidden-box">
{% tag_list categories.theme tags %}
</div>
</div>