From: Radek Czajka Date: Wed, 12 Dec 2012 13:35:58 +0000 (+0100) Subject: Collections in menu X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/a42b731727d0c4b8e372d001c5a1be776067eae8?ds=inline Collections in menu --- diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index ed68b42f9..a04bce574 100644 Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.po b/apps/catalogue/locale/pl/LC_MESSAGES/django.po index 7682cd2da..46e15242b 100644 --- a/apps/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/apps/catalogue/locale/pl/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" 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 \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -73,7 +73,7 @@ msgstr "Duży" msgid "Queue is full. Please try again later." msgstr "" -#: views.py:525 +#: views.py:528 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -84,20 +84,20 @@ msgstr "" "\n" "%(tb)s" -#: views.py:526 +#: views.py:529 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" -#: views.py:560 +#: views.py:563 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 @@ -415,7 +415,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:24 -#: templatetags/catalogue_tags.py:412 +#: templatetags/catalogue_tags.py:416 #, 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 -#: templatetags/catalogue_tags.py:408 +#: templatetags/catalogue_tags.py:412 #, 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 -#: 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 -#: templatetags/catalogue_tags.py:409 +#: templatetags/catalogue_tags.py:413 #, 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 -#: templatetags/catalogue_tags.py:411 +#: templatetags/catalogue_tags.py:415 #, fuzzy msgid "Epochs" msgstr "epoka" @@ -531,6 +531,11 @@ msgstr "epoka" 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" @@ -581,6 +586,7 @@ msgid "See full category" msgstr "kategoria" #: templates/catalogue/menu.html:9 +#: templates/catalogue/menu.html.py:31 msgid "Please wait…" msgstr "" diff --git a/apps/catalogue/models/collection.py b/apps/catalogue/models/collection.py index 1c9027c31..daee48461 100644 --- a/apps/catalogue/models/collection.py +++ b/apps/catalogue/models/collection.py @@ -23,3 +23,7 @@ class Collection(models.Model): def __unicode__(self): return self.title + + @models.permalink + def get_absolute_url(self): + return ("collection", [self.slug]) diff --git a/apps/catalogue/templates/catalogue/catalogue.html b/apps/catalogue/templates/catalogue/catalogue.html index 8a558abca..31c4d5b99 100644 --- a/apps/catalogue/templates/catalogue/catalogue.html +++ b/apps/catalogue/templates/catalogue/catalogue.html @@ -20,16 +20,19 @@
{% tag_list categories.author %}

{% trans "Kinds" %}

-
{% tag_list categories.kind %}
+
{% tag_list categories.kind %}

{% trans "Genres" %}

-
{% tag_list categories.genre %}
+
{% tag_list categories.genre %}

{% trans "Epochs" %}

-
{% tag_list categories.epoch %}
+
{% tag_list categories.epoch %}

{% trans "Themes and topics" %}

-
{% tag_list fragment_tags %}
+
{% tag_list fragment_tags %}
+ +

{% trans "Collections" %}

+
{% collection_list collections %}
{% endblock %} diff --git a/apps/catalogue/templates/catalogue/collection_list.html b/apps/catalogue/templates/catalogue/collection_list.html new file mode 100755 index 000000000..38466f157 --- /dev/null +++ b/apps/catalogue/templates/catalogue/collection_list.html @@ -0,0 +1,5 @@ + diff --git a/apps/catalogue/templates/catalogue/menu.html b/apps/catalogue/templates/catalogue/menu.html index 72bf5e6fe..c87cd3300 100644 --- a/apps/catalogue/templates/catalogue/menu.html +++ b/apps/catalogue/templates/catalogue/menu.html @@ -23,4 +23,12 @@ {% trans "DAISY" %} + + \ No newline at end of file diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index af9bfae74..6a30a9c26 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -311,6 +311,11 @@ def inline_tag_list(tags, choices=None): 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() diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 66036bf77..6dd3d7ec1 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -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 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 @@ -43,6 +42,7 @@ def catalogue(request): 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( @@ -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['collections'] = render_to_string( + 'catalogue/collection_list.html', collection_list(collections)) return JSONResponse(output) else: return render_to_response('catalogue/catalogue.html', locals(), diff --git a/apps/wolnelektury_core/static/css/header.css b/apps/wolnelektury_core/static/css/header.css index fefb65ab0..3e1a4af00 100755 --- a/apps/wolnelektury_core/static/css/header.css +++ b/apps/wolnelektury_core/static/css/header.css @@ -153,6 +153,10 @@ a.menu { 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; } diff --git a/apps/wolnelektury_core/static/css/screen.css b/apps/wolnelektury_core/static/css/screen.css index 138121e0c..8522996dc 100644 --- a/apps/wolnelektury_core/static/css/screen.css +++ b/apps/wolnelektury_core/static/css/screen.css @@ -18,6 +18,11 @@ -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;