Merge branch 'master' of git@github.com:fnp/redakcja
authorLukasz Anwajler <lukasz@anwajler.com>
Mon, 23 Aug 2010 22:15:19 +0000 (17:15 -0500)
committerLukasz Anwajler <lukasz@anwajler.com>
Mon, 23 Aug 2010 22:15:19 +0000 (17:15 -0500)
apps/wiki/locale/pl/LC_MESSAGES/django.mo
apps/wiki/locale/pl/LC_MESSAGES/django.po
apps/wiki/templates/wiki/document_upload.html
apps/wiki/views.py
lib/vstorage/__init__.py
redakcja/localsettings.sample
redakcja/settings/common.py
requirements.txt

index d89c935..0e5d4a7 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 b818527..4eb2c76 100644 (file)
@@ -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 <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
-"Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>\n"
+"Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org."
+"pl>\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 <code>.xml</code> will be ignored."
-msgstr "Proszę wskazać archiwum ZIP z plikami XML. Pliki nie kończące się na <code>.xml</code> zostaną zignorowane."
+msgid ""
+"Please submit a ZIP with UTF-8 encoded XML files. Files not ending with "
+"<code>.xml</code> will be ignored."
+msgstr ""
+"Proszę wskazać archiwum ZIP z plikami XML w kodowaniu UTF-8. Pliki nie kończące się na <code>."
+"xml</code> 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"
-
index f1e37f7..d4c89d3 100644 (file)
@@ -9,7 +9,7 @@
 <h2>{% trans "Bulk documents upload" %}</h2>
 
 <p>
-{% trans "Please submit a ZIP with XML files. Files not ending with <code>.xml</code> will be ignored." %}
+{% trans "Please submit a ZIP with UTF-8 encoded XML files. Files not ending with <code>.xml</code> will be ignored." %}
 </p>
 
 <form enctype="multipart/form-data" method="POST" action="">
index 7417235..319cdba 100644 (file)
@@ -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={
index 84d8ee7..6234dc7 100644 (file)
@@ -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):
index 6f99ddd..cdd2949 100644 (file)
@@ -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
index 7b32ba6..8d032ef 100644 (file)
@@ -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
index 70cbcae..7cca9db 100644 (file)
@@ -1,6 +1,6 @@
 ## Python libraries
 lxml>=2.2
-mercurial>=1.3.1
+mercurial>=1.6
 PyYAML>=3.0
 PIL>=1.1