From: Radek Czajka Date: Fri, 25 Nov 2011 14:03:11 +0000 (+0100) Subject: remvoe the wrong publish button, X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/5bbc488088e1d46bd14ebf9a96852f8ee8b231a2?ds=sidebyside remvoe the wrong publish button, move admin link to the right, add book link to the summary --- 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 dba97123..96287ca2 100644 Binary files a/apps/wiki/locale/pl/LC_MESSAGES/django.mo and b/apps/wiki/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/wiki/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 %}