fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9f97903
)
fixes #875: detect work on outdated revision
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Sep 2010 13:39:48 +0000
(15:39 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 29 Sep 2010 13:39:48 +0000
(15:39 +0200)
apps/wiki/locale/pl/LC_MESSAGES/django.mo
patch
|
blob
|
history
apps/wiki/locale/pl/LC_MESSAGES/django.po
patch
|
blob
|
history
apps/wiki/models.py
patch
|
blob
|
history
apps/wiki/templates/wiki/document_details_base.html
patch
|
blob
|
history
apps/wiki/urls.py
patch
|
blob
|
history
apps/wiki/views.py
patch
|
blob
|
history
redakcja/static/css/master.css
patch
|
blob
|
history
redakcja/static/js/wiki/loader.js
patch
|
blob
|
history
redakcja/static/js/wiki/wikiapi.js
patch
|
blob
|
history
diff --git
a/apps/wiki/locale/pl/LC_MESSAGES/django.mo
b/apps/wiki/locale/pl/LC_MESSAGES/django.mo
index
0e5d4a7
..
c334ead
100644
(file)
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
4eb2c76
..
568e844
100644
(file)
--- a/
apps/wiki/locale/pl/LC_MESSAGES/django.po
+++ b/
apps/wiki/locale/pl/LC_MESSAGES/django.po
@@
-7,11
+7,10
@@
msgid ""
msgstr ""
"Project-Id-Version: Platforma Redakcyjna\n"
"Report-Msgid-Bugs-To: \n"
msgstr ""
"Project-Id-Version: Platforma Redakcyjna\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-0
8-23 11:22
+0200\n"
-"PO-Revision-Date: 2010-0
8-16 16:24
+0100\n"
+"POT-Creation-Date: 2010-0
9-29 15:34
+0200\n"
+"PO-Revision-Date: 2010-0
9-29 15:36
+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\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"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@
-37,6
+36,7
@@
msgid "Modernisation"
msgstr "Uwspółcześnienie"
#: constants.py:11
msgstr "Uwspółcześnienie"
#: constants.py:11
+#: templates/wiki/tabs/annotations_view_item.html:3
msgid "Annotations"
msgstr "Przypisy"
msgid "Annotations"
msgstr "Przypisy"
@@
-97,32
+97,32
@@
msgstr "Jeśli został ukończony etap prac, wskaż go."
msgid "Finished stage: %s"
msgstr "Ukończony etap: %s"
msgid "Finished stage: %s"
msgstr "Ukończony etap: %s"
-#: models.py:1
49
+#: models.py:1
52
msgid "name"
msgstr "nazwa"
msgid "name"
msgstr "nazwa"
-#: models.py:15
3
+#: models.py:15
6
msgid "theme"
msgstr "motyw"
msgid "theme"
msgstr "motyw"
-#: models.py:15
4
+#: models.py:15
7
msgid "themes"
msgstr "motywy"
msgid "themes"
msgstr "motywy"
-#: views.py:16
5
+#: views.py:16
7
#, python-format
msgid "Title already used for %s"
msgstr "Nazwa taka sama jak dla pliku %s"
#, python-format
msgid "Title already used for %s"
msgstr "Nazwa taka sama jak dla pliku %s"
-#: views.py:16
7
+#: views.py:16
9
msgid "Title already used in repository."
msgstr "Plik o tej nazwie już istnieje w repozytorium."
msgid "Title already used in repository."
msgstr "Plik o tej nazwie już istnieje w repozytorium."
-#: views.py:17
3
+#: views.py:17
5
msgid "File should be UTF-8 encoded."
msgstr "Plik powinien mieć kodowanie UTF-8."
msgid "File should be UTF-8 encoded."
msgstr "Plik powinien mieć kodowanie UTF-8."
-#: views.py:3
44
+#: views.py:3
58
msgid "Tag added"
msgstr "Dodano tag"
msgid "Tag added"
msgstr "Dodano tag"
@@
-142,7
+142,7
@@
msgstr "Nowa wersja"
msgid "Create document"
msgstr "Utwórz dokument"
msgid "Create document"
msgstr "Utwórz dokument"
-#: templates/wiki/document_details.html:3
1
+#: templates/wiki/document_details.html:3
2
msgid "Click to open/close gallery"
msgstr "Kliknij, aby (ro)zwinąć galerię"
msgid "Click to open/close gallery"
msgstr "Kliknij, aby (ro)zwinąć galerię"
@@
-167,6
+167,10
@@
msgstr "Zapisz"
msgid "Save attempt in progress"
msgstr "Trwa zapisywanie"
msgid "Save attempt in progress"
msgstr "Trwa zapisywanie"
+#: templates/wiki/document_details_base.html:42
+msgid "There is a newer version of this document!"
+msgstr "Istnieje nowsza wersja tego dokumentu!"
+
#: templates/wiki/document_list.html:30
msgid "Clear filter"
msgstr "Wyczyść filtr"
#: templates/wiki/document_list.html:30
msgid "Clear filter"
msgstr "Wyczyść filtr"
@@
-180,20
+184,15
@@
msgid "Bulk documents upload"
msgstr "Hurtowe dodawanie dokumentów"
#: templates/wiki/document_upload.html:12
msgstr "Hurtowe dodawanie dokumentów"
#: templates/wiki/document_upload.html:12
-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."
+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
#: 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
msgstr "Wystąpiły błędy. Żadne pliki nie zostały dodane do repozytorium."
#: templates/wiki/document_upload.html:25
@@
-224,6
+223,10
@@
msgstr "Pliki pominięte z powodu braku rozszerzenia <code>.xml</code>."
msgid "Cancel"
msgstr "Anuluj"
msgid "Cancel"
msgstr "Anuluj"
+#: templates/wiki/tabs/annotations_view.html:5
+msgid "Refresh"
+msgstr "Odśwież"
+
#: templates/wiki/tabs/gallery_view.html:7
msgid "Previous"
msgstr "Poprzednie"
#: templates/wiki/tabs/gallery_view.html:7
msgid "Previous"
msgstr "Poprzednie"
@@
-340,3
+343,4
@@
msgstr "Wstaw znak specjalny"
#: templates/wiki/tabs/wysiwyg_editor_item.html:3
msgid "Visual editor"
msgstr "Edytor wizualny"
#: templates/wiki/tabs/wysiwyg_editor_item.html:3
msgid "Visual editor"
msgstr "Edytor wizualny"
+
diff --git
a/apps/wiki/models.py
b/apps/wiki/models.py
index
da8681a
..
b1b14cf
100644
(file)
--- a/
apps/wiki/models.py
+++ b/
apps/wiki/models.py
@@
-96,6
+96,9
@@
class DocumentStorage(object):
changeset['description'] = STAGE_TAGS_RE.sub(stage_desc, changeset['description'])
yield changeset
changeset['description'] = STAGE_TAGS_RE.sub(stage_desc, changeset['description'])
yield changeset
+ def doc_meta(self, title, revision=None):
+ return self.vstorage.page_meta(title, revision)
+
class Document(object):
class Document(object):
diff --git
a/apps/wiki/templates/wiki/document_details_base.html
b/apps/wiki/templates/wiki/document_details_base.html
index
e9ff8a4
..
0323133
100644
(file)
--- a/
apps/wiki/templates/wiki/document_details_base.html
+++ b/
apps/wiki/templates/wiki/document_details_base.html
@@
-39,6
+39,7
@@
{% if not readonly %}
| <button style="margin-left: 6px" id="save-button">{% trans "Save" %}</button>
<span id='save-attempt-info'>{% trans "Save attempt in progress" %}</span>
{% if not readonly %}
| <button style="margin-left: 6px" id="save-button">{% trans "Save" %}</button>
<span id='save-attempt-info'>{% trans "Save attempt in progress" %}</span>
+ <span id='out-of-date-info'>{% trans "There is a newer version of this document!" %}</span>
{% endif %}
</div>
<ol id="tabs" class="tabs">
{% endif %}
</div>
<ol id="tabs" class="tabs">
diff --git
a/apps/wiki/urls.py
b/apps/wiki/urls.py
index
f4da5f3
..
a84330a
100644
(file)
--- a/
apps/wiki/urls.py
+++ b/
apps/wiki/urls.py
@@
-32,6
+32,9
@@
urlpatterns = patterns('wiki.views',
url(r'^(?P<name>[^/]+)/history$',
'history', name="wiki_history"),
url(r'^(?P<name>[^/]+)/history$',
'history', name="wiki_history"),
+ url(r'^(?P<name>[^/]+)/rev$',
+ 'revision', name="wiki_revision"),
+
url(r'^(?P<name>[^/]+)/text$',
'text', name="wiki_text"),
url(r'^(?P<name>[^/]+)/text$',
'text', name="wiki_text"),
diff --git
a/apps/wiki/views.py
b/apps/wiki/views.py
index
4348cb8
..
7d60341
100644
(file)
--- a/
apps/wiki/views.py
+++ b/
apps/wiki/views.py
@@
-321,6
+321,17
@@
def diff(request, name):
docB.plain_text.splitlines(), context=3))
docB.plain_text.splitlines(), context=3))
+@never_cache
+@normalized_name
+def revision(request, name):
+ storage = getstorage()
+
+ try:
+ return http.HttpResponse(str(storage.doc_meta(name)['revision']))
+ except DocumentNotFound:
+ raise http.Http404
+
+
@never_cache
@normalized_name
def history(request, name):
@never_cache
@normalized_name
def history(request, name):
diff --git
a/redakcja/static/css/master.css
b/redakcja/static/css/master.css
index
31277d3
..
075f59d
100644
(file)
--- a/
redakcja/static/css/master.css
+++ b/
redakcja/static/css/master.css
@@
-101,6
+101,7
@@
body {
font-weight: bold;
}
font-weight: bold;
}
+
#header.saving {
background-color: #E1C1C1;
}
#header.saving {
background-color: #E1C1C1;
}
@@
-113,7
+114,25
@@
body {
}
.saving #save-attempt-info {
display: inline;
}
.saving #save-attempt-info {
display: inline;
+ font-weight: normal;
+}
+
+
+#header.out-of-date {
+ background-color: #E1C1C1;
}
}
+#header.out-of-date #save-button {
+ display: none;
+}
+#out-of-date-info {
+ color: #801000;
+ display: none;
+}
+.out-of-date #out-of-date-info {
+ display: inline;
+}
+
+
#header h1, #header h1 a {
margin: 0;
#header h1, #header h1 a {
margin: 0;
diff --git
a/redakcja/static/js/wiki/loader.js
b/redakcja/static/js/wiki/loader.js
index
7e03c39
..
9530fc3
100644
(file)
--- a/
redakcja/static/js/wiki/loader.js
+++ b/
redakcja/static/js/wiki/loader.js
@@
-110,6
+110,14
@@
$(function()
console.log("Initial tab is:", active_tab)
$.wiki.switchToTab(active_tab);
console.log("Initial tab is:", active_tab)
$.wiki.switchToTab(active_tab);
+
+ /* every 5 minutes check for a newer version */
+ var revTimer = setInterval(function() {
+ CurrentDocument.checkRevision({error: function(){
+ $('#header').addClass('out-of-date');
+ clearInterval(revTimer);
+ }});
+ }, 300000);
},
failure: function() {
$('#loading-overlay').fadeOut();
},
failure: function() {
$('#loading-overlay').fadeOut();
diff --git
a/redakcja/static/js/wiki/wikiapi.js
b/redakcja/static/js/wiki/wikiapi.js
index
4b36ae9
..
bce1f89
100644
(file)
--- a/
redakcja/static/js/wiki/wikiapi.js
+++ b/
redakcja/static/js/wiki/wikiapi.js
@@
-39,6
+39,9
@@
if (vname == "ajax_document_diff")
return base_path + "/" + arguments[1] + "/diff";
if (vname == "ajax_document_diff")
return base_path + "/" + arguments[1] + "/diff";
+ if (vname == "ajax_document_rev")
+ return base_path + "/" + arguments[1] + "/rev";
+
if (vname == "ajax_document_addtag")
return base_path + "/" + arguments[1] + "/tags";
if (vname == "ajax_document_addtag")
return base_path + "/" + arguments[1] + "/tags";
@@
-152,6
+155,20
@@
});
};
});
};
+ WikiDocument.prototype.checkRevision = function(params) {
+ /* this doesn't modify anything, so no locks */
+ var self = this;
+ $.ajax({
+ method: "GET",
+ url: reverse("ajax_document_rev", self.id),
+ dataType: 'text',
+ success: function(data) {
+ if (data != self.revision)
+ params.error();
+ }
+ });
+ };
+
/*
* Fetch gallery
*/
/*
* Fetch gallery
*/