From c26ab6ee15974c1133a6d08c459b51199185f25f Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 20 Mar 2012 14:26:04 +0100 Subject: [PATCH] rearrangements: new core app, templates in apps, split settings; also: minor template changes in api and on main also: reports page is for staff only --- .gitignore | 4 + apps/api/locale/pl/LC_MESSAGES/django.mo | Bin 3418 -> 3368 bytes apps/api/locale/pl/LC_MESSAGES/django.po | 82 ++-- apps/api/settings.py | 0 apps/api/templates/api/main.html | 18 +- apps/api/urls.py | 2 +- apps/catalogue/models.py | 9 +- .../templates/catalogue/audiobook_list.html | 0 .../templates/catalogue/book_detail.html | 2 +- .../templates/catalogue/book_fragments.html | 0 .../templates/catalogue/book_info.html | 0 .../templates/catalogue/book_list.html | 0 .../templates/catalogue/book_mini_box.html | 0 .../templates/catalogue/book_searched.html | 0 .../templates/catalogue/book_sets.html | 0 .../templates/catalogue/book_short.html | 0 .../templates/catalogue/book_text.html | 0 .../templates/catalogue/book_wide.html | 0 .../templates/catalogue/catalogue.html | 0 .../templates/catalogue/collection.html | 0 .../templates/catalogue/daisy_list.html | 0 .../catalogue/differentiate_tags.html | 0 .../templates/catalogue/fragment_promo.html | 0 .../templates/catalogue/fragment_sets.html | 0 .../templates/catalogue/fragment_short.html | 0 .../templates/catalogue/inline_tag_list.html | 0 .../catalogue/latest_blog_posts.html | 0 .../catalogue}/templates/catalogue/menu.html | 0 .../templates/catalogue/picture_detail.html | 0 .../templates/catalogue/picture_list.html | 0 .../templates/catalogue/player.html | 0 .../templates/catalogue/related_books.html | 0 .../catalogue/search_multiple_hits.html | 0 .../templates/catalogue/search_no_hits.html | 0 .../templates/catalogue/search_too_short.html | 0 .../templates/catalogue/tag_list.html | 0 .../catalogue/tagged_object_list.html | 0 .../templates/catalogue/user_shelves.html | 0 .../templates/catalogue/work-list.html | 0 apps/catalogue/templatetags/catalogue_tags.py | 4 - .../templates/lesmianator/lesmianator.html | 0 .../templates/lesmianator/poem.html | 0 .../lessons/ajax_document_detail.html | 0 .../templates/lessons/document_detail.html | 0 .../templates/lessons/document_list.html | 0 .../templates/pdcounter/author_detail.html | 0 .../templates/pdcounter/book_stub_detail.html | 0 .../templates/picture/picture_short.html | 0 apps/reporting/views.py | 2 + .../search}/templates/newsearch/search.html | 0 apps/wolnelektury_core/__init__.py | 0 .../wolnelektury_core}/context_processors.py | 0 .../locale/de/LC_MESSAGES/django.mo | Bin .../locale/de/LC_MESSAGES/django.po | 0 .../locale/en/LC_MESSAGES/django.mo | Bin .../locale/en/LC_MESSAGES/django.po | 0 .../locale/es/LC_MESSAGES/django.mo | Bin .../locale/es/LC_MESSAGES/django.po | 0 .../locale/fr/LC_MESSAGES/django.mo | Bin .../locale/fr/LC_MESSAGES/django.po | 0 .../locale/it/LC_MESSAGES/django.mo | Bin .../locale/it/LC_MESSAGES/django.po | 0 .../locale/jp/LC_MESSAGES/django.mo | Bin .../locale/jp/LC_MESSAGES/django.po | 0 .../locale/lt/LC_MESSAGES/django.mo | Bin .../locale/lt/LC_MESSAGES/django.po | 0 .../locale/pl/LC_MESSAGES/django.mo | Bin .../locale/pl/LC_MESSAGES/django.po | 0 .../locale/ru/LC_MESSAGES/django.mo | Bin .../locale/ru/LC_MESSAGES/django.po | 0 .../locale/uk/LC_MESSAGES/django.mo | Bin .../locale/uk/LC_MESSAGES/django.po | 0 apps/wolnelektury_core/models.py | 0 .../wolnelektury_core}/templates/404.html | 0 .../wolnelektury_core}/templates/500.html | 0 .../wolnelektury_core}/templates/503.html | 0 .../templates/admin/base_site.html | 0 .../admin/catalogue/book/change_form.html | 0 .../admin/catalogue/book/change_list.html | 0 .../templates/auth/login.html | 0 .../templates/auth/login_register.html | 0 .../templates/auth/register.html | 0 .../wolnelektury_core}/templates/base.html | 0 .../templates/info/join_us.html | 0 .../templates/main_page.html | 6 +- .../templates/openid/login.html | 0 .../templates/pagination/pagination.html | 0 .../templates/piston/authorize_token.html | 0 .../templates/publish_plan.html | 0 .../templates/site_base.html | 0 .../templates/socialaccount/connections.html | 0 .../socialaccount/login_cancelled.html | 0 .../socialaccount/snippets/provider_list.html | 2 +- .../templates/superbase.html | 0 .../wolnelektury_core}/templates/user.html | 0 .../templatetags/__init__.py | 0 .../templatetags/common_tags.py | 7 + .../templatetags/switch_tag.py | 0 .../wolnelektury_core}/views.py | 0 .../locale-contrib}/django.pot | 0 .../locale-contrib}/pl/LC_MESSAGES/django.mo | Bin .../locale-contrib}/pl/LC_MESSAGES/django.po | 0 wolnelektury/settings.py | 355 ------------------ wolnelektury/settings/__init__.py | 102 +++++ wolnelektury/settings/auth.py | 8 + wolnelektury/settings/basic.py | 39 ++ wolnelektury/settings/cache.py | 26 ++ wolnelektury/settings/celery.py | 11 + wolnelektury/settings/custom.py | 23 ++ wolnelektury/settings/locale.py | 30 ++ wolnelektury/settings/paths.py | 3 + wolnelektury/settings/static.py | 120 ++++++ wolnelektury/urls.py | 12 +- 113 files changed, 440 insertions(+), 427 deletions(-) mode change 100755 => 100644 apps/api/settings.py rename {wolnelektury => apps/catalogue}/templates/catalogue/audiobook_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_detail.html (90%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_fragments.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_info.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_mini_box.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_searched.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_sets.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_short.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_text.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/book_wide.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/catalogue.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/collection.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/daisy_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/differentiate_tags.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/fragment_promo.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/fragment_sets.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/fragment_short.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/inline_tag_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/latest_blog_posts.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/menu.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/picture_detail.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/picture_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/player.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/related_books.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/search_multiple_hits.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/search_no_hits.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/search_too_short.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/tag_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/tagged_object_list.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/user_shelves.html (100%) rename {wolnelektury => apps/catalogue}/templates/catalogue/work-list.html (100%) rename {wolnelektury => apps/lesmianator}/templates/lesmianator/lesmianator.html (100%) rename {wolnelektury => apps/lesmianator}/templates/lesmianator/poem.html (100%) rename {wolnelektury => apps/lessons}/templates/lessons/ajax_document_detail.html (100%) rename {wolnelektury => apps/lessons}/templates/lessons/document_detail.html (100%) rename {wolnelektury => apps/lessons}/templates/lessons/document_list.html (100%) rename {wolnelektury => apps/pdcounter}/templates/pdcounter/author_detail.html (100%) rename {wolnelektury => apps/pdcounter}/templates/pdcounter/book_stub_detail.html (100%) rename {wolnelektury => apps/picture}/templates/picture/picture_short.html (100%) rename {wolnelektury => apps/search}/templates/newsearch/search.html (100%) create mode 100644 apps/wolnelektury_core/__init__.py rename {wolnelektury => apps/wolnelektury_core}/context_processors.py (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/de/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/de/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/en/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/en/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/es/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/es/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/fr/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/fr/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/it/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/it/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/jp/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/jp/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/lt/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/lt/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/pl/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/pl/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/ru/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/ru/LC_MESSAGES/django.po (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/uk/LC_MESSAGES/django.mo (100%) rename {wolnelektury => apps/wolnelektury_core}/locale/uk/LC_MESSAGES/django.po (100%) create mode 100644 apps/wolnelektury_core/models.py rename {wolnelektury => apps/wolnelektury_core}/templates/404.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/500.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/503.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/admin/base_site.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/admin/catalogue/book/change_form.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/admin/catalogue/book/change_list.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/auth/login.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/auth/login_register.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/auth/register.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/base.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/info/join_us.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/main_page.html (90%) rename {wolnelektury => apps/wolnelektury_core}/templates/openid/login.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/pagination/pagination.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/piston/authorize_token.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/publish_plan.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/site_base.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/socialaccount/connections.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/socialaccount/login_cancelled.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/socialaccount/snippets/provider_list.html (98%) rename {wolnelektury => apps/wolnelektury_core}/templates/superbase.html (100%) rename {wolnelektury => apps/wolnelektury_core}/templates/user.html (100%) create mode 100644 apps/wolnelektury_core/templatetags/__init__.py create mode 100644 apps/wolnelektury_core/templatetags/common_tags.py rename apps/{catalogue => wolnelektury_core}/templatetags/switch_tag.py (100%) rename {wolnelektury => apps/wolnelektury_core}/views.py (100%) mode change 100755 => 100644 rename {locale-contrib => wolnelektury/locale-contrib}/django.pot (100%) rename {locale-contrib => wolnelektury/locale-contrib}/pl/LC_MESSAGES/django.mo (100%) rename {locale-contrib => wolnelektury/locale-contrib}/pl/LC_MESSAGES/django.po (100%) delete mode 100644 wolnelektury/settings.py create mode 100644 wolnelektury/settings/__init__.py create mode 100644 wolnelektury/settings/auth.py create mode 100644 wolnelektury/settings/basic.py create mode 100644 wolnelektury/settings/cache.py create mode 100644 wolnelektury/settings/celery.py create mode 100644 wolnelektury/settings/custom.py create mode 100644 wolnelektury/settings/locale.py create mode 100644 wolnelektury/settings/paths.py create mode 100644 wolnelektury/settings/static.py diff --git a/.gitignore b/.gitignore index 230a87670..cef8774d8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ dev.sqlite /wolnelektury/static/css/book.min*.css /wolnelektury/static/js/book*.min.js /wolnelektury/static/js/jquery.min.js +/wolnelektury/static/css/ie.min*.css +/wolnelektury/static/css/screen.min*.css +/wolnelektury/static/js/base*.min.js # Python garbage *.pyc @@ -35,3 +38,4 @@ thumbs.db TAGS media +search_index diff --git a/apps/api/locale/pl/LC_MESSAGES/django.mo b/apps/api/locale/pl/LC_MESSAGES/django.mo index 5a352965816de68a0347b16a1e97c53cb587edc6..d7a620e353c4d3aba56a94722573b8a4e68190a8 100644 GIT binary patch delta 385 zcmXZYF-yZh7{>AEnkKDHQ_*e}q@ooa3T;HeeghXLXPr8@xJVZrIte-mLR?gYf(TAs zqJu&QOD9)x(9xlT_z9f+C%qf)chB*VH_2D!p>na*eU`Luq$ga=NJsdI%edo6-*}AY zxSN$u@fXY3aitkN!&$ts_U-+v&F`4>$2erxAAXPrId%2IA<9dSxIHCppi_`a6kFIM zZ~4+S{$L4DiW4u9itca@`_?zCk;gU{1Bu6pn64Zy5Q~8e8j)_{!@UQ;0Y7 LZO7IJ{;l~3M!Yg& delta 458 zcmajaJ4?e*6bJDC?c3G|+C^HyR@6n(+{6bogOj^bXORvOgP|=N4R)!cpoq{-5X42n zF^b|?e0%{F=_Jm61VR77kkzyN?m73|d+xo=b#uq#tvdjg0B-151ZdKCI!TwKz$b0e z3%U{m_Gvs0Wa$wdq~~;qUI#u0^=^=VQNRC(b~r1W0A85CCDFn?7gs4BrfWUG9L=YJ zel}L9zhBJ&Cv>Ejb$T24MA?E@nx`Lu-*kfcaNl2jp7J`d90o@rg8_h#2_xCoM7GEx z_#*JT;K?xj(f+td+Z3zbqv%9N*Bz%}sH*F_CAV(ZOxxUWwl{Z64O^`?EY&-VJqW4k z1#Q}xDNjjF%JkBrQZaX|EvsHr7OIYE6m+R+iYzPale31ddwYp9;T2P6^xyjrGN\n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: templates/api/main.html:4 +#: templates/api/main.html:6 msgid "WolneLektury.pl API" msgstr "API serwisu WolneLektury.pl" -#: templates/api/main.html:13 +#: templates/api/main.html:17 +#, python-format msgid "" "\n" -"WolneLektury.pl API resides under http://www.wolnelektury.pl/api/.\n" +"WolneLektury.pl API resides under %(u)s.\n" "You can use it to access information about books, their fragments and\n" "their metadata.\n" msgstr "" "\n" -"API serwisu WolneLektury.pl znajduje się pod adresem http://www." -"wolnelektury.pl/api/.\n" -"Za jego pomocą można uzyskać informacje o utworach, ich fragmentach i " -"metadanych.\n" +"API serwisu WolneLektury.pl znajduje się pod adresem %(u)s.\n" +"Za jego pomocą można uzyskać informacje o utworach, ich fragmentach i metadanych.\n" -#: templates/api/main.html:21 +#: templates/api/main.html:25 msgid "" "\n" "Default data serialization format is\n" -"JSON,\n" +"JSON, \n" "but you can also use XML by appending ?format=xml\n" "query parameter to each URL.\n" msgstr "" "\n" -"Dane domyślnie są serializowane w formacie JSON,ale dostępny jest też format XML – wystarczy dodać " -"parametr ?format=xml\n" +"Dane domyślnie są serializowane w formacie JSON,\n" +"ale dostępny jest też format XML – wystarczy dodać parametr ?format=xml\n" "do każdego zapytania.\n" -#: templates/api/main.html:30 +#: templates/api/main.html:34 msgid "" "\n" "The URLs in WolneLektury.pl API are:\n" @@ -58,31 +54,31 @@ msgstr "" "\n" "API Wolnych Lektur zawiera następujące adresy URL:\n" -#: templates/api/main.html:36 +#: templates/api/main.html:40 msgid "List of all books" msgstr "Lista utworów" -#: templates/api/main.html:38 +#: templates/api/main.html:42 msgid "List of all authors" msgstr "Lista autorów" -#: templates/api/main.html:39 +#: templates/api/main.html:43 msgid "List of all epochs" msgstr "Lista epok" -#: templates/api/main.html:40 +#: templates/api/main.html:44 msgid "List of all genres" msgstr "Lista gatunków literackich" -#: templates/api/main.html:41 +#: templates/api/main.html:45 msgid "List of all kinds" msgstr "Lista rodzajów literackich" -#: templates/api/main.html:43 +#: templates/api/main.html:47 msgid "List of all themes" msgstr "Lista motywów i tematów literackich" -#: templates/api/main.html:49 +#: templates/api/main.html:53 #, python-format msgid "" "\n" @@ -92,50 +88,40 @@ msgid "" "%(e2)s.\n" msgstr "" "\n" -"Każdy element na tych listach zawiera adres (w atrybucie „href”), pod którym " -"można znaleźć szczegółowe dane, np. %(e1)s czy %(e2)s.\n" +"Każdy element na tych listach zawiera adres (w atrybucie „href”), pod którym można znaleźć szczegółowe dane, np. %(e1)s czy %(e2)s.\n" -#: templates/api/main.html:58 +#: templates/api/main.html:62 #, python-format msgid "" "\n" -"You can combine authors, epochs, genres and kinds to find only books " -"matching\n" +"You can combine authors, epochs, genres and kinds to find only books matching\n" "those criteria. For instance:\n" "%(e)s.\n" msgstr "" "\n" -"Można łączyć autorów, epoki, gatunki i rodzaje, aby wybrać tylko utwory " -"odpowiadające zadanym kryteriom. Na przykład: %(e)s.\n" +"Można łączyć autorów, epoki, gatunki i rodzaje, aby wybrać tylko utwory odpowiadające zadanym kryteriom. Na przykład: %(e)s.\n" -#: templates/api/main.html:66 +#: templates/api/main.html:70 #, python-format msgid "" "\n" -"If you only want top-level books and not all the children, you can use /" -"parent_books/, as in:\n" +"If you only want top-level books and not all the children, you can use /parent_books/, as in:\n" "%(e)s.\n" msgstr "" "\n" -"Aby spośród wszystkich pasujących wybrać tylko utwory najwyższego poziomu " -"(pomijając ich podutwory), można użyć zapytania /parent_books/, np.: %(e)s.\n" +"Aby spośród wszystkich pasujących wybrać tylko utwory najwyższego poziomu (pomijając ich podutwory), można użyć zapytania /parent_books/, np.: %(e)s.\n" -#: templates/api/main.html:74 +#: templates/api/main.html:78 #, python-format msgid "" "\n" -"The same way, using also books and themes, you can search for a list of " -"fragments:\n" +"The same way, using also books and themes, you can search for a list of fragments:\n" "%(e)s. \n" -"Again, each entry has a \"href\" attribute which links to the fragment's " -"details, i.e.:\n" +"Again, each entry has a \"href\" attribute which links to the fragment's details, i.e.:\n" "%(f)s. \n" msgstr "" "\n" -"W ten sam sposób, filtrując dodatkowo według lektur lub motywów, można " -"wyszukiwać fragmenty:%(e)s. \n" -"Każdy element uzyskanej listy w atrybucie „href” zawiera link do " -"szczegółowego opisu danego fragmentu, np.:\n" +"W ten sam sposób, filtrując dodatkowo według lektur lub motywów, można wyszukiwać fragmenty:%(e)s. \n" +"Każdy element uzyskanej listy w atrybucie „href” zawiera link do szczegółowego opisu danego fragmentu, np.:\n" "%(f)s. \n" + diff --git a/apps/api/settings.py b/apps/api/settings.py old mode 100755 new mode 100644 diff --git a/apps/api/templates/api/main.html b/apps/api/templates/api/main.html index ada509342..8b6805945 100755 --- a/apps/api/templates/api/main.html +++ b/apps/api/templates/api/main.html @@ -1,5 +1,7 @@ {% extends "base.html" %} +{% load url from future %} {% load i18n %} +{% load common_tags %} {% block title %}{% trans "WolneLektury.pl API" %}{% endblock %} @@ -9,9 +11,11 @@

API

+

-{% blocktrans %} -WolneLektury.pl API resides under http://www.wolnelektury.pl/api/. +{% url "api" as u %} +{% blocktrans with u=u|build_absolute_uri:request %} +WolneLektury.pl API resides under {{ u }}. You can use it to access information about books, their fragments and their metadata. {% endblocktrans %} @@ -20,7 +24,7 @@ their metadata.

{% blocktrans %} Default data serialization format is -JSON, +JSON, but you can also use XML by appending ?format=xml query parameter to each URL. {% endblocktrans %} @@ -44,8 +48,8 @@ The URLs in WolneLektury.pl API are:

-{% url api_book "studnia-i-wahadlo" as e1 %} -{% url api_tag "authors" "edgar-allan-poe" as e2 %} +{% url "api_book" "studnia-i-wahadlo" as e1 %} +{% url "api_tag" "authors" "edgar-allan-poe" as e2 %} {% blocktrans %} Each element of those lists contains a link (in a "href") attibute which points to individual resource's details, i.e.: @@ -70,7 +74,7 @@ If you only want top-level books and not all the children, you can use /parent_b

-{% url api_fragment "sen-nocy-letniej" "1290526312912-3814598192" as f %} +{% url "api_fragment" "sen-nocy-letniej" "1290526312912-3814598192" as f %} {% blocktrans with "/api/authors/william-shakespeare/themes/zabawa/fragments/" as e %} The same way, using also books and themes, you can search for a list of fragments: {{e}}. @@ -78,5 +82,5 @@ Again, each entry has a "href" attribute which links to the fragment's details, {{f}}. {% endblocktrans %}

- +
{% endblock %} diff --git a/apps/api/urls.py b/apps/api/urls.py index fd97d63d9..7b96337e8 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -32,7 +32,7 @@ urlpatterns = patterns( ) + patterns('', url(r'^$', 'django.views.generic.simple.direct_to_template', - {'template': 'api/main.html'}), + {'template': 'api/main.html'}, name='api'), # changes handlers diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index cace1a596..556a8a1b8 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -216,13 +216,16 @@ def book_upload_path(ext=None, maxlen=100): return lambda *args: get_dynamic_path(*args, ext=ext, maxlen=maxlen) +def customizations_hash(customizations): + customizations.sort() + return hash(tuple(customizations)) + + def get_customized_pdf_path(book, customizations): """ Returns a MEDIA_ROOT relative path for a customized pdf. The name will contain a hash of customization options. """ - customizations.sort() - h = hash(tuple(customizations)) - + h = customizations_hash(customizations) pdf_name = '%s-custom-%s' % (book.slug, h) pdf_file = get_dynamic_path(None, pdf_name, ext='pdf') diff --git a/wolnelektury/templates/catalogue/audiobook_list.html b/apps/catalogue/templates/catalogue/audiobook_list.html similarity index 100% rename from wolnelektury/templates/catalogue/audiobook_list.html rename to apps/catalogue/templates/catalogue/audiobook_list.html diff --git a/wolnelektury/templates/catalogue/book_detail.html b/apps/catalogue/templates/catalogue/book_detail.html similarity index 90% rename from wolnelektury/templates/catalogue/book_detail.html rename to apps/catalogue/templates/catalogue/book_detail.html index a996d66ee..783b688d2 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/apps/catalogue/templates/catalogue/book_detail.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load cache i18n %} {% load thumbnail %} -{% load catalogue_tags pagination_tags %} +{% load common_tags catalogue_tags pagination_tags %} {% block titleextra %}{{ book.pretty_title }}{% endblock %} {% block ogimage %}{{ book.cover.url|build_absolute_uri:request }}{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_fragments.html b/apps/catalogue/templates/catalogue/book_fragments.html similarity index 100% rename from wolnelektury/templates/catalogue/book_fragments.html rename to apps/catalogue/templates/catalogue/book_fragments.html diff --git a/wolnelektury/templates/catalogue/book_info.html b/apps/catalogue/templates/catalogue/book_info.html similarity index 100% rename from wolnelektury/templates/catalogue/book_info.html rename to apps/catalogue/templates/catalogue/book_info.html diff --git a/wolnelektury/templates/catalogue/book_list.html b/apps/catalogue/templates/catalogue/book_list.html similarity index 100% rename from wolnelektury/templates/catalogue/book_list.html rename to apps/catalogue/templates/catalogue/book_list.html diff --git a/wolnelektury/templates/catalogue/book_mini_box.html b/apps/catalogue/templates/catalogue/book_mini_box.html similarity index 100% rename from wolnelektury/templates/catalogue/book_mini_box.html rename to apps/catalogue/templates/catalogue/book_mini_box.html diff --git a/wolnelektury/templates/catalogue/book_searched.html b/apps/catalogue/templates/catalogue/book_searched.html similarity index 100% rename from wolnelektury/templates/catalogue/book_searched.html rename to apps/catalogue/templates/catalogue/book_searched.html diff --git a/wolnelektury/templates/catalogue/book_sets.html b/apps/catalogue/templates/catalogue/book_sets.html similarity index 100% rename from wolnelektury/templates/catalogue/book_sets.html rename to apps/catalogue/templates/catalogue/book_sets.html diff --git a/wolnelektury/templates/catalogue/book_short.html b/apps/catalogue/templates/catalogue/book_short.html similarity index 100% rename from wolnelektury/templates/catalogue/book_short.html rename to apps/catalogue/templates/catalogue/book_short.html diff --git a/wolnelektury/templates/catalogue/book_text.html b/apps/catalogue/templates/catalogue/book_text.html similarity index 100% rename from wolnelektury/templates/catalogue/book_text.html rename to apps/catalogue/templates/catalogue/book_text.html diff --git a/wolnelektury/templates/catalogue/book_wide.html b/apps/catalogue/templates/catalogue/book_wide.html similarity index 100% rename from wolnelektury/templates/catalogue/book_wide.html rename to apps/catalogue/templates/catalogue/book_wide.html diff --git a/wolnelektury/templates/catalogue/catalogue.html b/apps/catalogue/templates/catalogue/catalogue.html similarity index 100% rename from wolnelektury/templates/catalogue/catalogue.html rename to apps/catalogue/templates/catalogue/catalogue.html diff --git a/wolnelektury/templates/catalogue/collection.html b/apps/catalogue/templates/catalogue/collection.html similarity index 100% rename from wolnelektury/templates/catalogue/collection.html rename to apps/catalogue/templates/catalogue/collection.html diff --git a/wolnelektury/templates/catalogue/daisy_list.html b/apps/catalogue/templates/catalogue/daisy_list.html similarity index 100% rename from wolnelektury/templates/catalogue/daisy_list.html rename to apps/catalogue/templates/catalogue/daisy_list.html diff --git a/wolnelektury/templates/catalogue/differentiate_tags.html b/apps/catalogue/templates/catalogue/differentiate_tags.html similarity index 100% rename from wolnelektury/templates/catalogue/differentiate_tags.html rename to apps/catalogue/templates/catalogue/differentiate_tags.html diff --git a/wolnelektury/templates/catalogue/fragment_promo.html b/apps/catalogue/templates/catalogue/fragment_promo.html similarity index 100% rename from wolnelektury/templates/catalogue/fragment_promo.html rename to apps/catalogue/templates/catalogue/fragment_promo.html diff --git a/wolnelektury/templates/catalogue/fragment_sets.html b/apps/catalogue/templates/catalogue/fragment_sets.html similarity index 100% rename from wolnelektury/templates/catalogue/fragment_sets.html rename to apps/catalogue/templates/catalogue/fragment_sets.html diff --git a/wolnelektury/templates/catalogue/fragment_short.html b/apps/catalogue/templates/catalogue/fragment_short.html similarity index 100% rename from wolnelektury/templates/catalogue/fragment_short.html rename to apps/catalogue/templates/catalogue/fragment_short.html diff --git a/wolnelektury/templates/catalogue/inline_tag_list.html b/apps/catalogue/templates/catalogue/inline_tag_list.html similarity index 100% rename from wolnelektury/templates/catalogue/inline_tag_list.html rename to apps/catalogue/templates/catalogue/inline_tag_list.html diff --git a/wolnelektury/templates/catalogue/latest_blog_posts.html b/apps/catalogue/templates/catalogue/latest_blog_posts.html similarity index 100% rename from wolnelektury/templates/catalogue/latest_blog_posts.html rename to apps/catalogue/templates/catalogue/latest_blog_posts.html diff --git a/wolnelektury/templates/catalogue/menu.html b/apps/catalogue/templates/catalogue/menu.html similarity index 100% rename from wolnelektury/templates/catalogue/menu.html rename to apps/catalogue/templates/catalogue/menu.html diff --git a/wolnelektury/templates/catalogue/picture_detail.html b/apps/catalogue/templates/catalogue/picture_detail.html similarity index 100% rename from wolnelektury/templates/catalogue/picture_detail.html rename to apps/catalogue/templates/catalogue/picture_detail.html diff --git a/wolnelektury/templates/catalogue/picture_list.html b/apps/catalogue/templates/catalogue/picture_list.html similarity index 100% rename from wolnelektury/templates/catalogue/picture_list.html rename to apps/catalogue/templates/catalogue/picture_list.html diff --git a/wolnelektury/templates/catalogue/player.html b/apps/catalogue/templates/catalogue/player.html similarity index 100% rename from wolnelektury/templates/catalogue/player.html rename to apps/catalogue/templates/catalogue/player.html diff --git a/wolnelektury/templates/catalogue/related_books.html b/apps/catalogue/templates/catalogue/related_books.html similarity index 100% rename from wolnelektury/templates/catalogue/related_books.html rename to apps/catalogue/templates/catalogue/related_books.html diff --git a/wolnelektury/templates/catalogue/search_multiple_hits.html b/apps/catalogue/templates/catalogue/search_multiple_hits.html similarity index 100% rename from wolnelektury/templates/catalogue/search_multiple_hits.html rename to apps/catalogue/templates/catalogue/search_multiple_hits.html diff --git a/wolnelektury/templates/catalogue/search_no_hits.html b/apps/catalogue/templates/catalogue/search_no_hits.html similarity index 100% rename from wolnelektury/templates/catalogue/search_no_hits.html rename to apps/catalogue/templates/catalogue/search_no_hits.html diff --git a/wolnelektury/templates/catalogue/search_too_short.html b/apps/catalogue/templates/catalogue/search_too_short.html similarity index 100% rename from wolnelektury/templates/catalogue/search_too_short.html rename to apps/catalogue/templates/catalogue/search_too_short.html diff --git a/wolnelektury/templates/catalogue/tag_list.html b/apps/catalogue/templates/catalogue/tag_list.html similarity index 100% rename from wolnelektury/templates/catalogue/tag_list.html rename to apps/catalogue/templates/catalogue/tag_list.html diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/apps/catalogue/templates/catalogue/tagged_object_list.html similarity index 100% rename from wolnelektury/templates/catalogue/tagged_object_list.html rename to apps/catalogue/templates/catalogue/tagged_object_list.html diff --git a/wolnelektury/templates/catalogue/user_shelves.html b/apps/catalogue/templates/catalogue/user_shelves.html similarity index 100% rename from wolnelektury/templates/catalogue/user_shelves.html rename to apps/catalogue/templates/catalogue/user_shelves.html diff --git a/wolnelektury/templates/catalogue/work-list.html b/apps/catalogue/templates/catalogue/work-list.html similarity index 100% rename from wolnelektury/templates/catalogue/work-list.html rename to apps/catalogue/templates/catalogue/work-list.html diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 61b384649..7d401289b 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -45,10 +45,6 @@ def capfirst(text): except IndexError: return '' -@register.filter -def build_absolute_uri(uri, request): - return request.build_absolute_uri(uri) - @register.simple_tag def html_title_from_tags(tags): diff --git a/wolnelektury/templates/lesmianator/lesmianator.html b/apps/lesmianator/templates/lesmianator/lesmianator.html similarity index 100% rename from wolnelektury/templates/lesmianator/lesmianator.html rename to apps/lesmianator/templates/lesmianator/lesmianator.html diff --git a/wolnelektury/templates/lesmianator/poem.html b/apps/lesmianator/templates/lesmianator/poem.html similarity index 100% rename from wolnelektury/templates/lesmianator/poem.html rename to apps/lesmianator/templates/lesmianator/poem.html diff --git a/wolnelektury/templates/lessons/ajax_document_detail.html b/apps/lessons/templates/lessons/ajax_document_detail.html similarity index 100% rename from wolnelektury/templates/lessons/ajax_document_detail.html rename to apps/lessons/templates/lessons/ajax_document_detail.html diff --git a/wolnelektury/templates/lessons/document_detail.html b/apps/lessons/templates/lessons/document_detail.html similarity index 100% rename from wolnelektury/templates/lessons/document_detail.html rename to apps/lessons/templates/lessons/document_detail.html diff --git a/wolnelektury/templates/lessons/document_list.html b/apps/lessons/templates/lessons/document_list.html similarity index 100% rename from wolnelektury/templates/lessons/document_list.html rename to apps/lessons/templates/lessons/document_list.html diff --git a/wolnelektury/templates/pdcounter/author_detail.html b/apps/pdcounter/templates/pdcounter/author_detail.html similarity index 100% rename from wolnelektury/templates/pdcounter/author_detail.html rename to apps/pdcounter/templates/pdcounter/author_detail.html diff --git a/wolnelektury/templates/pdcounter/book_stub_detail.html b/apps/pdcounter/templates/pdcounter/book_stub_detail.html similarity index 100% rename from wolnelektury/templates/pdcounter/book_stub_detail.html rename to apps/pdcounter/templates/pdcounter/book_stub_detail.html diff --git a/wolnelektury/templates/picture/picture_short.html b/apps/picture/templates/picture/picture_short.html similarity index 100% rename from wolnelektury/templates/picture/picture_short.html rename to apps/picture/templates/picture/picture_short.html diff --git a/apps/reporting/views.py b/apps/reporting/views.py index 958e08009..bf043f238 100644 --- a/apps/reporting/views.py +++ b/apps/reporting/views.py @@ -5,6 +5,7 @@ import os.path from datetime import date from django.conf import settings +from django.contrib.admin.views.decorators import staff_member_required from django.db.models import Count from django.shortcuts import render_to_response from django.template import RequestContext @@ -13,6 +14,7 @@ from catalogue.models import Book, BookMedia from reporting.utils import render_to_pdf, generated_file_view +@staff_member_required def stats_page(request): media = BookMedia.objects.count() media_types = BookMedia.objects.values('type').\ diff --git a/wolnelektury/templates/newsearch/search.html b/apps/search/templates/newsearch/search.html similarity index 100% rename from wolnelektury/templates/newsearch/search.html rename to apps/search/templates/newsearch/search.html diff --git a/apps/wolnelektury_core/__init__.py b/apps/wolnelektury_core/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wolnelektury/context_processors.py b/apps/wolnelektury_core/context_processors.py similarity index 100% rename from wolnelektury/context_processors.py rename to apps/wolnelektury_core/context_processors.py diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/de/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/de/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/de/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/de/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/de/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/de/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/en/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/en/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/en/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/en/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/en/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/en/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/en/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/en/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/es/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/es/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/es/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/es/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/es/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/es/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/es/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/es/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/fr/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/fr/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/fr/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/fr/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/fr/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/fr/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/fr/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/it/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/it/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/it/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/it/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/it/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/it/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/it/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/it/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/jp/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/jp/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/jp/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/jp/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/jp/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/jp/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/jp/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/jp/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/lt/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/lt/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/lt/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/lt/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/lt/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/lt/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/lt/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/lt/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/pl/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/pl/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/pl/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/pl/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/pl/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/pl/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/ru/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/ru/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/ru/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/ru/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/ru/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/ru/LC_MESSAGES/django.po diff --git a/wolnelektury/locale/uk/LC_MESSAGES/django.mo b/apps/wolnelektury_core/locale/uk/LC_MESSAGES/django.mo similarity index 100% rename from wolnelektury/locale/uk/LC_MESSAGES/django.mo rename to apps/wolnelektury_core/locale/uk/LC_MESSAGES/django.mo diff --git a/wolnelektury/locale/uk/LC_MESSAGES/django.po b/apps/wolnelektury_core/locale/uk/LC_MESSAGES/django.po similarity index 100% rename from wolnelektury/locale/uk/LC_MESSAGES/django.po rename to apps/wolnelektury_core/locale/uk/LC_MESSAGES/django.po diff --git a/apps/wolnelektury_core/models.py b/apps/wolnelektury_core/models.py new file mode 100644 index 000000000..e69de29bb diff --git a/wolnelektury/templates/404.html b/apps/wolnelektury_core/templates/404.html similarity index 100% rename from wolnelektury/templates/404.html rename to apps/wolnelektury_core/templates/404.html diff --git a/wolnelektury/templates/500.html b/apps/wolnelektury_core/templates/500.html similarity index 100% rename from wolnelektury/templates/500.html rename to apps/wolnelektury_core/templates/500.html diff --git a/wolnelektury/templates/503.html b/apps/wolnelektury_core/templates/503.html similarity index 100% rename from wolnelektury/templates/503.html rename to apps/wolnelektury_core/templates/503.html diff --git a/wolnelektury/templates/admin/base_site.html b/apps/wolnelektury_core/templates/admin/base_site.html similarity index 100% rename from wolnelektury/templates/admin/base_site.html rename to apps/wolnelektury_core/templates/admin/base_site.html diff --git a/wolnelektury/templates/admin/catalogue/book/change_form.html b/apps/wolnelektury_core/templates/admin/catalogue/book/change_form.html similarity index 100% rename from wolnelektury/templates/admin/catalogue/book/change_form.html rename to apps/wolnelektury_core/templates/admin/catalogue/book/change_form.html diff --git a/wolnelektury/templates/admin/catalogue/book/change_list.html b/apps/wolnelektury_core/templates/admin/catalogue/book/change_list.html similarity index 100% rename from wolnelektury/templates/admin/catalogue/book/change_list.html rename to apps/wolnelektury_core/templates/admin/catalogue/book/change_list.html diff --git a/wolnelektury/templates/auth/login.html b/apps/wolnelektury_core/templates/auth/login.html similarity index 100% rename from wolnelektury/templates/auth/login.html rename to apps/wolnelektury_core/templates/auth/login.html diff --git a/wolnelektury/templates/auth/login_register.html b/apps/wolnelektury_core/templates/auth/login_register.html similarity index 100% rename from wolnelektury/templates/auth/login_register.html rename to apps/wolnelektury_core/templates/auth/login_register.html diff --git a/wolnelektury/templates/auth/register.html b/apps/wolnelektury_core/templates/auth/register.html similarity index 100% rename from wolnelektury/templates/auth/register.html rename to apps/wolnelektury_core/templates/auth/register.html diff --git a/wolnelektury/templates/base.html b/apps/wolnelektury_core/templates/base.html similarity index 100% rename from wolnelektury/templates/base.html rename to apps/wolnelektury_core/templates/base.html diff --git a/wolnelektury/templates/info/join_us.html b/apps/wolnelektury_core/templates/info/join_us.html similarity index 100% rename from wolnelektury/templates/info/join_us.html rename to apps/wolnelektury_core/templates/info/join_us.html diff --git a/wolnelektury/templates/main_page.html b/apps/wolnelektury_core/templates/main_page.html similarity index 90% rename from wolnelektury/templates/main_page.html rename to apps/wolnelektury_core/templates/main_page.html index bcf76065d..2947a2f69 100755 --- a/wolnelektury/templates/main_page.html +++ b/apps/wolnelektury_core/templates/main_page.html @@ -46,11 +46,15 @@ diff --git a/wolnelektury/templates/openid/login.html b/apps/wolnelektury_core/templates/openid/login.html similarity index 100% rename from wolnelektury/templates/openid/login.html rename to apps/wolnelektury_core/templates/openid/login.html diff --git a/wolnelektury/templates/pagination/pagination.html b/apps/wolnelektury_core/templates/pagination/pagination.html similarity index 100% rename from wolnelektury/templates/pagination/pagination.html rename to apps/wolnelektury_core/templates/pagination/pagination.html diff --git a/wolnelektury/templates/piston/authorize_token.html b/apps/wolnelektury_core/templates/piston/authorize_token.html similarity index 100% rename from wolnelektury/templates/piston/authorize_token.html rename to apps/wolnelektury_core/templates/piston/authorize_token.html diff --git a/wolnelektury/templates/publish_plan.html b/apps/wolnelektury_core/templates/publish_plan.html similarity index 100% rename from wolnelektury/templates/publish_plan.html rename to apps/wolnelektury_core/templates/publish_plan.html diff --git a/wolnelektury/templates/site_base.html b/apps/wolnelektury_core/templates/site_base.html similarity index 100% rename from wolnelektury/templates/site_base.html rename to apps/wolnelektury_core/templates/site_base.html diff --git a/wolnelektury/templates/socialaccount/connections.html b/apps/wolnelektury_core/templates/socialaccount/connections.html similarity index 100% rename from wolnelektury/templates/socialaccount/connections.html rename to apps/wolnelektury_core/templates/socialaccount/connections.html diff --git a/wolnelektury/templates/socialaccount/login_cancelled.html b/apps/wolnelektury_core/templates/socialaccount/login_cancelled.html similarity index 100% rename from wolnelektury/templates/socialaccount/login_cancelled.html rename to apps/wolnelektury_core/templates/socialaccount/login_cancelled.html diff --git a/wolnelektury/templates/socialaccount/snippets/provider_list.html b/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html similarity index 98% rename from wolnelektury/templates/socialaccount/snippets/provider_list.html rename to apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html index 85bf0bcc0..3ca849360 100644 --- a/wolnelektury/templates/socialaccount/snippets/provider_list.html +++ b/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html @@ -1,5 +1,5 @@ {% load allauth_tags %} -{% load catalogue_tags %} +{% load common_tags %} {% if allauth.openid_enabled %}
  • diff --git a/wolnelektury/templates/superbase.html b/apps/wolnelektury_core/templates/superbase.html similarity index 100% rename from wolnelektury/templates/superbase.html rename to apps/wolnelektury_core/templates/superbase.html diff --git a/wolnelektury/templates/user.html b/apps/wolnelektury_core/templates/user.html similarity index 100% rename from wolnelektury/templates/user.html rename to apps/wolnelektury_core/templates/user.html diff --git a/apps/wolnelektury_core/templatetags/__init__.py b/apps/wolnelektury_core/templatetags/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/wolnelektury_core/templatetags/common_tags.py b/apps/wolnelektury_core/templatetags/common_tags.py new file mode 100644 index 000000000..ccaf03bfd --- /dev/null +++ b/apps/wolnelektury_core/templatetags/common_tags.py @@ -0,0 +1,7 @@ +from django import template +register = template.Library() + + +@register.filter +def build_absolute_uri(uri, request): + return request.build_absolute_uri(uri) diff --git a/apps/catalogue/templatetags/switch_tag.py b/apps/wolnelektury_core/templatetags/switch_tag.py similarity index 100% rename from apps/catalogue/templatetags/switch_tag.py rename to apps/wolnelektury_core/templatetags/switch_tag.py diff --git a/wolnelektury/views.py b/apps/wolnelektury_core/views.py old mode 100755 new mode 100644 similarity index 100% rename from wolnelektury/views.py rename to apps/wolnelektury_core/views.py diff --git a/locale-contrib/django.pot b/wolnelektury/locale-contrib/django.pot similarity index 100% rename from locale-contrib/django.pot rename to wolnelektury/locale-contrib/django.pot diff --git a/locale-contrib/pl/LC_MESSAGES/django.mo b/wolnelektury/locale-contrib/pl/LC_MESSAGES/django.mo similarity index 100% rename from locale-contrib/pl/LC_MESSAGES/django.mo rename to wolnelektury/locale-contrib/pl/LC_MESSAGES/django.mo diff --git a/locale-contrib/pl/LC_MESSAGES/django.po b/wolnelektury/locale-contrib/pl/LC_MESSAGES/django.po similarity index 100% rename from locale-contrib/pl/LC_MESSAGES/django.po rename to wolnelektury/locale-contrib/pl/LC_MESSAGES/django.po diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py deleted file mode 100644 index 5704f43c2..000000000 --- a/wolnelektury/settings.py +++ /dev/null @@ -1,355 +0,0 @@ -# -*- coding: utf-8 -*- -# Django settings for wolnelektury project. -from os import path - -PROJECT_DIR = path.abspath(path.dirname(__file__)) - -DEBUG = False -TEMPLATE_DEBUG = DEBUG -MAINTENANCE_MODE = False - -ADMINS = [ - # ('Your Name', 'your_email@domain.com'), -] - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': path.join(PROJECT_DIR, 'dev.db'), # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. - } -} - - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'Europe/Warsaw' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'pl' - -gettext = lambda s: s - -LANGUAGES = tuple(sorted([ - ('pl', u'polski'), - ('de', u'Deutsch'), - ('en', u'English'), - ('lt', u'lietuvių'), - ('fr', u'français'), - ('ru', u'русский'), - ('es', u'español'), - ('uk', u'українська'), -# ('jp', u'日本語'), -# ('it', u'italiano'), -], key=lambda x: x[0])) - - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = path.join(PROJECT_DIR, '../media/') -STATIC_ROOT = path.join(PROJECT_DIR, 'static/') -SEARCH_INDEX = path.join(MEDIA_ROOT, 'search/') - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '/media/' -STATIC_URL = '/static/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/admin-media/' - -# Make this unique, and don't share it with anybody. - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = [ - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.Loader', -] - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.request', - 'wolnelektury.context_processors.extra_settings', - 'search.context_processors.search_form', - "allauth.context_processors.allauth", - "allauth.account.context_processors.account", -) - -MIDDLEWARE_CLASSES = [ - 'django.middleware.cache.UpdateCacheMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.doc.XViewMiddleware', - 'pagination.middleware.PaginationMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'piwik.django.middleware.PiwikMiddleware', - 'maintenancemode.middleware.MaintenanceModeMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.cache.FetchFromCacheMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', -] - -ROOT_URLCONF = 'wolnelektury.urls' - -TEMPLATE_DIRS = [ - path.join(PROJECT_DIR, 'templates'), -] - - -AUTHENTICATION_BACKENDS = [ - 'django.contrib.auth.backends.ModelBackend', - 'allauth.account.auth_backends.AuthenticationBackend', -] -EMAIL_CONFIRMATION_DAYS = 2 -LOGIN_URL = '/uzytkownik/login/' - -LOGIN_REDIRECT_URL = '/' - -INSTALLED_APPS = [ - # external - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.admindocs', - 'pagination', - 'piston', - 'piwik.django', - #'rosetta', - 'south', - 'sorl.thumbnail', - 'djcelery', - 'djkombu', - # 'django_nose', - - #allauth stuff - 'emailconfirmation', - 'uni_form', - 'allauth', - 'allauth.account', - 'allauth.socialaccount', - 'allauth.openid', - #'allauth.facebook', - #'allauth.twitter', - - # included - 'compress', - 'modeltranslation', - - # our - 'ajaxable', - 'api', - 'catalogue', - 'chunks', - 'dictionary', - 'infopages', - 'lesmianator', - 'lessons', - 'newtagging', - 'opds', - 'pdcounter', - 'reporting', - 'sponsors', - 'stats', - 'suggest', - 'picture', - 'search', - 'social', -] - -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': [ - '127.0.0.1:11211', - ] - }, - 'permanent': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'TIMEOUT': 2419200, - 'LOCATION': [ - '127.0.0.1:11211', - ] - }, - 'api': { - 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', - 'LOCATION': path.join(PROJECT_DIR, 'django_cache/'), - 'KEY_PREFIX': 'api', - 'TIMEOUT': 86400, - }, -} -CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True - -# CSS and JavaScript file groups -COMPRESS_CSS = { - 'all': { - #'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css', 'css/facelist_2-0.css',), - 'source_filenames': [ - 'css/jquery.countdown.css', - - 'css/base.css', - 'css/cite.css', - 'css/header.css', - 'css/main_page.css', - 'css/dialogs.css', - 'css/picture_box.css', - 'css/book_box.css', - 'css/catalogue.css', - 'css/sponsors.css', - 'css/logo.css', - 'css/auth.css', - - 'css/social/shelf_tags.css', - 'css/ui-lightness/jquery-ui-1.8.16.custom.css', - ], - 'output_filename': 'css/all.min?.css', - }, - 'screen': { - 'source_filenames': ['css/screen.css'], - 'output_filename': 'css/screen.min?.css', - 'extra_context': { - 'media': 'screen and (min-width: 800px)', - }, - }, - 'ie': { - 'source_filenames': [ - 'css/ie.css', - ], - 'output_filename': 'css/ie.min?.css', - }, - 'book': { - 'source_filenames': [ - 'css/logo.css', - 'css/master.book.css', - ], - 'output_filename': 'css/book.min?.css', - }, - 'player': { - 'source_filenames': [ - 'jplayer/jplayer.blue.monday.css', - 'css/player.css', - ], - 'output_filename': 'css/player.min?.css', - }, - 'simple': { - 'source_filenames': ('css/simple.css',), - 'output_filename': 'css/simple.min?.css', - }, -} - -COMPRESS_JS = { - 'base': { - 'source_filenames': ( - 'js/jquery.cycle.min.js', - 'js/jquery.jqmodal.js', - 'js/jquery.form.js', - 'js/jquery.countdown.js', 'js/jquery.countdown-pl.js', - 'js/jquery.countdown-de.js', 'js/jquery.countdown-uk.js', - 'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js', - 'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js', - - 'js/jquery-ui-1.8.16.custom.min.js', - - 'js/locale.js', - 'js/dialogs.js', - 'js/sponsors.js', - 'js/base.js', - 'js/pdcounter.js', - - 'js/search.js', - ), - 'output_filename': 'js/base?.min.js', - }, - 'player': { - 'source_filenames': [ - 'jplayer/jquery.jplayer.min.js', - 'jplayer/jplayer.playlist.min.js', - 'js/player.js', - ], - 'output_filename': 'js/player.min?.js', - }, - 'book': { - 'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',), - 'output_filename': 'js/book?.min.js', - }, - 'book_ie': { - 'source_filenames': ('js/ierange-m2.js',), - 'output_filename': 'js/book_ie?.min.js', - } - -} - -COMPRESS_VERSION = True -COMPRESS_CSS_FILTERS = None - -THUMBNAIL_QUALITY = 95 - -TRANSLATION_REGISTRY = "wolnelektury.translation" - - -# seconds until a changes appears in the changes api -API_WAIT = 10 - -# limit number of filtering tags -MAX_TAG_LIST = 6 - -NO_BUILD_EPUB = False -NO_BUILD_TXT = False -NO_BUILD_PDF = False -NO_BUILD_MOBI = True -NO_SEARCH_INDEX = False - -ALL_EPUB_ZIP = 'wolnelektury_pl_epub' -ALL_PDF_ZIP = 'wolnelektury_pl_pdf' -ALL_MOBI_ZIP = 'wolnelektury_pl_mobi' - -CATALOGUE_DEFAULT_LANGUAGE = 'pol' -PUBLISH_PLAN_FEED = 'http://redakcja.wolnelektury.pl/documents/track/editor-proofreading/?published=false' - -PAGINATION_INVALID_PAGE_RAISES_404 = True - -import djcelery -djcelery.setup_loader() - -BROKER_BACKEND = "djkombu.transport.DatabaseTransport" -BROKER_HOST = "localhost" -BROKER_PORT = 5672 -BROKER_USER = "guest" -BROKER_PASSWORD = "guest" -BROKER_VHOST = "/" - -CELERY_EAGER_PROPAGATES_EXCEPTIONS = True - -LOCALE_PATHS = [ - path.join(PROJECT_DIR, '../locale-contrib') -] - -# Load localsettings, if they exist -try: - from localsettings import * -except ImportError: - pass - diff --git a/wolnelektury/settings/__init__.py b/wolnelektury/settings/__init__.py new file mode 100644 index 000000000..4d8b81b9c --- /dev/null +++ b/wolnelektury/settings/__init__.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# Django settings for wolnelektury project. +from os import path + +from settings.basic import * +from settings.auth import * +from settings.cache import * +from settings.celery import * +from settings.custom import * +from settings.locale import * +from settings.static import * + + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.request', + 'wolnelektury_core.context_processors.extra_settings', + 'search.context_processors.search_form', + "allauth.context_processors.allauth", + "allauth.account.context_processors.account", +) + +MIDDLEWARE_CLASSES = [ + 'django.middleware.cache.UpdateCacheMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'pagination.middleware.PaginationMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'piwik.django.middleware.PiwikMiddleware', + 'maintenancemode.middleware.MaintenanceModeMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.cache.FetchFromCacheMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', +] + +ROOT_URLCONF = 'wolnelektury.urls' + +INSTALLED_APPS = [ + # external + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'django.contrib.admindocs', + 'pagination', + 'piston', + 'piwik.django', + #'rosetta', + 'south', + 'sorl.thumbnail', + 'djcelery', + 'djkombu', + # 'django_nose', + + #allauth stuff + 'emailconfirmation', + 'uni_form', + 'allauth', + 'allauth.account', + 'allauth.socialaccount', + 'allauth.openid', + #'allauth.facebook', + #'allauth.twitter', + + # included + 'compress', + 'modeltranslation', + + # our + 'wolnelektury_core', + 'ajaxable', + 'api', + 'catalogue', + 'chunks', + 'dictionary', + 'infopages', + 'lesmianator', + #'lessons', + 'newtagging', + 'opds', + 'pdcounter', + 'reporting', + 'sponsors', + 'stats', + 'suggest', + 'picture', + 'search', + 'social', +] + +# Load localsettings, if they exist +try: + from localsettings import * +except ImportError: + pass + diff --git a/wolnelektury/settings/auth.py b/wolnelektury/settings/auth.py new file mode 100644 index 000000000..136db060d --- /dev/null +++ b/wolnelektury/settings/auth.py @@ -0,0 +1,8 @@ +AUTHENTICATION_BACKENDS = [ + 'django.contrib.auth.backends.ModelBackend', + 'allauth.account.auth_backends.AuthenticationBackend', +] +EMAIL_CONFIRMATION_DAYS = 2 +LOGIN_URL = '/uzytkownik/login/' + +LOGIN_REDIRECT_URL = '/' diff --git a/wolnelektury/settings/basic.py b/wolnelektury/settings/basic.py new file mode 100644 index 000000000..3dcb48450 --- /dev/null +++ b/wolnelektury/settings/basic.py @@ -0,0 +1,39 @@ +from os import path +from settings.paths import PROJECT_DIR + +DEBUG = False +TEMPLATE_DEBUG = DEBUG +MAINTENANCE_MODE = False + +ADMINS = [ + # ('Your Name', 'your_email@domain.com'), +] + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': path.join(PROJECT_DIR, 'dev.db'), # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + } +} + + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe/Warsaw' + +SITE_ID = 1 + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = [ + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', +] diff --git a/wolnelektury/settings/cache.py b/wolnelektury/settings/cache.py new file mode 100644 index 000000000..cc9024063 --- /dev/null +++ b/wolnelektury/settings/cache.py @@ -0,0 +1,26 @@ +from os import path +from settings.paths import PROJECT_DIR + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': [ + '127.0.0.1:11211', + ] + }, + 'permanent': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'TIMEOUT': 2419200, + 'LOCATION': [ + '127.0.0.1:11211', + ] + }, + 'api': { + 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', + 'LOCATION': path.join(PROJECT_DIR, '../django_cache/'), + 'KEY_PREFIX': 'api', + 'TIMEOUT': 86400, + }, +} +CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True +SEARCH_INDEX = path.join(PROJECT_DIR, '../search_index/') diff --git a/wolnelektury/settings/celery.py b/wolnelektury/settings/celery.py new file mode 100644 index 000000000..cb5dde97d --- /dev/null +++ b/wolnelektury/settings/celery.py @@ -0,0 +1,11 @@ +import djcelery +djcelery.setup_loader() + +BROKER_BACKEND = "djkombu.transport.DatabaseTransport" +BROKER_HOST = "localhost" +BROKER_PORT = 5672 +BROKER_USER = "guest" +BROKER_PASSWORD = "guest" +BROKER_VHOST = "/" + +CELERY_EAGER_PROPAGATES_EXCEPTIONS = True diff --git a/wolnelektury/settings/custom.py b/wolnelektury/settings/custom.py new file mode 100644 index 000000000..3031f4ed8 --- /dev/null +++ b/wolnelektury/settings/custom.py @@ -0,0 +1,23 @@ +PAGINATION_INVALID_PAGE_RAISES_404 = True +THUMBNAIL_QUALITY = 95 +TRANSLATION_REGISTRY = "wolnelektury.translation" + + +# seconds until a changes appears in the changes api +API_WAIT = 10 + +# limit number of filtering tags +MAX_TAG_LIST = 6 + +NO_BUILD_EPUB = False +NO_BUILD_TXT = False +NO_BUILD_PDF = False +NO_BUILD_MOBI = False +NO_SEARCH_INDEX = False + +ALL_EPUB_ZIP = 'wolnelektury_pl_epub' +ALL_PDF_ZIP = 'wolnelektury_pl_pdf' +ALL_MOBI_ZIP = 'wolnelektury_pl_mobi' + +CATALOGUE_DEFAULT_LANGUAGE = 'pol' +PUBLISH_PLAN_FEED = 'http://redakcja.wolnelektury.pl/documents/track/editor-proofreading/?published=false' diff --git a/wolnelektury/settings/locale.py b/wolnelektury/settings/locale.py new file mode 100644 index 000000000..7f9e90574 --- /dev/null +++ b/wolnelektury/settings/locale.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from os import path +from settings.paths import PROJECT_DIR + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +LOCALE_PATHS = [ + path.join(PROJECT_DIR, 'locale-contrib') +] + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'pl' + +gettext = lambda s: s + +LANGUAGES = tuple(sorted([ + ('pl', u'polski'), + ('de', u'Deutsch'), + ('en', u'English'), + ('lt', u'lietuvių'), + ('fr', u'français'), + ('ru', u'русский'), + ('es', u'español'), + ('uk', u'українська'), +# ('jp', u'日本語'), +# ('it', u'italiano'), +], key=lambda x: x[0])) diff --git a/wolnelektury/settings/paths.py b/wolnelektury/settings/paths.py new file mode 100644 index 000000000..b3ef30438 --- /dev/null +++ b/wolnelektury/settings/paths.py @@ -0,0 +1,3 @@ +from os import path + +PROJECT_DIR = path.dirname(path.abspath(path.dirname(__file__))) diff --git a/wolnelektury/settings/static.py b/wolnelektury/settings/static.py new file mode 100644 index 000000000..797433dcd --- /dev/null +++ b/wolnelektury/settings/static.py @@ -0,0 +1,120 @@ +from os import path +from settings.paths import PROJECT_DIR + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = path.join(PROJECT_DIR, '../media/') +STATIC_ROOT = path.join(PROJECT_DIR, 'static/') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/media/' +STATIC_URL = '/static/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/admin-media/' + +# CSS and JavaScript file groups +COMPRESS_CSS = { + 'all': { + #'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css', 'css/facelist_2-0.css',), + 'source_filenames': [ + 'css/jquery.countdown.css', + + 'css/base.css', + 'css/cite.css', + 'css/header.css', + 'css/main_page.css', + 'css/dialogs.css', + 'css/picture_box.css', + 'css/book_box.css', + 'css/catalogue.css', + 'css/sponsors.css', + 'css/logo.css', + 'css/auth.css', + + 'css/social/shelf_tags.css', + 'css/ui-lightness/jquery-ui-1.8.16.custom.css', + ], + 'output_filename': 'css/all.min?.css', + }, + 'screen': { + 'source_filenames': ['css/screen.css'], + 'output_filename': 'css/screen.min?.css', + 'extra_context': { + 'media': 'screen and (min-width: 800px)', + }, + }, + 'ie': { + 'source_filenames': [ + 'css/ie.css', + ], + 'output_filename': 'css/ie.min?.css', + }, + 'book': { + 'source_filenames': [ + 'css/logo.css', + 'css/master.book.css', + ], + 'output_filename': 'css/book.min?.css', + }, + 'player': { + 'source_filenames': [ + 'jplayer/jplayer.blue.monday.css', + 'css/player.css', + ], + 'output_filename': 'css/player.min?.css', + }, + 'simple': { + 'source_filenames': ('css/simple.css',), + 'output_filename': 'css/simple.min?.css', + }, +} + +COMPRESS_JS = { + 'base': { + 'source_filenames': ( + 'js/jquery.cycle.min.js', + 'js/jquery.jqmodal.js', + 'js/jquery.form.js', + 'js/jquery.countdown.js', 'js/jquery.countdown-pl.js', + 'js/jquery.countdown-de.js', 'js/jquery.countdown-uk.js', + 'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js', + 'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js', + + 'js/jquery-ui-1.8.16.custom.min.js', + + 'js/locale.js', + 'js/dialogs.js', + 'js/sponsors.js', + 'js/base.js', + 'js/pdcounter.js', + + 'js/search.js', + ), + 'output_filename': 'js/base?.min.js', + }, + 'player': { + 'source_filenames': [ + 'jplayer/jquery.jplayer.min.js', + 'jplayer/jplayer.playlist.min.js', + 'js/player.js', + ], + 'output_filename': 'js/player.min?.js', + }, + 'book': { + 'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',), + 'output_filename': 'js/book?.min.js', + }, + 'book_ie': { + 'source_filenames': ('js/ierange-m2.js',), + 'output_filename': 'js/book_ie?.min.js', + } + +} + +COMPRESS_VERSION = True +COMPRESS_CSS_FILTERS = None diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py index d0270365b..ce51801c5 100644 --- a/wolnelektury/urls.py +++ b/wolnelektury/urls.py @@ -4,12 +4,12 @@ import os from django.conf.urls.defaults import * from django.conf import settings from django.contrib import admin -import views +import wolnelektury_core.views admin.autodiscover() -urlpatterns = patterns('wolnelektury.views', +urlpatterns = patterns('wolnelektury_core.views', url(r'^$', 'main_page', name='main_page'), url(r'^planowane/$', 'publish_plan', name='publish_plan'), @@ -17,15 +17,15 @@ urlpatterns = patterns('wolnelektury.views', # Authentication url(r'^uzytkownik/$', 'user_settings', name='user_settings'), - url(r'^uzytkownik/login/$', views.LoginFormView(), name='login'), - url(r'^uzytkownik/signup/$', views.RegisterFormView(), name='register'), + url(r'^uzytkownik/login/$', wolnelektury_core.views.LoginFormView(), name='login'), + url(r'^uzytkownik/signup/$', wolnelektury_core.views.RegisterFormView(), name='register'), url(r'^uzytkownik/logout/$', 'logout_then_redirect', name='logout'), - url(r'^uzytkownik/zaloguj-utworz/$', views.LoginRegisterFormView(), name='login_register'), + url(r'^uzytkownik/zaloguj-utworz/$', wolnelektury_core.views.LoginRegisterFormView(), name='login_register'), ) urlpatterns += patterns('', url(r'^katalog/', include('catalogue.urls')), - url(r'^materialy/', include('lessons.urls')), + #url(r'^materialy/', include('lessons.urls')), url(r'^opds/', include('opds.urls')), url(r'^sugestia/', include('suggest.urls')), url(r'^lesmianator/', include('lesmianator.urls')), -- 2.20.1