From 5bbc488088e1d46bd14ebf9a96852f8ee8b231a2 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 25 Nov 2011 15:03:11 +0100 Subject: [PATCH 1/1] remvoe the wrong publish button, move admin link to the right, add book link to the summary --- apps/catalogue/admin.py | 1 + apps/catalogue/templatetags/catalogue.py | 3 -- apps/wiki/locale/pl/LC_MESSAGES/django.mo | Bin 3505 -> 3550 bytes apps/wiki/locale/pl/LC_MESSAGES/django.po | 37 ++++++++++-------- .../templates/wiki/tabs/summary_view.html | 4 +- redakcja/static/js/wiki/view_summary.js | 23 ----------- redakcja/static/js/wiki/wikiapi.js | 27 ------------- .../templates/registration/head_login.html | 5 +++ 8 files changed, 28 insertions(+), 72 deletions(-) diff --git a/apps/catalogue/admin.py b/apps/catalogue/admin.py index 70e20d20..a3faa98e 100644 --- a/apps/catalogue/admin.py +++ b/apps/catalogue/admin.py @@ -4,6 +4,7 @@ from catalogue import models class BookAdmin(admin.ModelAdmin): prepopulated_fields = {'slug': ['title']} + search_fields = ['title'] admin.site.register(models.Book, BookAdmin) diff --git a/apps/catalogue/templatetags/catalogue.py b/apps/catalogue/templatetags/catalogue.py index 2ce4add9..3cc7210c 100644 --- a/apps/catalogue/templatetags/catalogue.py +++ b/apps/catalogue/templatetags/catalogue.py @@ -34,9 +34,6 @@ def main_tabs(context): tabs.append(Tab('create', _('Add'), reverse("catalogue_create_missing"))) tabs.append(Tab('upload', _('Upload'), reverse("catalogue_upload"))) - if user.is_staff: - tabs.append(Tab('admin', _('Admin'), reverse("admin:index"))) - return {"tabs": tabs, "active_tab": active} diff --git a/apps/wiki/locale/pl/LC_MESSAGES/django.mo b/apps/wiki/locale/pl/LC_MESSAGES/django.mo index dba9712354aabc0e0e35d7562e93668ce51d0466..96287ca27c145d90f1ca22a9ff164ba77b6f5a36 100644 GIT binary patch delta 1189 zcmX}rO-PhM9LMo_=+Sk3%hGMDwS4d;t5tGMu}laGQt(n8qD#<*i*Aein7bxx*m^05 zsHDXx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locale/pl/LC_MESSAGES/django.po b/apps/wiki/locale/pl/LC_MESSAGES/django.po index 753523f9..eb51b71b 100644 --- a/apps/wiki/locale/pl/LC_MESSAGES/django.po +++ b/apps/wiki/locale/pl/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Platforma Redakcyjna\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-21 15:52+0200\n" -"PO-Revision-Date: 2011-10-21 15:52+0100\n" +"POT-Creation-Date: 2011-11-25 14:14+0100\n" +"PO-Revision-Date: 2011-11-25 14:15+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: Fundacja Nowoczesna Polska \n" "Language: \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: forms.py:19 -#: views.py:255 +#: views.py:274 msgid "Publishable" msgstr "Gotowe do publikacji" @@ -74,11 +74,11 @@ msgstr "motyw" msgid "themes" msgstr "motywy" -#: views.py:273 +#: views.py:294 msgid "Revision marked" msgstr "Wersja oznaczona" -#: views.py:275 +#: views.py:296 msgid "Nothing changed" msgstr "Nic nie uległo zmianie" @@ -217,38 +217,38 @@ msgstr "Kod źródłowy" msgid "Title" msgstr "Tytuł" -#: templates/wiki/tabs/summary_view.html:14 +#: templates/wiki/tabs/summary_view.html:13 +msgid "Go to the book's page" +msgstr "Przejdź do strony książki" + +#: templates/wiki/tabs/summary_view.html:16 msgid "Document ID" msgstr "ID dokumentu" -#: templates/wiki/tabs/summary_view.html:18 +#: templates/wiki/tabs/summary_view.html:20 msgid "Current version" msgstr "Aktualna wersja" -#: templates/wiki/tabs/summary_view.html:21 +#: templates/wiki/tabs/summary_view.html:23 msgid "Last edited by" msgstr "Ostatnio edytowane przez" -#: templates/wiki/tabs/summary_view.html:25 +#: templates/wiki/tabs/summary_view.html:27 msgid "Link to gallery" msgstr "Link do galerii" -#: templates/wiki/tabs/summary_view.html:30 +#: templates/wiki/tabs/summary_view.html:32 msgid "Characters in document" msgstr "Znaków w dokumencie" -#: templates/wiki/tabs/summary_view.html:31 +#: templates/wiki/tabs/summary_view.html:33 msgid "pages" -msgstr "stron" +msgstr "stron maszynopisu" -#: templates/wiki/tabs/summary_view.html:31 +#: templates/wiki/tabs/summary_view.html:33 msgid "untagged" msgstr "nieotagowane" -#: templates/wiki/tabs/summary_view.html:34 -msgid "Publish" -msgstr "Opublikuj" - #: templates/wiki/tabs/summary_view_item.html:3 msgid "Summary" msgstr "Podsumowanie" @@ -265,6 +265,9 @@ msgstr "Wstaw przypis" msgid "Visual editor" msgstr "Edytor wizualny" +#~ msgid "Publish" +#~ msgstr "Opublikuj" + #~ msgid "ZIP file" #~ msgstr "Plik ZIP" diff --git a/apps/wiki/templates/wiki/tabs/summary_view.html b/apps/wiki/templates/wiki/tabs/summary_view.html index 53e6cdf8..bcea34da 100644 --- a/apps/wiki/templates/wiki/tabs/summary_view.html +++ b/apps/wiki/templates/wiki/tabs/summary_view.html @@ -10,6 +10,8 @@ {{ chunk.pretty_name }} +

{% trans "Go to the book's page" %} +

{{ chunk.book.slug }}/{{ chunk.slug }} @@ -30,7 +32,5 @@ ( {% trans "pages" %}, {% trans "untagged" %})

- -

diff --git a/redakcja/static/js/wiki/view_summary.js b/redakcja/static/js/wiki/view_summary.js index b16c288f..de6fcf15 100644 --- a/redakcja/static/js/wiki/view_summary.js +++ b/redakcja/static/js/wiki/view_summary.js @@ -1,29 +1,6 @@ (function($){ function SummaryPerspective(options) { - var old_callback = options.callback; - var self = this; - - options.callback = function(){ - $('#publish_button').click(function() { - $.blockUI({message: "Oczekiwanie na odpowiedź serwera..."}); - self.doc.publish({ - success: function(doc, data) { - $.blockUI({message: "Udało się.", timeout: 2000}); - }, - failure: function(doc, message) { - $.blockUI({ - message: message, - timeout: 5000 - }); - } - - }); - }); - - old_callback.call(this); - }; - $.wiki.Perspective.call(this, options); }; diff --git a/redakcja/static/js/wiki/wikiapi.js b/redakcja/static/js/wiki/wikiapi.js index 1234c985..4a4da5a7 100644 --- a/redakcja/static/js/wiki/wikiapi.js +++ b/redakcja/static/js/wiki/wikiapi.js @@ -343,33 +343,6 @@ }); }; - WikiDocument.prototype.publish = function(params) { - params = $.extend({}, noops, params); - var self = this; - $.ajax({ - url: reverse("ajax_publish", self.id), - type: "POST", - dataType: "json", - success: function(data) { - params.success(self, data); - }, - error: function(xhr) { - if (xhr.status == 403 || xhr.status == 401) { - params.failure(self, "Nie masz uprawnień lub nie jesteś zalogowany."); - } - else { - try { - params.failure(self, xhr.responseText); - } - catch (e) { - params.failure(self, "Nie udało się - błąd serwera."); - }; - }; - - } - }); - }; - WikiDocument.prototype.pubmark = function(params) { params = $.extend({}, noops, params); var self = this; diff --git a/redakcja/templates/registration/head_login.html b/redakcja/templates/registration/head_login.html index 64bd3e7e..c82611b4 100644 --- a/redakcja/templates/registration/head_login.html +++ b/redakcja/templates/registration/head_login.html @@ -2,6 +2,11 @@ {% if user.is_authenticated %} {{ user.username }} | + +{% if user.is_staff %} + {% trans "Admin" %} | +{% endif %} + {% trans "Log Out" %} {% else %} {% url login as login_url %} -- 2.20.1