From a42b731727d0c4b8e372d001c5a1be776067eae8 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 12 Dec 2012 14:35:58 +0100 Subject: [PATCH] Collections in menu --- .../catalogue/locale/pl/LC_MESSAGES/django.mo | Bin 2908 -> 2953 bytes .../catalogue/locale/pl/LC_MESSAGES/django.po | 30 +++++++++++------- apps/catalogue/models/collection.py | 4 +++ .../templates/catalogue/catalogue.html | 11 ++++--- .../templates/catalogue/collection_list.html | 5 +++ apps/catalogue/templates/catalogue/menu.html | 8 +++++ apps/catalogue/templatetags/catalogue_tags.py | 5 +++ apps/catalogue/views.py | 6 ++-- apps/wolnelektury_core/static/css/header.css | 4 +++ apps/wolnelektury_core/static/css/screen.css | 5 +++ 10 files changed, 60 insertions(+), 18 deletions(-) create mode 100755 apps/catalogue/templates/catalogue/collection_list.html diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index ed68b42f9b69069a9f697ffc879976bb9a5b7369..a04bce5742450db30b5a07cc39c33b3c6bf5b52d 100644 GIT binary patch delta 1272 zcmYk*J!n%=7{>9_G%-yYO>Au&zhaEm#@4hqX)Ri*OS(h_KM=&FMQVn&!6+$WQM`*0 zMF*wmAPy}kC@wffQ}K}Z{%+1a=RIHdzHhzS=6-1M z-ZGSaVgvEA&X^otsOLhN@fzdDSxn+X)T6h!7U!`Q7jPZ=ea19m0@be@o3S6);67Bp z5nN@AYo@qqpyCRu;Z2OY9gm?gDF(vOZNEl3Ji9oCes@5Rd;-!9~5=IETn7pV3NsI6Z_ z9aV(cxozBZaYLQSqPFM&hVU3_%TJ=(l~8AR4K=_F>c}2oJ3d3T|BTA>1Do(Ss(+YD zweLXfz@8xIuY@@&G~h65rV~gXa|R=L9>aJYHNai_{E_tuY5{ZBs`U-3-#gTfensW~ zjvDu8kp0(#AP21kVbs7;)Cv>GshCdWXVP4hU=X!}EUMjMRG#Cg2@j)=tZ3^?sD9^A z`7YY$WtSU{to8!+qTXzMhAE>o`=E89qDAnn$2>0G`+ zhtLAtE-tk*!3?32AT|-334My1IXh<76FSFkLPa~KvYpUsS&P|9>>!eac47;mqEA&v z>>+j%wk*w0Tc?tqo~>{8=^c$tm%Zi2Y_U+tk4}yiPn9YG--suZNu@LKbl-rpyUR&C vPVmsd)RFwzu@Ws(LnkKl1M!TLR-=FIDtG+lx`zG5LVjX&JYR_g_ImyTY8+^d delta 1216 zcmYk+Pe>GD7{~F)b+>KDQrm3RGF{89&D3_Ze7%|Lecj(`y71P=l#sQ^Um|m`@SlP&o5WmKN`e*RhK zjBj5#(2}nEg-ukVU*5ju?f*~-YgrbVLJi!2581XRD*_ zPg&B^ba1c>yHQJh2Gya6+PhIy;yb9Vx{En{jOss+%CmxL{DiuH4b^`OHS>BpDPJ3E zyf9$>^@JB_ppRX`M!bp*cpWvsxL?2LP9l@AX?NBwqwaf+TA4*u{$i)HW z_1C}~G-!r@kX5$7sCOVvr38(r8DvoXx=;i3pdL6xZQ(_4FQV?dg334S*RLTv73Jzj zjUSZ*)Jmw%DoUn-4ikFowVd0F9$HI#l+a5U5-R$H4-%Sfp3uJQ)9xb*!~oGtsKkiU zvFNZ`X-V3NE^j-5+NVxJFHR4ka;Qo)Lv4==6N}18>MU`b(C4gAwS&+qhALA5H(TFyogU!`VynDAnYxi&4#DX^@lUhlI`10D@)0Vn#xe>eC$7gbyxTR 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; -- 2.20.1