# HG changeset patch # User neko259 # Date 2015-04-01 15:07:12 # Node ID 389105b19c27bce60335940332b61b0df8959691 # Parent 8f4f78df4936fe062ead4abda6c0832546ab60ff Show only required tags in all tags list by default diff --git a/boards/locale/ru/LC_MESSAGES/django.mo b/boards/locale/ru/LC_MESSAGES/django.mo index 276c48cea3ffc8b9eb795283871a1d8b0fb7e6e6..a2bde82e2a0f6f72f4ac7560905901da4f9e14b7 GIT binary patch literal 6909 zc$|$_U2GiH6~43q;*G%}c78~q+yF^Q!!GLpC2ZmlCvg&k?HJpkf~vB{yAyk0J+qye zHF1g5B(6y+rx;RND20a5syqOav#}F9cAN)9pQtq3m!ei`U+60y=#7ehM{ZVXEpQk}Q?CG*178EK z0KN^xpL!p+n}CzR8sIE22K>mZN4VVv`~Pzi0GJ)QJDHX8(sZVt>)h|H+L1X3qb+ zk^92vp#kZ=F(z@U1*U+jW0J4VnCKYVb<27q?~kJkxr&ee&&**cN`W1aZ<1#l(sPTal$Ostgsj{^?? zGb<%;ADH=R;Chl@Df<3p#>-&L9^xBt8!!#L5BTP7;^#-V2`~Q)+zk9L@LtNpD#^os z;622@Rl@i8fZqiEVU_st88A*fsh4pIh(GmAz1ZQ_3m-=7C4R3Oe79cCyIe1E`Ltf@ z@XLCM*F6n_$p-PWsX_R6ph5K74Wj3$Ssyp!H-JMFmj?0o-qmvc_g9Pk+10Y|rPU&L zZngOLz8OcrQ^3ENaR!GqQ@yVd|IV)wJ`{luQrv*Oz+2Z!-*VTA{uhBy0DlR5nd)q< z=o?xmc|E>P^qm2A0}JaU4mTm0!;~-Jvm}4J$Sqqha&_y)e{JxQ_2O5@dO0^|a0GZi z@E5>Gfgb{IQ1V-+DnF`;7A3XYVCFb(O8Vw4X3n%{&cSl?{7r+88>I6dGS9@>N0h{b zej5yKGI(>94c}J6;SS0-uDxcS>YI85@$hal*Jki0g9%&*mE?F$mCl_?;;;`_yONsO zW7a4yRI^)gbt;J~agFl1(d^le>wzkL#A%A-E?f_rIeLc?_jj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L${nYzpxdYH7JbOl0CkO8Hx~ zpH465w>VnTg0f1Kb}W_4Xa>t~mZ(5}OtCZ3OclM%0nFQkt`ribk@jEZ5OXnYpxs=F zL_YFKB7CewOV+mFh-h9#zcGZS!kw+K?AKgFrp77aRh}2eC<(OVDo+-wYjH6(uT2iA zKg(uKmI@wcQ-+R}7hpO?{(5o$9i7POn-D_^+$hGX233!x&QMs;Z>G4VTw+c0Rh_Ch zT0V=NqHZ`%DW>>M7+dBMLhi60#F#~GeIS3P9Lj+xA*JfN!~>K z1Z@#eN|3Qyy83*@OD5-KHd>nH>B{HrqDq+IDi%gjBH8O1=}z3rizk^wm$5#=9cp1! zo}-RPfu;!xM1`~y#GVobW-G0zTt)Q4s^a(px-Z#YS=S}Dc2;UY3q{ZeXo@u=kc->* zQUx}(WTkWb-l;fPrK@BU#H)H}DbgpUi&nQf%Igv#stOzy zA}nGtl(ew;9DfS1SUIpfn3B{l{>~SYBP7>;+;XGd!5&>Ra3*BpNSKr$e@1r!ND3vz(4DAui?KH^J|T zSvqhMKnhgCAb78@^Q*k^Y2B8j$qi7uEw@$gQ&6Peu*ai_blp2>7 zG0BIO91@?210zs1DRJeOTh*g^&yjI5X+A$L5LeC+E#_D;mFI+XsYKPnMP`F2ELVxK z%rp)rWuf}(r&Kkix{`PFbgBBLIKXgH+N+jggv{v_g=nI9ivB->(n;D3rc;?jv$Su? zk4b)K6;Of~B`~B(li0+f&spOky@(W9Eki{iW$iN*EKEp`;QM)gYn;Reuye^*>~(hQ z%70^u`Ul=BByfqCM?#AVWr-;!zkE~8AqBI{@M)>|atCaz>V~~!VlR7foQs&aM9~`U JHDoQQ{{tFeEl>ae diff --git a/boards/locale/ru/LC_MESSAGES/django.po b/boards/locale/ru/LC_MESSAGES/django.po --- a/boards/locale/ru/LC_MESSAGES/django.po +++ b/boards/locale/ru/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-03-30 18:42+0300\n" +"POT-Creation-Date: 2015-04-01 18:05+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -255,21 +255,21 @@ msgstr "Создать новую тему" msgid "Post" msgstr "Отправить" -#: templates/boards/posting_general.html:143 +#: templates/boards/posting_general.html:142 msgid "Tags must be delimited by spaces. Text or image is required." msgstr "" "Метки должны быть разделены пробелами. Текст или изображение обязательны." -#: templates/boards/posting_general.html:146 +#: templates/boards/posting_general.html:145 #: templates/boards/thread_normal.html:51 msgid "Text syntax" msgstr "Синтаксис текста" -#: templates/boards/posting_general.html:158 +#: templates/boards/posting_general.html:157 msgid "Pages:" msgstr "Страницы: " -#: templates/boards/preview.html:6 templates/boards/staticpages/help.html:20 +#: templates/boards/preview.html:6 templates/boards/staticpages/help.html:21 msgid "Preview" msgstr "Предпросмотр" @@ -335,10 +335,11 @@ msgid "Comment" msgstr "Комментарий" #: templates/boards/staticpages/help.html:18 +#: templates/boards/staticpages/help.html:19 msgid "Quote" msgstr "Цитата" -#: templates/boards/staticpages/help.html:20 +#: templates/boards/staticpages/help.html:21 msgid "You can try pasting the text and previewing the result here:" msgstr "Вы можете попробовать вставить текст и проверить результат здесь:" @@ -346,6 +347,10 @@ msgstr "Вы можете попробовать вставить текст и проверить результат здесь:" msgid "No tags found." msgstr "Метки не найдены." +#: templates/boards/tags.html:26 +msgid "All tags" +msgstr "Все метки" + #: templates/boards/thread.html:32 msgid "Last update: " msgstr "Последнее обновление: " diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -31,7 +31,7 @@ {% autoescape off %} {{ tags_str }}, {% endautoescape %} - [...], [S]. diff --git a/boards/templates/boards/tags.html b/boards/templates/boards/tags.html --- a/boards/templates/boards/tags.html +++ b/boards/templates/boards/tags.html @@ -9,7 +9,7 @@ {% block content %} -{% cache 600 all_tags_list %} +{% cache 600 all_tags_list query %}
{% if all_tags %} {% for tag in all_tags %} @@ -22,6 +22,9 @@ {% else %} {% trans 'No tags found.' %} {% endif %} + {% if query %} + + {% endif %}
{% endcache %} diff --git a/boards/urls.py b/boards/urls.py --- a/boards/urls.py +++ b/boards/urls.py @@ -36,7 +36,7 @@ urlpatterns = patterns('', name='thread_gallery'), url(r'^settings/$', settings.SettingsView.as_view(), name='settings'), - url(r'^tags/$', all_tags.AllTagsView.as_view(), name='tags'), + url(r'^tags/(?P\w+)?/?$', all_tags.AllTagsView.as_view(), name='tags'), url(r'^authors/$', AuthorsView.as_view(), name='authors'), url(r'^ban/(?P\w+)/$', BanUserView.as_view(), name='ban'), diff --git a/boards/views/all_tags.py b/boards/views/all_tags.py --- a/boards/views/all_tags.py +++ b/boards/views/all_tags.py @@ -4,11 +4,19 @@ from boards.views.base import BaseBoardV from boards.models.tag import Tag +PARAM_TAGS = 'all_tags' +PARAM_QUERY = 'query' + + class AllTagsView(BaseBoardView): - def get(self, request): + def get(self, request, query=None): params = dict() - params['all_tags'] = Tag.objects.get_not_empty_tags() + if query == 'required': + params[PARAM_TAGS] = Tag.objects.filter(required=True) + else: + params[PARAM_TAGS] = Tag.objects.get_not_empty_tags() + params[PARAM_QUERY] = query return render(request, 'boards/tags.html', params)