From 71e8973b1dfead567e58ec8e3e7b80a64865ba5f Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 26 Nov 2013 14:06:52 +0100 Subject: [PATCH] Allow setting author for questions and editing some text chunks. --- chunks/__init__.py | 0 chunks/admin.py | 17 ++++ chunks/locale/de/LC_MESSAGES/django.mo | Bin 0 -> 850 bytes chunks/locale/de/LC_MESSAGES/django.po | 74 ++++++++++++++++ chunks/locale/en/LC_MESSAGES/django.mo | Bin 0 -> 814 bytes chunks/locale/en/LC_MESSAGES/django.po | 53 ++++++++++++ chunks/locale/es/LC_MESSAGES/django.mo | Bin 0 -> 876 bytes chunks/locale/es/LC_MESSAGES/django.po | 53 ++++++++++++ chunks/locale/fr/LC_MESSAGES/django.mo | Bin 0 -> 855 bytes chunks/locale/fr/LC_MESSAGES/django.po | 53 ++++++++++++ chunks/locale/it/LC_MESSAGES/django.mo | Bin 0 -> 846 bytes chunks/locale/it/LC_MESSAGES/django.po | 54 ++++++++++++ chunks/locale/jp/LC_MESSAGES/django.mo | Bin 0 -> 378 bytes chunks/locale/jp/LC_MESSAGES/django.po | 54 ++++++++++++ chunks/locale/lt/LC_MESSAGES/django.mo | Bin 0 -> 847 bytes chunks/locale/lt/LC_MESSAGES/django.po | 54 ++++++++++++ chunks/locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 1069 bytes chunks/locale/pl/LC_MESSAGES/django.po | 58 +++++++++++++ chunks/locale/ru/LC_MESSAGES/django.mo | Bin 0 -> 958 bytes chunks/locale/ru/LC_MESSAGES/django.po | 53 ++++++++++++ chunks/locale/uk/LC_MESSAGES/django.mo | Bin 0 -> 906 bytes chunks/locale/uk/LC_MESSAGES/django.po | 53 ++++++++++++ chunks/migrations/0001_initial.py | 59 +++++++++++++ chunks/migrations/__init__.py | 0 chunks/models.py | 47 ++++++++++ chunks/templatetags/__init__.py | 0 chunks/templatetags/chunks.py | 38 +++++++++ prawokultury/settings.d/30-apps.py | 1 + prawokultury/templates/base.html | 3 +- questions/admin.py | 1 + questions/locale/pl/LC_MESSAGES/django.mo | Bin 1392 -> 1840 bytes questions/locale/pl/LC_MESSAGES/django.po | 75 ++++++++++------ ...ag_name__add_field_question_answered_by.py | 80 ++++++++++++++++++ questions/models.py | 3 +- questions/templates/questions/ack_mail.html | 7 +- questions/templates/questions/ack_mail.txt | 7 +- .../templates/questions/question_detail.html | 2 +- .../templates/questions/question_form.html | 19 +---- .../templates/questions/question_list.html | 21 +---- 39 files changed, 866 insertions(+), 73 deletions(-) create mode 100644 chunks/__init__.py create mode 100644 chunks/admin.py create mode 100644 chunks/locale/de/LC_MESSAGES/django.mo create mode 100644 chunks/locale/de/LC_MESSAGES/django.po create mode 100644 chunks/locale/en/LC_MESSAGES/django.mo create mode 100644 chunks/locale/en/LC_MESSAGES/django.po create mode 100644 chunks/locale/es/LC_MESSAGES/django.mo create mode 100644 chunks/locale/es/LC_MESSAGES/django.po create mode 100644 chunks/locale/fr/LC_MESSAGES/django.mo create mode 100644 chunks/locale/fr/LC_MESSAGES/django.po create mode 100644 chunks/locale/it/LC_MESSAGES/django.mo create mode 100644 chunks/locale/it/LC_MESSAGES/django.po create mode 100644 chunks/locale/jp/LC_MESSAGES/django.mo create mode 100644 chunks/locale/jp/LC_MESSAGES/django.po create mode 100644 chunks/locale/lt/LC_MESSAGES/django.mo create mode 100644 chunks/locale/lt/LC_MESSAGES/django.po create mode 100644 chunks/locale/pl/LC_MESSAGES/django.mo create mode 100644 chunks/locale/pl/LC_MESSAGES/django.po create mode 100644 chunks/locale/ru/LC_MESSAGES/django.mo create mode 100644 chunks/locale/ru/LC_MESSAGES/django.po create mode 100644 chunks/locale/uk/LC_MESSAGES/django.mo create mode 100644 chunks/locale/uk/LC_MESSAGES/django.po create mode 100644 chunks/migrations/0001_initial.py create mode 100644 chunks/migrations/__init__.py create mode 100644 chunks/models.py create mode 100644 chunks/templatetags/__init__.py create mode 100644 chunks/templatetags/chunks.py create mode 100644 questions/migrations/0006_auto__del_unique_tag_name__add_field_question_answered_by.py diff --git a/chunks/__init__.py b/chunks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chunks/admin.py b/chunks/admin.py new file mode 100644 index 0000000..fc45cb7 --- /dev/null +++ b/chunks/admin.py @@ -0,0 +1,17 @@ +from django.contrib import admin +from fnpdjango.utils.models.translation import translated_fields +from .models import Chunk, Attachment + + +class ChunkAdmin(admin.ModelAdmin): + list_display = ('key', 'description',) + search_fields = ('key', ) + translated_fields(('content',)) + +admin.site.register(Chunk, ChunkAdmin) + + +class AttachmentAdmin(admin.ModelAdmin): + list_display = ('key',) + search_fields = ('key',) + +admin.site.register(Attachment, AttachmentAdmin) \ No newline at end of file diff --git a/chunks/locale/de/LC_MESSAGES/django.mo b/chunks/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..be5f8ae0ebfa0e0671a8b3482bf4660bec197078 GIT binary patch literal 850 zcma)(-)_?|7{v{Ye*tbl+<|0n-~zlQ>3}H(MAvmwwT)F>n7Bh;>Ly+ir`XQM_8vS0 z@6fwF1vfkcyaC5eN8tjAPdfhjOOB7e#NY2OeIY0hdH@yB9cT)<`T;$HenL;6dzTt- z8@z>n6TAuz!E4|L@H+T${yqh-pf_Luoj@z-zg{M!4SoZi|2|ANz=xpAdkng~XLGi| z+vp?E&AJ65irj>jAhf^Bopa@K5kJdyXIw7n&|1k)wV;ZZf{rUqZ6*!n*777Pg|h#0 zBw4L;T8(K^DeHWH99e7)nfaO(&D=W@CedSi11Pe5))7Xc$J%Uo^fQZY+y6SEk^$(h=R}r7Y;H{D|j8omVF&mv7UO z%VIgH$~WE)S82^t!D7Kn40O?ByW8LGEj}n%_PuWN16X`I!Jt-rwkwl@OVy@H#2f=B-273VgRzAWX1W^7*UX4NNC)5 literal 0 HcmV?d00001 diff --git a/chunks/locale/de/LC_MESSAGES/django.po b/chunks/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..7fbf84e --- /dev/null +++ b/chunks/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,74 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-04-11 22:56+0100\n" +"Last-Translator: Kamil \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "Schlüssel" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "Die einzigartige Bezeichnung für dieses Chunk von Inhalten" + +#: models.py:12 +msgid "description" +msgstr "Beschreibung" + +#: models.py:13 +msgid "content" +msgstr "Inhalt" + +#: models.py:17 +msgid "chunk" +msgstr "Chunk" + +#: models.py:18 +msgid "chunks" +msgstr "Chunks" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Die einzigartige Bezeichnung für diese Beilage" + +#: models.py:38 +msgid "attachment" +msgstr "Beilage" + +#: models.py:38 +msgid "attachments" +msgstr "Beilagen" + +#~ msgid "title" +#~ msgstr "Titel" + +#~ msgid "slug" +#~ msgstr "Slug" + +#~ msgid "file" +#~ msgstr "Datei" + +#~ msgid "author" +#~ msgstr "Autor" + +#~ msgid "slideshare ID" +#~ msgstr "Dia-ID" + +#~ msgid "HTML" +#~ msgstr "HTML" + +#~ msgid "document" +#~ msgstr "Dokument" diff --git a/chunks/locale/en/LC_MESSAGES/django.mo b/chunks/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..a81e430a792d5e7e9792e8865732ce3983d3abd7 GIT binary patch literal 814 zcma)3(QeZ)6g4my3qnXB@r01~gaq<%x*?5hAWG?`igc?=Ht~kM)J?s$cCa1jK7@bZ zBlrS7f^PuckvMLKf{-e4m2*$7eeUs1{O$J2CxVE8d%zU9348%Ud{!s1bWv6^>;lq0!(lV;w6+@M5oomkDk0xW)J;i(53_ zOtzjr;xXqCvZ4H-g84r>zJ->AKdE)8aGqsWXg3w!*o4mKbGnQ4JW7QwDp5$5Nij=k z+CJDn3M1~O>5Hk_Ft%tk7_Hyycbo5tH+a;kzn^92CFb;U?jM&^q4W;TC&D`EpB-g; rY`f8gF~-ueuFlO!=^~-qC(1|5E~WYL%M_)Ox%`i7Tj, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-03-04 20:05+0100\n" +"Last-Translator: xxx \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "key" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "A unique name for this piece of content" + +#: models.py:12 +msgid "description" +msgstr "description" + +#: models.py:13 +msgid "content" +msgstr "content" + +#: models.py:17 +msgid "chunk" +msgstr "piece" + +#: models.py:18 +msgid "chunks" +msgstr "pieces" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "A unique name for this attachment" + +#: models.py:38 +msgid "attachment" +msgstr "attachment" + +#: models.py:38 +msgid "attachments" +msgstr "attachments" diff --git a/chunks/locale/es/LC_MESSAGES/django.mo b/chunks/locale/es/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..83f03fb4dcd119d11aa9963b3ee86a9e3ff93c63 GIT binary patch literal 876 zcmaKq&u-H|5XKFZe+Gnr8{#mWkcu|g4ib?YP(yI5K+;sft>9E`*BfV3d)Mr40(}sk zgd2iW--9zpcmrk=w*e$r>GN;L{$@Pu@weM+A3aK>{<-9UXox%C5eAN3RU0Cnfw z(z}7YhVd5iB65VhgnWa%j6A5H=g12f8)Sldk6Oq0>v_)$k>8Owk$2H_3%QQGf@~wN zB9od!LN%3yRLDG`LSZS~mVSrjo z*`(ys{>#B8GkFAR3`|Mue7~ivw#HldmRAgFZ^jMNqOw9s?}#6JyIM^-v!s`ieXb4O zj$yacebw1cU_TkX?hSYR5wDcCWMFcUk>|7AkW|Is?+#Pa)ttIoB*n+Sb2hq~kr^b?0Q)vonm5!k!C54x&s-R7!pi|s! z<|P$HgQ@bF-={L4(VUZ%(=vvBXJ>oQ_1*6GHw)2FI$wFP-$8GXtPUAA0>8WbC?q|u zuzAZr*hf`Ch1>u(q1tf!bT8c^t(DL9Hs+cnlBrC{Jcibxu)dcRAXRy&Ih=f!f+?t| zrofHmKsB3)xdNI^XVR+wS$Vu<^5fuj`3GnmNedJ;@ReO-Y&hKI1?wI Kq{j+6=iV>iY36eP literal 0 HcmV?d00001 diff --git a/chunks/locale/es/LC_MESSAGES/django.po b/chunks/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000..4130ea1 --- /dev/null +++ b/chunks/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-02-18 13:02+0100\n" +"Last-Translator: Anna Jopp \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "clave" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "El nombre único para este elemento del contenido" + +#: models.py:12 +msgid "description" +msgstr "descripción" + +#: models.py:13 +msgid "content" +msgstr "contenido" + +#: models.py:17 +msgid "chunk" +msgstr "elemento" + +#: models.py:18 +msgid "chunks" +msgstr "elementos" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "El nombre único para este archivo adjunto" + +#: models.py:38 +msgid "attachment" +msgstr "archivo adjunto" + +#: models.py:38 +msgid "attachments" +msgstr "archivos adjuntos" diff --git a/chunks/locale/fr/LC_MESSAGES/django.mo b/chunks/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..1ef6af2864abe18a3e54109574511be48f65d526 GIT binary patch literal 855 zcmZ{h-)_?|6vhLLe?=1#T*AfS281S;G~1++jcKLprb4?_C7ZZIUh1aaQajiVV-LbR zz&q@2@4*c(0B^wO{#iE(EPeU;B;Pqc&iVOh;ah-Jfu2G+vhJZ@eX(!?16W{kKkSK)AV}=-a>4_ZRiwwj`;j$5WEC`f&RQjm>z;pz*)fxCf%t*yCe_m&^Czm(N4_aXo)O-)B&#QpwMyAjL<52HKDtN=w{1o(@Ms zx&JxRVX00?4=B~jdEb?k`PK$w-{gs4>g@}g8d*50Rd6ECg09iWB6Y0QXNSUAypE|` zZ@jPXHtDe0`_S6otMo*njbj~~$v%5qW|k#7rb>4|VGSd=uf?{x6EQ_$En?v^t3^~> zj#pkUg|#q*k@dtE>5E_UMJ$St60b%RUz=OU62q0vxzi@5X3psySK4vf;3IBio=dyB zby`%5e6!N#Dl2&=SR(i+rgnXA_rSNk(Qa?$vZ_rs_n_TQtJ9p{u~rQ$jmbY@$ytHk zo%rfr6*-q`ozfvUR=76@$qrka`+REyVOUe8x-V50)7p`AmEb^;(xcft3tbvYg>!-m xdGS3JbgU&N^=}&u4A1, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-02-22 20:52+0100\n" +"Last-Translator: Ela Janota \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "clé" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "Un nom unique pour ce fragment du contenu" + +#: models.py:12 +msgid "description" +msgstr "description" + +#: models.py:13 +msgid "content" +msgstr "contenu" + +#: models.py:17 +msgid "chunk" +msgstr "fragment" + +#: models.py:18 +msgid "chunks" +msgstr "fragments" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Un nom unique pour cette pièce jointe" + +#: models.py:38 +msgid "attachment" +msgstr "pièce jointe" + +#: models.py:38 +msgid "attachments" +msgstr "pièces jointes" diff --git a/chunks/locale/it/LC_MESSAGES/django.mo b/chunks/locale/it/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..a07410f3e807f92ead7d558a25bcc518601eee1b GIT binary patch literal 846 zcmaix-;NS76vjtg|BW#*dS&9p!5iI}t_%sf4q`+ELWEs{vm5VBcPK;Mp~bedvc89J z<0JSCK7!FV@GC>Wm>5sypd7jheT97dgeuT4=mB)+Lg{UQ zH;{M1%itKi0=@&Ug74S+8F&e~1rz8KR6+jjV#y!iHRQKo^1KWBI`=_eXBWH_}+SQXDRit2Iw>7!~? zt-{F0;!OJDfB9+=MNi^-t@I7Jbu2Ml*_=CVVp=Yj;ee~G;F(~F;PaRUt%Kf?Z|?bE z@G_Ts+GH;_9yB%V4?EkNM0?e+UEZ7}=L>Y`#L_)pv|!BlU%2%E-{nqi54hU&h#@ruL#;R$, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-02-21 16:52+0100\n" +"Last-Translator: xxx\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=2; plural=(n != 1)\n" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "Chiave" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "un nome unico per questo allegato" + +#: models.py:12 +msgid "description" +msgstr "descrizione" + +#: models.py:13 +msgid "content" +msgstr "contenuto" + +#: models.py:17 +msgid "chunk" +msgstr "blocco" + +#: models.py:18 +msgid "chunks" +msgstr "blocchi" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Un nome unico per questo allegato" + +#: models.py:38 +msgid "attachment" +msgstr "allegato" + +#: models.py:38 +msgid "attachments" +msgstr "allegati" diff --git a/chunks/locale/jp/LC_MESSAGES/django.mo b/chunks/locale/jp/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..ad2faa7ae531da84be2bb0022dc78d2241d88ab8 GIT binary patch literal 378 zcmYL^K~KUk7=|%=+R?Lz9=zd)9mI$g4V4vKTsJZXiQX#IIfL!e6{A1Izvpl9TVmu* zp7hY?Yv1qZ_~^TXIY3U3Q{)giL)r|HFRvWn6l?@b@kzk$`FmYOW9D+!B%}AeyeV_xN7bF}odfBBRr6@wK zKdSceKkrfS9ApL&C-)hXarY@pMUbe*L*bNZw#r+_$aI+`B;`_&k&rx2#ypC0u~^)q zYRa7|H56LCGm`Lhwrnepl4QKCde)VD2dm0hiv50Jj|LNKyf*mVSB<^B{`BYdR#oPj htY4LDw7*#vQyA{Ow$_VwAk5lsDpN8te6D=Z`2|k7W;_4@ literal 0 HcmV?d00001 diff --git a/chunks/locale/jp/LC_MESSAGES/django.po b/chunks/locale/jp/LC_MESSAGES/django.po new file mode 100644 index 0000000..dcc303c --- /dev/null +++ b/chunks/locale/jp/LC_MESSAGES/django.po @@ -0,0 +1,54 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "" + +#: models.py:12 +msgid "description" +msgstr "" + +#: models.py:13 +msgid "content" +msgstr "" + +#: models.py:17 +msgid "chunk" +msgstr "" + +#: models.py:18 +msgid "chunks" +msgstr "" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "" + +#: models.py:38 +msgid "attachment" +msgstr "" + +#: models.py:38 +msgid "attachments" +msgstr "" diff --git a/chunks/locale/lt/LC_MESSAGES/django.mo b/chunks/locale/lt/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..6131fd5170b25ea597424b3d556ea126b60f1a5c GIT binary patch literal 847 zcmZ{f&2G~`6on0xKO;6Eb|8iYVu2>u4MoMJh!D~ek+e}rs_v>=d*V!!%!HY7ArHa> z^gY;i$t&;%Nbm-niK7H6G1Bqp>wE6?nICu7z6LlUbRQZ+x1n#4KfjZnXsvmQzx|wMq(Cpj6M;mnyG&&tE=` z;wXZVcg3mn%P;t%n8h!WxLW#JWF7ArQg%#En}pSra1^#kK&uIAT#{qf!lnzLFyv7nYr$NzJB4iVUDr v%9Natz0h}skqW+?j%oalZ$1fsNg2!?s7uOVJ~^`iO%0u&&HQRZBM1BeAJf_l literal 0 HcmV?d00001 diff --git a/chunks/locale/lt/LC_MESSAGES/django.po b/chunks/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 0000000..a78804a --- /dev/null +++ b/chunks/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,54 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-03-01 16:13+0100\n" +"Last-Translator: Aneta\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" +"X-Translated-Using: django-rosetta 0.5.3\n" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "raktas" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "Unikalus šio turinio gabalo pavadnimas" + +#: models.py:12 +msgid "description" +msgstr "aprašymas" + +#: models.py:13 +msgid "content" +msgstr "turinys" + +#: models.py:17 +msgid "chunk" +msgstr "gabalas" + +#: models.py:18 +msgid "chunks" +msgstr "gabalai" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Unikalus šio priedo pavadnimas" + +#: models.py:38 +msgid "attachment" +msgstr "priedas" + +#: models.py:38 +msgid "attachments" +msgstr "priedai" diff --git a/chunks/locale/pl/LC_MESSAGES/django.mo b/chunks/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..2cc484021a55f748c04eb1c1315f9c291facd505 GIT binary patch literal 1069 zcma))J#P~+7{?8iw*V4lU}7*8Qjw4^cYQ(SNTY@js*1FYLV}Q(9`2mPxvPEH4rwx0 zLa;J)Dj$FeiGdBaWAOIG3x>4R_wv;?B8o zdIEBBN(UFi#Umx!lj3EMQwckqwv?u}BMb#=A?oaKX-`r_ot{jnYSBnZ>vT=SX#r?Q z^VaHI$J#8+=k2bsgOqzpxASww2H&+J<%K*HsToKMyB;}~=xA!lIQry|i)n_Kn@Eey z3MEOx2c)J|mq(Uu#Ox{82Dd|6E0rIY)+_XBrT%1Ndn;GxnbMYRnzo49gI?RPh6-t} zw%uT5&B4WD55e+~F8IMB3j(%qmj+9r@89tQ-$x;<^H;(J|F#O z>k#vVmWR+yfEF~w3O#)<8gHyg)mPDw8wr_8O#<$Qyeuu|svz4vXmi%!uoKd1X=}ad z`YBYaYpHOuVs3L|vvSmN;Q6`oV2PAmn`-bwC?#SDTGTY~@Jj3T<)C zDl$^BknNDJybw0`>~9M^W=%78#9b^&F|9C+1?qdt-XaRux#W7%YEAK2SQ?;bDMy-8 zB#=tL7d7kyjZ?sa+KLWgw0HPA8anrhq6GRV!yB`jj}9V1nxij+E;Y$$4`M0)|ABer hSia+PK_)qPGMyv>-F?tjjSddq5S0l-lC&2M$seglB|iWF literal 0 HcmV?d00001 diff --git a/chunks/locale/pl/LC_MESSAGES/django.po b/chunks/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..4e0416a --- /dev/null +++ b/chunks/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-11-26 14:00+0100\n" +"PO-Revision-Date: 2013-11-26 14:01+0100\n" +"Last-Translator: Radek Czajka \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Translated-Using: django-rosetta 0.5.3\n" +"X-Generator: Poedit 1.5.4\n" + +#: models.py:13 models.py:39 +msgid "key" +msgstr "klucz" + +#: models.py:13 +msgid "A unique name for this chunk of content" +msgstr "Unikalna nazwa dla tego kawałka treści" + +#: models.py:14 +msgid "description" +msgstr "opis" + +#: models.py:18 +msgid "chunk" +msgstr "kawałek" + +#: models.py:19 +msgid "chunks" +msgstr "kawałki" + +#: models.py:33 +msgid "content" +msgstr "zawartość" + +#: models.py:34 +msgid "Use Textile syntax." +msgstr "Użyj składni Textile." + +#: models.py:39 +msgid "A unique name for this attachment" +msgstr "Unikalna nazwa dla tego załącznika" + +#: models.py:44 +msgid "attachment" +msgstr "załącznik" + +#: models.py:44 +msgid "attachments" +msgstr "załączniki" diff --git a/chunks/locale/ru/LC_MESSAGES/django.mo b/chunks/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..e1d650c7fc5026f4aa713af3cfd96bb9fedd4459 GIT binary patch literal 958 zcmb7<&2G~`6om&Ue?~~Cuw*f;SfD9(+C^~-A`NL3k+e~8B6etSCXPvB2YUjk#DXFu z7W`zz6TpIHB$^7fA$^7M3-AJL;0-v_LQBcBDTCj^OJEu% z%?fw{Y=E=ivq`@<>3;;zpg#Z+Mb1Jq5X#?6&!Lx|1Mvrb{XRV>Nz+c?Kkf(`@Rp#p zFru>V$COLS-Fiy|@?Q?O-U%8stWh@%r1t%BWcnME1K;?IV&bie*p2+Q^uvHO#3m_5 z;UnQnmaDRgh+?#DT1;o|rq{Bxk}ciKZLAw5(GDZY3bE%`*-FQYnG@R7C~i0`6A7-f z*c~o~O;e_oV&*)vQq-Ea7j9fLEz^XNmBbTYhad8p3pACoEpzP4^H?$`;z8WxGK_56 z?RM!hKDUfK54;Zd1aky$*)*SCUn}bom-G4CO@A(oyr~DH6>^2_^gY&`X=KLlXU=9D zb4t;b*V|3*2TRng^C%YbX4zR~i&LK-qb4Gj4cxHm2cAtAANtZD>Vx{KzNlT*S9{4D z{EyUtqA^T*RBfZzqsiOk1=^q0h^qbMIX3rD?x=x2ne_fMB6*33KGKFd0LgutY$0!3 t4Y09;tx4*UtJHw}_5Q<&, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-03-04 22:10+0100\n" +"Last-Translator: xxx \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "ключ" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "Уникальное имя для этого фрагмента содержания" + +#: models.py:12 +msgid "description" +msgstr "описание" + +#: models.py:13 +msgid "content" +msgstr "содержание" + +#: models.py:17 +msgid "chunk" +msgstr "фрагмент" + +#: models.py:18 +msgid "chunks" +msgstr "фрагменты" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Уникальное имя для этого приложения" + +#: models.py:38 +msgid "attachment" +msgstr "приложение" + +#: models.py:38 +msgid "attachments" +msgstr "приложения" diff --git a/chunks/locale/uk/LC_MESSAGES/django.mo b/chunks/locale/uk/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..7c5388e7ca96d40ddfc17d0678946c3afb01ffb8 GIT binary patch literal 906 zcma)%&2G~`6om&Ue@3u?EsJ5r0!^{gN-b`w8bVq{q)imuiWO*ZCXQ)h2YUkPG9b|n zf(?WRV8b#3B%-tpuP}ZAwrt@IIMYP9MXJO|XFlJVbFa_*xIFcqU>VR=r~zGs_8`4} zLD!()&~@m_iLrM9ynuQIJPlUBGvEX8Ecj@0?}4XK$Dj#4hn7%(I!Q8}BG4-l~Y*$ZttM49J$)Cgmu6B3#J| zRkkUj7{@j(XLI+mt9iPauiP(`){Tm2g^^@yvFBIWowgS8_o)wPklN@O++joxM9@~Je$rx_N778N41~y)KK-+Zt_~~t3K76 z`ldeX&#yRrOOsc)8mTX8q)$drKY5{s$;Z|9V;8Lh{9{1zlf9&;5A>vT j@JJ00mqRrmM>_jQ%K=FT5v2RB21%FTNxR9LWQY6#=g2nU literal 0 HcmV?d00001 diff --git a/chunks/locale/uk/LC_MESSAGES/django.po b/chunks/locale/uk/LC_MESSAGES/django.po new file mode 100644 index 0000000..edb9b06 --- /dev/null +++ b/chunks/locale/uk/LC_MESSAGES/django.po @@ -0,0 +1,53 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-19 11:39+0200\n" +"PO-Revision-Date: 2012-03-04 17:29+0100\n" +"Last-Translator: xxx \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" + +#: models.py:11 models.py:33 +msgid "key" +msgstr "ключ" + +#: models.py:11 +msgid "A unique name for this chunk of content" +msgstr "Унікальна назва для цієї частини змісту" + +#: models.py:12 +msgid "description" +msgstr "опис" + +#: models.py:13 +msgid "content" +msgstr "зміст" + +#: models.py:17 +msgid "chunk" +msgstr "частина" + +#: models.py:18 +msgid "chunks" +msgstr "частини" + +#: models.py:33 +msgid "A unique name for this attachment" +msgstr "Унікальна назва для цього додатку" + +#: models.py:38 +msgid "attachment" +msgstr "додаток" + +#: models.py:38 +msgid "attachments" +msgstr "додатки" diff --git a/chunks/migrations/0001_initial.py b/chunks/migrations/0001_initial.py new file mode 100644 index 0000000..1fd5e1d --- /dev/null +++ b/chunks/migrations/0001_initial.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'Chunk' + db.create_table('chunks_chunk', ( + ('key', self.gf('django.db.models.fields.CharField')(max_length=255, primary_key=True)), + ('description', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), + ('content_pl', self.gf('markupfield.fields.MarkupField')(rendered_field=True, blank=True)), + ('content_en', self.gf('markupfield.fields.MarkupField')(rendered_field=True, blank=True)), + ('content_pl_markup_type', self.gf('django.db.models.fields.CharField')(default=None, max_length=30, blank=True)), + ('content_en_markup_type', self.gf('django.db.models.fields.CharField')(default=None, max_length=30, blank=True)), + ('_content_pl_rendered', self.gf('django.db.models.fields.TextField')()), + ('_content_en_rendered', self.gf('django.db.models.fields.TextField')()), + )) + db.send_create_signal('chunks', ['Chunk']) + + # Adding model 'Attachment' + db.create_table('chunks_attachment', ( + ('key', self.gf('django.db.models.fields.CharField')(max_length=255, primary_key=True)), + ('attachment', self.gf('django.db.models.fields.files.FileField')(max_length=100)), + )) + db.send_create_signal('chunks', ['Attachment']) + + + def backwards(self, orm): + # Deleting model 'Chunk' + db.delete_table('chunks_chunk') + + # Deleting model 'Attachment' + db.delete_table('chunks_attachment') + + + models = { + 'chunks.attachment': { + 'Meta': {'ordering': "('key',)", 'object_name': 'Attachment'}, + 'attachment': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'primary_key': 'True'}) + }, + 'chunks.chunk': { + 'Meta': {'ordering': "('key',)", 'object_name': 'Chunk'}, + '_content_en_rendered': ('django.db.models.fields.TextField', [], {}), + '_content_pl_rendered': ('django.db.models.fields.TextField', [], {}), + 'content_en': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True', 'blank': 'True'}), + 'content_en_markup_type': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'blank': 'True'}), + 'content_pl': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True', 'blank': 'True'}), + 'content_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '30', 'blank': 'True'}), + 'description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '255', 'primary_key': 'True'}) + } + } + + complete_apps = ['chunks'] \ No newline at end of file diff --git a/chunks/migrations/__init__.py b/chunks/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chunks/models.py b/chunks/models.py new file mode 100644 index 0000000..f16af08 --- /dev/null +++ b/chunks/models.py @@ -0,0 +1,47 @@ +from django.core.cache import cache +from django.db import models +from django.utils.translation import ugettext_lazy as _ +from markupfield.fields import MarkupField +from fnpdjango.utils.models.translation import add_translatable + + +class Chunk(models.Model): + """ + A Chunk is a piece of content associated with a unique key that can be inserted into + any template with the use of a special template tag. + """ + key = models.CharField(_('key'), help_text=_('A unique name for this chunk of content'), primary_key=True, max_length=255) + description = models.CharField(_('description'), blank=True, max_length=255) + + class Meta: + ordering = ('key',) + verbose_name = _('chunk') + verbose_name_plural = _('chunks') + + def __unicode__(self): + return self.key + + def cache_key(self): + return 'chunk_' + self.key + + def save(self, *args, **kwargs): + ret = super(Chunk, self).save(*args, **kwargs) + cache.delete(self.cache_key()) + return ret + +add_translatable(Chunk, { + 'content': MarkupField(_('content'), blank=True, markup_type='textile_pl', + help_text=_('Use Textile syntax.')), +}) + + +class Attachment(models.Model): + key = models.CharField(_('key'), help_text=_('A unique name for this attachment'), primary_key=True, max_length=255) + attachment = models.FileField(upload_to='chunks/attachment') + + class Meta: + ordering = ('key',) + verbose_name, verbose_name_plural = _('attachment'), _('attachments') + + def __unicode__(self): + return self.key diff --git a/chunks/templatetags/__init__.py b/chunks/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chunks/templatetags/chunks.py b/chunks/templatetags/chunks.py new file mode 100644 index 0000000..6231e4f --- /dev/null +++ b/chunks/templatetags/chunks.py @@ -0,0 +1,38 @@ +from django import template +from django.db import models +from django.core.cache import cache +from ..models import Chunk, Attachment + + +register = template.Library() + + +@register.simple_tag +def chunk(key, cache_time=0, raw=False): + try: + cache_key = 'chunk_' + key + c = cache.get(cache_key) + if c is None: + c = Chunk.objects.get(key=key) + cache.set(cache_key, c, int(cache_time)) + content = c.content + except Chunk.DoesNotExist: + n = Chunk(key=key) + n.save() + return '' + return content.raw if raw else content + + +@register.simple_tag +def attachment(key, cache_time=0): + try: + cache_key = 'attachment_' + key + c = cache.get(cache_key) + if c is None: + c = Attachment.objects.get(key=key) + cache.set(cache_key, c, int(cache_time)) + return c.attachment.url + except Attachment.DoesNotExist: + return '' + + diff --git a/prawokultury/settings.d/30-apps.py b/prawokultury/settings.d/30-apps.py index 1e87f11..2acaaf9 100644 --- a/prawokultury/settings.d/30-apps.py +++ b/prawokultury/settings.d/30-apps.py @@ -6,6 +6,7 @@ INSTALLED_APPS = ( 'migdal', 'questions', 'shop', + 'chunks', 'gravatar', 'south', diff --git a/prawokultury/templates/base.html b/prawokultury/templates/base.html index 8260886..906871b 100755 --- a/prawokultury/templates/base.html +++ b/prawokultury/templates/base.html @@ -4,6 +4,7 @@ {% load static from staticfiles %} {% load fnp_common menu_tags migdal_tags events_tags fnp_share fnp_lang %} {% load compressed %} +{% load chunks %} {% block "titleextra" %}{% endblock %}{% trans "Right to Culture" %} @@ -67,7 +68,7 @@ {% events_box %}