From: Radek Czajka Date: Tue, 16 Jul 2013 11:22:31 +0000 (+0200) Subject: Projects in context menu. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/52e81fb2db5803482ae536719309df181af8b92c Projects in context menu. --- diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index fa4fb650..b6a12e32 100644 Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.po b/apps/catalogue/locale/pl/LC_MESSAGES/django.po index 97006191..6790400c 100644 --- a/apps/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/apps/catalogue/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: 2013-07-09 10:15+0200\n" -"PO-Revision-Date: 2013-07-09 10:15+0100\n" +"POT-Creation-Date: 2013-07-16 13:22+0200\n" +"PO-Revision-Date: 2013-07-16 13:22+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: Fundacja Nowoczesna Polska \n" @@ -61,11 +61,11 @@ msgstr "Dokument o tym slugu już istnieje w repozytorium." msgid "File should be UTF-8 encoded." msgstr "Plik powinien mieć kodowanie UTF-8." -#: views.py:487 models/book.py:56 +#: views.py:498 models/book.py:56 msgid "books" msgstr "książki" -#: views.py:489 +#: views.py:500 msgid "scan gallery" msgstr "galeria skanów" @@ -145,7 +145,7 @@ msgstr "nazwa" msgid "notes" msgstr "notatki" -#: models/project.py:19 +#: models/project.py:19 templates/catalogue/book_list/book_list.html:62 msgid "project" msgstr "projekt" @@ -362,36 +362,37 @@ msgid "No activity recorded." msgstr "Nie zanotowano aktywności." #: templates/catalogue/book_list/book.html:7 -#: templates/catalogue/book_list/book.html:27 +#: templates/catalogue/book_list/book.html:28 msgid "Book settings" msgstr "Ustawienia książki" -#: templates/catalogue/book_list/book_list.html:21 +#: templates/catalogue/book_list/book_list.html:22 msgid "Show hidden books" msgstr "Pokaż ukryte książki" -#: templates/catalogue/book_list/book_list.html:26 +#: templates/catalogue/book_list/book_list.html:27 msgid "Search in book titles" msgstr "Szukaj w tytułach książek" -#: templates/catalogue/book_list/book_list.html:31 +#: templates/catalogue/book_list/book_list.html:32 msgid "stage" msgstr "etap" -#: templates/catalogue/book_list/book_list.html:33 -#: templates/catalogue/book_list/book_list.html:44 +#: templates/catalogue/book_list/book_list.html:34 +#: templates/catalogue/book_list/book_list.html:45 +#: templates/catalogue/book_list/book_list.html:64 msgid "none" msgstr "brak" -#: templates/catalogue/book_list/book_list.html:42 +#: templates/catalogue/book_list/book_list.html:43 msgid "editor" msgstr "redaktor" -#: templates/catalogue/book_list/book_list.html:53 +#: templates/catalogue/book_list/book_list.html:54 msgid "status" msgstr "status" -#: templates/catalogue/book_list/book_list.html:77 +#: templates/catalogue/book_list/book_list.html:88 #, python-format msgid "%(c)s book" msgid_plural "%(c)s books" @@ -399,27 +400,31 @@ msgstr[0] "%(c)s książka" msgstr[1] "%(c)s książki" msgstr[2] "%(c)s książek" -#: templates/catalogue/book_list/book_list.html:82 +#: templates/catalogue/book_list/book_list.html:93 msgid "No books found." msgstr "Nie znaleziono książek." -#: templates/catalogue/book_list/book_list.html:88 +#: templates/catalogue/book_list/book_list.html:99 msgid "Set stage" msgstr "Ustaw etap" -#: templates/catalogue/book_list/book_list.html:89 +#: templates/catalogue/book_list/book_list.html:100 msgid "Set user" msgstr "Przypisz redaktora" -#: templates/catalogue/book_list/book_list.html:91 +#: templates/catalogue/book_list/book_list.html:102 +msgid "Project" +msgstr "Projekt" + +#: templates/catalogue/book_list/book_list.html:103 msgid "Mark publishable" msgstr "Oznacz do publikacji" -#: templates/catalogue/book_list/book_list.html:92 +#: templates/catalogue/book_list/book_list.html:104 msgid "Mark not publishable" msgstr "Odznacz do publikacji" -#: templates/catalogue/book_list/book_list.html:93 +#: templates/catalogue/book_list/book_list.html:105 msgid "Other user" msgstr "Inny użytkownik" diff --git a/apps/catalogue/templates/catalogue/book_list/book_list.html b/apps/catalogue/templates/catalogue/book_list/book_list.html index 35537684..90ae183f 100755 --- a/apps/catalogue/templates/catalogue/book_list/book_list.html +++ b/apps/catalogue/templates/catalogue/book_list/book_list.html @@ -99,6 +99,7 @@ + @@ -110,4 +111,3 @@ {% endif %}value="{{ user.username }}">{{ user.first_name }} {{ user.last_name }} ({{ user.count }}) {% endfor %} - diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 1436fc02..e1dc2a30 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -25,7 +25,7 @@ from apiclient import NotAuthorizedError from catalogue import forms from catalogue import helpers from catalogue.helpers import active_tab -from catalogue.models import Book, Chunk, BookPublishRecord, ChunkPublishRecord +from catalogue.models import Book, Chunk, BookPublishRecord, ChunkPublishRecord, Project from fileupload.views import UploadView # @@ -429,6 +429,17 @@ def chunk_mass_edit(request): for b in books_affected: b.touch() # cache + project_id = request.POST.get('project') + if project_id: + try: + project = Project.objects.get(pk=int(project_id)) + except (Project.DoesNotExist, ValueError), e: + project = None + for c in chunks: + book = c.book + book.project = project + book.save() + for c in chunks: c.save() return HttpResponse("", content_type="text/plain") diff --git a/redakcja/static/js/catalogue/book_list.js b/redakcja/static/js/catalogue/book_list.js index c0fbf37d..9dd1e413 100644 --- a/redakcja/static/js/catalogue/book_list.js +++ b/redakcja/static/js/catalogue/book_list.js @@ -88,6 +88,14 @@ name: $("label[for=mass_edit_publish]").text(), icon: "ok", }, + "project" :{ + name: $("label[for=mass_edit_project]").text(), + items: get_items("project"), + }, + "publish": { + name: $("label[for=mass_edit_publish]").text(), + icon: "ok", + }, "unpublish": { name: $("label[for=mass_edit_unpublish]").text(), icon: "stop",