Collections in menu
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Dec 2012 13:35:58 +0000 (14:35 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Dec 2012 13:35:58 +0000 (14:35 +0100)
apps/catalogue/locale/pl/LC_MESSAGES/django.mo
apps/catalogue/locale/pl/LC_MESSAGES/django.po
apps/catalogue/models/collection.py
apps/catalogue/templates/catalogue/catalogue.html
apps/catalogue/templates/catalogue/collection_list.html [new file with mode: 0755]
apps/catalogue/templates/catalogue/menu.html
apps/catalogue/templatetags/catalogue_tags.py
apps/catalogue/views.py
apps/wolnelektury_core/static/css/header.css
apps/wolnelektury_core/static/css/screen.css

index ed68b42..a04bce5 100644 (file)
Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ
index 7682cd2..46e1524 100644 (file)
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-11-08 16:21+0100\n"
-"PO-Revision-Date: 2012-11-08 16:21+0100\n"
+"POT-Creation-Date: 2012-12-12 14:09+0100\n"
+"PO-Revision-Date: 2012-12-12 14:09+0100\n"
 "Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
 "Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
@@ -73,7 +73,7 @@ msgstr "Duży"
 msgid "Queue is full. Please try again later."
 msgstr ""
 
 msgid "Queue is full. Please try again later."
 msgstr ""
 
-#: views.py:525
+#: views.py:528
 #, python-format
 msgid ""
 "An error occurred: %(exception)s\n"
 #, python-format
 msgid ""
 "An error occurred: %(exception)s\n"
@@ -84,20 +84,20 @@ msgstr ""
 "\n"
 "%(tb)s"
 
 "\n"
 "%(tb)s"
 
-#: views.py:526
+#: views.py:529
 msgid "Book imported successfully"
 msgstr "Książka zaimportowana"
 
 msgid "Book imported successfully"
 msgstr "Książka zaimportowana"
 
-#: views.py:528
+#: views.py:531
 #, python-format
 msgid "Error importing file: %r"
 msgstr "Błąd podczas importowania pliku: %r"
 
 #, python-format
 msgid "Error importing file: %r"
 msgstr "Błąd podczas importowania pliku: %r"
 
-#: views.py:560
+#: views.py:563
 msgid "Download custom PDF"
 msgstr "Stwórz własny PDF"
 
 msgid "Download custom PDF"
 msgstr "Stwórz własny PDF"
 
-#: views.py:561
+#: views.py:564
 #: templates/catalogue/book_short.html:92
 #: templates/catalogue/book_text.html:28
 #: templates/catalogue/book_wide.html:63
 #: templates/catalogue/book_short.html:92
 #: templates/catalogue/book_text.html:28
 #: templates/catalogue/book_wide.html:63
@@ -415,7 +415,7 @@ msgid "Table of contents"
 msgstr ""
 
 #: templates/catalogue/book_text.html:24
 msgstr ""
 
 #: templates/catalogue/book_text.html:24
-#: templatetags/catalogue_tags.py:412
+#: templatetags/catalogue_tags.py:416
 #, fuzzy
 msgid "Themes"
 msgstr "motyw"
 #, fuzzy
 msgid "Themes"
 msgstr "motyw"
@@ -499,7 +499,7 @@ msgstr ""
 #: templates/catalogue/catalogue.html:19
 #: templates/catalogue/search_multiple_hits.html:17
 #: templates/catalogue/tagged_object_list.html:26
 #: templates/catalogue/catalogue.html:19
 #: templates/catalogue/search_multiple_hits.html:17
 #: templates/catalogue/tagged_object_list.html:26
-#: templatetags/catalogue_tags.py:408
+#: templatetags/catalogue_tags.py:412
 #, fuzzy
 msgid "Authors"
 msgstr "autor"
 #, fuzzy
 msgid "Authors"
 msgstr "autor"
@@ -507,14 +507,14 @@ msgstr "autor"
 #: templates/catalogue/catalogue.html:22
 #: templates/catalogue/search_multiple_hits.html:25
 #: templates/catalogue/tagged_object_list.html:34
 #: templates/catalogue/catalogue.html:22
 #: templates/catalogue/search_multiple_hits.html:25
 #: templates/catalogue/tagged_object_list.html:34
-#: templatetags/catalogue_tags.py:410
+#: templatetags/catalogue_tags.py:414
 msgid "Kinds"
 msgstr ""
 
 #: templates/catalogue/catalogue.html:25
 #: templates/catalogue/search_multiple_hits.html:33
 #: templates/catalogue/tagged_object_list.html:42
 msgid "Kinds"
 msgstr ""
 
 #: templates/catalogue/catalogue.html:25
 #: templates/catalogue/search_multiple_hits.html:33
 #: templates/catalogue/tagged_object_list.html:42
-#: templatetags/catalogue_tags.py:409
+#: templatetags/catalogue_tags.py:413
 #, fuzzy
 msgid "Genres"
 msgstr "gatunek"
 #, fuzzy
 msgid "Genres"
 msgstr "gatunek"
@@ -522,7 +522,7 @@ msgstr "gatunek"
 #: templates/catalogue/catalogue.html:28
 #: templates/catalogue/search_multiple_hits.html:41
 #: templates/catalogue/tagged_object_list.html:50
 #: templates/catalogue/catalogue.html:28
 #: templates/catalogue/search_multiple_hits.html:41
 #: templates/catalogue/tagged_object_list.html:50
-#: templatetags/catalogue_tags.py:411
+#: templatetags/catalogue_tags.py:415
 #, fuzzy
 msgid "Epochs"
 msgstr "epoka"
 #, fuzzy
 msgid "Epochs"
 msgstr "epoka"
@@ -531,6 +531,11 @@ msgstr "epoka"
 msgid "Themes and topics"
 msgstr ""
 
 msgid "Themes and topics"
 msgstr ""
 
+#: templates/catalogue/catalogue.html:34
+#: templates/catalogue/menu.html:29
+msgid "Collections"
+msgstr "Kolekcje"
+
 #: templates/catalogue/daisy_list.html:6
 #: templates/catalogue/daisy_list.html:12
 msgid "Listing of all DAISY files"
 #: templates/catalogue/daisy_list.html:6
 #: templates/catalogue/daisy_list.html:12
 msgid "Listing of all DAISY files"
@@ -581,6 +586,7 @@ msgid "See full category"
 msgstr "kategoria"
 
 #: templates/catalogue/menu.html:9
 msgstr "kategoria"
 
 #: templates/catalogue/menu.html:9
+#: templates/catalogue/menu.html.py:31
 msgid "Please wait…"
 msgstr ""
 
 msgid "Please wait…"
 msgstr ""
 
index 1c9027c..daee484 100644 (file)
@@ -23,3 +23,7 @@ class Collection(models.Model):
 
     def __unicode__(self):
         return self.title
 
     def __unicode__(self):
         return self.title
+
+    @models.permalink
+    def get_absolute_url(self):
+        return ("collection", [self.slug])
index 8a558ab..31c4d5b 100644 (file)
     <div class="white-box">{% tag_list categories.author %}</div>
 
     <h2 class="white-box">{% trans "Kinds" %}<a name="rodzaje"></a></h2>
     <div class="white-box">{% tag_list categories.author %}</div>
 
     <h2 class="white-box">{% trans "Kinds" %}<a name="rodzaje"></a></h2>
-    <div class="white-box">{% tag_list categories.kind %}</div>
+    <div class="white-box" lang="pl">{% tag_list categories.kind %}</div>
 
     <h2 class="white-box">{% trans "Genres" %}<a name="gatunki"></a></h2>
 
     <h2 class="white-box">{% trans "Genres" %}<a name="gatunki"></a></h2>
-    <div class="white-box">{% tag_list categories.genre %}</div>
+    <div class="white-box" lang="pl">{% tag_list categories.genre %}</div>
 
     <h2 class="white-box">{% trans "Epochs" %}<a name="epoki"></a></h2>
 
     <h2 class="white-box">{% trans "Epochs" %}<a name="epoki"></a></h2>
-    <div class="white-box">{% tag_list categories.epoch %}</div>
+    <div class="white-box" lang="pl">{% tag_list categories.epoch %}</div>
 
     <h2 class="white-box">{% trans "Themes and topics" %}<a name="motywy"></a></h2>
 
     <h2 class="white-box">{% trans "Themes and topics" %}<a name="motywy"></a></h2>
-    <div class="white-box">{% tag_list fragment_tags %}</div>
+    <div class="white-box" lang="pl">{% tag_list fragment_tags %}</div>
+
+    <h2 class="white-box">{% trans "Collections" %}<a name="kolekcje"></a></h2>
+    <div class="white-box" lang="pl">{% collection_list collections %}</div>
 
     </div>
 {% endblock %}
 
     </div>
 {% endblock %}
diff --git a/apps/catalogue/templates/catalogue/collection_list.html b/apps/catalogue/templates/catalogue/collection_list.html
new file mode 100755 (executable)
index 0000000..38466f1
--- /dev/null
@@ -0,0 +1,5 @@
+<ul>
+{% for collection in collections %}
+    <li><a href="{{ collection.get_absolute_url }}">{{ collection }}</a></li>
+{% endfor %}
+</ul>
index 72bf5e6..c87cd33 100644 (file)
                <a href="{% url daisy_list %}" class="menu">
                        <span class='mono'>{% trans "DAISY" %}</span></a>
        </li>
                <a href="{% url daisy_list %}" class="menu">
                        <span class='mono'>{% trans "DAISY" %}</span></a>
        </li>
+
+       <li class="hidden-box-wrapper menu">
+               <a href="{% url catalogue %}#kolekcje" class="hidden-box-trigger menu load-menu">
+                       <span class='mono'>{% trans "Collections" %}</span></a>
+               <div class="hidden-box" id="menu-collections">
+            <img src="{% static "img/indicator.gif" %}" alt="{% trans "Please wait…" %}" />
+        </div>
+       </li>
 </ul>
\ No newline at end of file
 </ul>
\ No newline at end of file
index af9bfae..6a30a9c 100644 (file)
@@ -311,6 +311,11 @@ def inline_tag_list(tags, choices=None):
     return tag_list(tags, choices)
 
 
     return tag_list(tags, choices)
 
 
+@register.inclusion_tag('catalogue/collection_list.html')
+def collection_list(collections):
+    return locals()
+
+
 @register.inclusion_tag('catalogue/book_info.html')
 def book_info(book):
     return locals()
 @register.inclusion_tag('catalogue/book_info.html')
 def book_info(book):
     return locals()
index 66036bf..6dd3d7e 100644 (file)
@@ -21,11 +21,10 @@ from django.utils.translation import ugettext as _, ugettext_lazy
 from django.views.decorators.cache import never_cache
 
 from ajaxable.utils import JSONResponse, AjaxableFormView
 from django.views.decorators.cache import never_cache
 
 from ajaxable.utils import JSONResponse, AjaxableFormView
-
 from catalogue import models
 from catalogue import forms
 from catalogue.utils import split_tags, MultiQuerySet
 from catalogue import models
 from catalogue import forms
 from catalogue.utils import split_tags, MultiQuerySet
-from catalogue.templatetags.catalogue_tags import tag_list
+from catalogue.templatetags.catalogue_tags import tag_list, collection_list
 from pdcounter import models as pdcounter_models
 from pdcounter import views as pdcounter_views
 from suggest.forms import PublishingSuggestForm
 from pdcounter import models as pdcounter_models
 from pdcounter import views as pdcounter_views
 from suggest.forms import PublishingSuggestForm
@@ -43,6 +42,7 @@ def catalogue(request):
         tag.count = tag.book_count
     categories = split_tags(tags)
     fragment_tags = categories.get('theme', [])
         tag.count = tag.book_count
     categories = split_tags(tags)
     fragment_tags = categories.get('theme', [])
+    collections = models.Collection.objects.all()
 
     if request.is_ajax():
         render_tag_list = lambda x: render_to_string(
 
     if request.is_ajax():
         render_tag_list = lambda x: render_to_string(
@@ -50,6 +50,8 @@ def catalogue(request):
         output = {'theme': render_tag_list(fragment_tags)}
         for category, tags in categories.items():
             output[category] = render_tag_list(tags)
         output = {'theme': render_tag_list(fragment_tags)}
         for category, tags in categories.items():
             output[category] = render_tag_list(tags)
+        output['collections'] = render_to_string(
+            'catalogue/collection_list.html', collection_list(collections))
         return JSONResponse(output)
     else:
         return render_to_response('catalogue/catalogue.html', locals(),
         return JSONResponse(output)
     else:
         return render_to_response('catalogue/catalogue.html', locals(),
index fefb65a..3e1a4af 100755 (executable)
@@ -153,6 +153,10 @@ a.menu {
     padding-top: 1.8em;
     color: #0c7076;
 }
     padding-top: 1.8em;
     color: #0c7076;
 }
+#menu a.hidden-box-trigger:hover {
+    border-bottom: 3px solid white;
+    margin-bottom: -3px;
+}
 a.menu span {
     font-size: 1.1em;
 }
 a.menu span {
     font-size: 1.1em;
 }
index 138121e..8522996 100644 (file)
     -webkit-column-width: 12em;
 }
 
     -webkit-column-width: 12em;
 }
 
+#menu-collections ul {
+    width: 18em;
+}
+
+
 #header-content, div#main-content, div#half-header-content, #footer-content {
     width: 97.5em;
     margin: auto;
 #header-content, div#main-content, div#half-header-content, #footer-content {
     width: 97.5em;
     margin: auto;