From: Lukasz Anwajler Date: Mon, 23 Aug 2010 22:15:19 +0000 (-0500) Subject: Merge branch 'master' of git@github.com:fnp/redakcja X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/6da718d80af13cf081d63b39f4240df1f1e53424?hp=780ab9457100da7f96656a9bf97cb512b5c69a6e Merge branch 'master' of git@github.com:fnp/redakcja --- diff --git a/apps/wiki/locale/pl/LC_MESSAGES/django.mo b/apps/wiki/locale/pl/LC_MESSAGES/django.mo index d89c9350..0e5d4a7c 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 b818527f..4eb2c76e 100644 --- a/apps/wiki/locale/pl/LC_MESSAGES/django.po +++ b/apps/wiki/locale/pl/LC_MESSAGES/django.po @@ -7,10 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Platforma Redakcyjna\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-08-16 16:22+0200\n" +"POT-Creation-Date: 2010-08-23 11:22+0200\n" "PO-Revision-Date: 2010-08-16 16:24+0100\n" "Last-Translator: Radek Czajka \n" -"Language-Team: Fundacja Nowoczesna Polska \n" +"Language-Team: Fundacja Nowoczesna Polska \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -117,7 +118,11 @@ msgstr "Nazwa taka sama jak dla pliku %s" msgid "Title already used in repository." msgstr "Plik o tej nazwie już istnieje w repozytorium." -#: views.py:339 +#: views.py:173 +msgid "File should be UTF-8 encoded." +msgstr "Plik powinien mieć kodowanie UTF-8." + +#: views.py:344 msgid "Tag added" msgstr "Dodano tag" @@ -175,15 +180,20 @@ msgid "Bulk documents upload" msgstr "Hurtowe dodawanie dokumentów" #: templates/wiki/document_upload.html:12 -msgid "Please submit a ZIP with XML files. Files not ending with .xml will be ignored." -msgstr "Proszę wskazać archiwum ZIP z plikami XML. Pliki nie kończące się na .xml zostaną zignorowane." +msgid "" +"Please submit a ZIP with UTF-8 encoded XML files. Files not ending with " +".xml will be ignored." +msgstr "" +"Proszę wskazać archiwum ZIP z plikami XML w kodowaniu UTF-8. Pliki nie kończące się na ." +"xml zostaną zignorowane." #: templates/wiki/document_upload.html:17 msgid "Upload" msgstr "Dodaj" #: templates/wiki/document_upload.html:24 -msgid "There have been some errors. No files have been added to the repository." +msgid "" +"There have been some errors. No files have been added to the repository." msgstr "Wystąpiły błędy. Żadne pliki nie zostały dodane do repozytorium." #: templates/wiki/document_upload.html:25 @@ -330,4 +340,3 @@ msgstr "Wstaw znak specjalny" #: templates/wiki/tabs/wysiwyg_editor_item.html:3 msgid "Visual editor" msgstr "Edytor wizualny" - diff --git a/apps/wiki/templates/wiki/document_upload.html b/apps/wiki/templates/wiki/document_upload.html index f1e37f76..d4c89d35 100644 --- a/apps/wiki/templates/wiki/document_upload.html +++ b/apps/wiki/templates/wiki/document_upload.html @@ -9,7 +9,7 @@

{% trans "Bulk documents upload" %}

-{% trans "Please submit a ZIP with XML files. Files not ending with .xml will be ignored." %} +{% trans "Please submit a ZIP with UTF-8 encoded XML files. Files not ending with .xml will be ignored." %}

diff --git a/apps/wiki/views.py b/apps/wiki/views.py index 7417235b..319cdbad 100644 --- a/apps/wiki/views.py +++ b/apps/wiki/views.py @@ -130,7 +130,7 @@ def create_missing(request, name): text=form.cleaned_data['text'], ) - return http.HttpResponseRedirect(reverse("wiki_details", args=[doc.name])) + return http.HttpResponseRedirect(reverse("wiki_editor", args=[doc.name])) else: form = DocumentCreateForm(initial={ "id": name.replace(" ", "_"), @@ -166,13 +166,18 @@ def upload(request): elif title in existing: error_list.append((filename, title, _('Title already used in repository.'))) else: - ok_list.append((filename, title)) + try: + zip.read(filename).decode('utf-8') # test read + ok_list.append((filename, title)) + except UnicodeDecodeError: + error_list.append((filename, title, _('File should be UTF-8 encoded.'))) titles[title] = filename + if not error_list: for filename, title in ok_list: storage.create_document( name=title, - text=zip.read(filename) + text=zip.read(filename).decode('utf-8') ) return direct_to_template(request, "wiki/document_upload.html", extra_context={ diff --git a/lib/vstorage/__init__.py b/lib/vstorage/__init__.py index 84d8ee7b..6234dc7e 100644 --- a/lib/vstorage/__init__.py +++ b/lib/vstorage/__init__.py @@ -219,7 +219,7 @@ class VersionedStorage(object): filectx_tip = changectx[repo_file] current_page_rev = filectx_tip.filerev() except mercurial.revlog.LookupError: - self.repo.add([repo_file]) + self.repo[None].add([repo_file]) current_page_rev = -1 if parent is not None and current_page_rev != parent: @@ -271,7 +271,7 @@ class VersionedStorage(object): os.unlink(file_path) except OSError: pass - self.repo.remove([repo_file]) + self.repo[None].remove([repo_file]) self._commit([repo_file], text, user) def page_text(self, title, revision=None): diff --git a/redakcja/localsettings.sample b/redakcja/localsettings.sample index 6f99ddd3..cdd2949c 100644 --- a/redakcja/localsettings.sample +++ b/redakcja/localsettings.sample @@ -23,5 +23,6 @@ MEDIA_ROOT = '/home/lrekucki/projekty/fundacja/media/' IMAGE_DIR = 'images' CAS_SERVER_URL = 'http://logowanie.wolnelektury.pl/cas/' +REDMINE_URL = 'http://redmine.nowoczesnapolska.org.pl/' DEBUG = True COMPRESS = False \ No newline at end of file diff --git a/redakcja/settings/common.py b/redakcja/settings/common.py index 7b32ba63..8d032ef6 100644 --- a/redakcja/settings/common.py +++ b/redakcja/settings/common.py @@ -11,7 +11,8 @@ MAINTENANCE_MODE = False ADMINS = ( # (u'Marek Stępniowski', 'marek@stepniowski.com'), - (u'Łukasz Rekucki', 'lrekucki@gmail.com'), + # (u'Łukasz Rekucki', 'lrekucki@gmail.com'), + (u'Radek Czajka', 'radoslaw.czajka@nowoczesnapolska.org.pl'), ) MANAGERS = ADMINS diff --git a/requirements.txt b/requirements.txt index 70cbcae5..7cca9db5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ ## Python libraries lxml>=2.2 -mercurial>=1.3.1 +mercurial>=1.6 PyYAML>=3.0 PIL>=1.1