remvoe the wrong publish button,
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 25 Nov 2011 14:03:11 +0000 (15:03 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 25 Nov 2011 14:03:11 +0000 (15:03 +0100)
move admin link to the right,
add book link to the summary

apps/catalogue/admin.py
apps/catalogue/templatetags/catalogue.py
apps/wiki/locale/pl/LC_MESSAGES/django.mo
apps/wiki/locale/pl/LC_MESSAGES/django.po
apps/wiki/templates/wiki/tabs/summary_view.html
redakcja/static/js/wiki/view_summary.js
redakcja/static/js/wiki/wikiapi.js
redakcja/templates/registration/head_login.html

index 70e20d2..a3faa98 100644 (file)
@@ -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)
index 2ce4add..3cc7210 100644 (file)
@@ -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}
 
 
index dba9712..96287ca 100644 (file)
Binary files a/apps/wiki/locale/pl/LC_MESSAGES/django.mo and b/apps/wiki/locale/pl/LC_MESSAGES/django.mo differ
index 753523f..eb51b71 100644 (file)
@@ -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 <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
 "Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>\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"
 
index 53e6cdf..bcea34d 100644 (file)
@@ -10,6 +10,8 @@
                        <span data-ui-editable="true" data-edit-target="meta.displayTitle"
                        >{{ chunk.pretty_name }}</span>
                </h2>
+        <p><a href="{{ chunk.book.get_absolute_url }}">{% trans "Go to the book's page" %}</a>
+        </p>
                <p>
                        <label>{% trans "Document ID" %}:</label>
                        <span>{{ chunk.book.slug }}/{{ chunk.slug }}</span>
@@ -30,7 +32,5 @@
                    <label>{% trans "Characters in document" %}:</label>
                    <span id="charcount"></span> (<span id="charcount_pages"></span> {% trans "pages" %}<span id="charcount_untagged">, {% trans "untagged" %}</span>)
                </p>
-
-               <p><button type="button" id="publish_button">{% trans "Publish" %}</button></p>
        </div>
 </div>
index b16c288..de6fcf1 100644 (file)
@@ -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);
     };
 
index 1234c98..4a4da5a 100644 (file)
         });
     };
 
-       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;
index 64bd3e7..c82611b 100644 (file)
@@ -2,6 +2,11 @@
 
 {% if user.is_authenticated %}
 <span class="user_name">{{ user.username }}</span> |
+
+{% if user.is_staff %}
+    <a href="{% url admin:index %}">{% trans "Admin" %}</a> |
+{% endif %}
+
 <a href='{% url logout %}{% if logout_to %}?next={{ logout_to }}{% endif %}'>{% trans "Log Out" %}</a>
 {% else %}
 {% url login as login_url %}