# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
-DOCUMENT_TAGS = (
- ("source", _(u"Tekst źródłowy")),
- ("first_correction", _(u"Po autokorekcie")),
- ("tagged", _(u"Tekst otagowany")),
- ("second_correction", _(u"Po korekcie")),
- ("source_annotations", _(u"Sprawdzone przypisy źródła")),
- ("language_updates", _(u"Uwspółcześnienia")),
- ("ready_to_publish", _(u"Tekst do publikacji")),
-)
-
-DOCUMENT_TAGS_DICT = dict(DOCUMENT_TAGS)
-
DOCUMENT_STAGES = (
- ("first_correction", _(u"Autokorekta")),
- ("tagged", _(u"Tagowanie")),
- ("second_correction", _(u"Korekta")),
- ("source_annotations", _(u"Przypisy źródła")),
- ("language_updates", _(u"Uwspółcześnienia")),
+ ("", u"-----"),
+ ("tagging", _(u"Tagging")),
+ ("proofreading", _(u"Initial Proofreading")),
+ ("annotation-proofreading", _(u"Annotation Proofreading")),
+ ("modernisation", _(u"Modernisation")),
+ ("themes", _(u"Themes")),
+ ("editor-proofreading", _(u"Editor's Proofreading")),
+ ("technical-editor-proofreading", _(u"Technical Editor's Proofreading")),
)
+DOCUMENT_TAGS = DOCUMENT_STAGES + \
+ (("ready-to-publish", _(u"Ready to publish")),)
+
+DOCUMENT_TAGS_DICT = dict(DOCUMENT_TAGS)
DOCUMENT_STAGES_DICT = dict(DOCUMENT_STAGES)
parent_revision = forms.IntegerField(widget=forms.HiddenInput)
text = forms.CharField(widget=forms.HiddenInput)
- author = forms.CharField(
+ author_name = forms.CharField(
required=False,
- label=_(u"Autor"),
- help_text=_(u"Twoje imie i nazwisko lub email."),
+ label=_(u"Author"),
+ help_text=_(u"Your name/"),
+ )
+
+ author_email = forms.EmailField(
+ required=False,
+ label=_(u"Author's email"),
+ help_text=_(u"Your email address, so we can show a gravatar :)"),
)
comment = forms.CharField(
required=True,
widget=forms.Textarea,
- label=_(u"Twój komentarz"),
- help_text=_(u"Opisz w miarę dokładnie swoje zmiany."),
+ label=_(u"Your comments"),
+ help_text=_(u"Describe changes you made."),
)
stage_completed = forms.ChoiceField(
choices=DOCUMENT_STAGES,
required=False,
- label=_(u"Skończyłem robić"),
- help_text=_(u"Jeśli skończyłeś jeden z etapów utworu, wybierz go."),
+ label=_(u"Completed"),
+ help_text=_(u"If you completed a life cycle stage, select it."),
)
import os
import vstorage
from vstorage import DocumentNotFound
-from wiki import settings
+from wiki import settings, constants
+from django.utils.translation import ugettext_lazy as _
from django.http import Http404
logger = logging.getLogger("fnp.wiki")
+STAGE_TAGS_RE = re.compile(r'^#stage-finished: (.*)$', re.MULTILINE)
+
+
class DocumentStorage(object):
def __init__(self, path):
self.vstorage = vstorage.VersionedStorage(path)
return list(self.vstorage.all_pages())
def history(self, title):
- return list(self.vstorage.page_history(title))
+ def stage_desc(match):
+ stage = match.group(1)
+ return _("Finished stage: %s") % constants.DOCUMENT_STAGES_DICT[stage]
+
+ for changeset in self.vstorage.page_history(title):
+ changeset['description'] = STAGE_TAGS_RE.sub(stage_desc, changeset['description'])
+ yield changeset
+
class Document(object):
def getstorage():
return DocumentStorage(settings.REPOSITORY_PATH)
+
+#
+# Django models
+#
{% extends "base.html" %}
-{% load compressed %}
+{% load compressed i18n %}
{% block title %}{{ document_name }} - {{ block.super }}{% endblock %}
{% endblock %}
{% block maincontent %}
-<h1><img src="{{STATIC_URL}}/img/logo.png">Platforma Redakcyjna</h1>
+<h1><img src="{{ STATIC_URL }}img/logo.png">{% trans "Platforma Redakcyjna" %}</h1>
<div id="wiki_layout_left_column">
{% block leftcolumn %}
{% endblock leftcolumn %}
+{% load i18n %}
<table class="diff_table">
<thead>
<tr>
- <th colspan="2">Stara wersja</th>
- <th colspan="2">Nowa wersja</th>
+ <th colspan="2">{% trans "Old version" %}</th>
+ <th colspan="2">{% trans "New version" %}</th>
</tr>
</thead>
<tbody>
{% extends "wiki/base.html" %}
+{% load i18n %}
{% block leftcolumn %}
<form enctype="multipart/form-data" method="POST" action="">
{{ form.as_p }}
- <p><button type="submit">Stwórz utwór</button></p>
+ <p><button type="submit">{% trans "Create document" %}</button></p>
</form>
{% endblock leftcolumn %}
{% block rightcolumn %}
-
{% endblock rightcolumn %}
\ No newline at end of file
{% extends "wiki/document_details_base.html" %}
+{% load i18n %}
{% block extrabody %}
{{ block.super }}
-<script src="{{STATIC_URL}}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8">
+<script src="{{ STATIC_URL }}js/lib/codemirror/codemirror.js" type="text/javascript" charset="utf-8">
</script>
-<script src="{{STATIC_URL}}js/wiki/loader.js" type="text/javascript" charset="utf-8"> </script>
+<script src="{{ STATIC_URL }}js/wiki/loader.js" type="text/javascript" charset="utf-8"> </script>
{% endblock %}
{% block tabs-menu %}
{% extends "base.html" %}
-{% load toolbar_tags %}
+{% load toolbar_tags i18n %}
+
{% block title %}{{ document.name }} - {{ block.super }}{% endblock %}
{% block extrahead %}
{% load compressed %}
{% endblock %}
{% block maincontent %}
-<div id="loading-overlay">
- <div id="loading-message">
- <img src="{{STATIC_URL}}img/spinner.gif" />
- <p>Ładowanie</p>
- </div>
-</div>
-
<div id="document-meta"
data-document-name="{{ document.name }}" style="display:none">
<div id="header">
<h1><a href="{% url wiki.views.document_list %}">Platforma</a></h1>
<div id="tools">
- <a href="{{ REDMINE_URL }}projects/wl-publikacje/wiki/Pomoc" target="_blank">Pomoc</a>
+ <a href="{{ REDMINE_URL }}projects/wl-publikacje/wiki/Pomoc" target="_blank">
+ {% trans "Help" %}</a>
| {% include "registration/head_login.html" %}
- | Wersja: <span id="document-revision">unknown</span>
+ | {% trans "Version" %}: <span id="document-revision">{% trans "Unknown" %}</span>
{% if not readonly %}
- | <button style="margin-left: 6px" id="save-button">Zapisz</button>
+ | <button style="margin-left: 6px" id="save-button">{% trans "Save" %}</button>
{% endif %}
</div>
<ol id="tabs">
{% extends "wiki/document_details_base.html" %}
+{% load i18n %}
{% block editor-class %}readonly{% endblock %}
{% extends "wiki/base.html" %}
-
+{% load i18n %}
{% block extrabody %}
{{ block.super }}
<thead>
<tr><th>Filtr:</th>
<th><input autocomplete="off" name="filter" id="file-list-filter" type="text" size="40" /></th>
- <th><input type="reset" value="Wyczyść" id="file-list-reset-button"/></th>
+ <th><input type="reset" value="{% trans "Clear filter" %}" id="file-list-reset-button"/></th>
</tr>
</thead>
<tbody>
{% block rightcolumn %}
<div id="last-edited-list">
- <h2>Twoje ostatnio otwierane dokumenty:</h2>
+ <h2>{% trans "Your last edited documents" %}</h2>
<ol>
{% for name, date in last_docs %}
<li><a href="{% url wiki.views.document_detail name|urlencode %}"
+{% load i18n %}
<div id="save_dialog" class="dialog" data-ui-jsclass="SaveDialog">
<form method="POST" action="">
<p>{{ forms.text_save.comment.label }}</p>
-<div class="vsplitbar" title="Klinknij aby (ro)zwinąć galerię.">
+{% load i18n %}
+<div class="vsplitbar" title="{% trans "Click to open/close gallery" %}">
</div>
<div id="side-gallery">
<!-- gallery toolbar -->
<div class="toolbar">
<button class="previous-page">
- <img src="{{STATIC_URL}}icons/go-previous.png" alt="Poprzednia" title="Poprzednia"/>
+ <img src="{{STATIC_URL}}icons/go-previous.png"
+ alt="{% trans "Previous" %}" title="{% trans "Previous" %}"/>
</button><input type="text" size="3" maxlength="3" value="1" class="page-number" />
<button class="next-page">
- <img src="{{STATIC_URL}}icons/go-next.png" alt="Następna" title="Następna"/>
- </button>
- <button class="zoom-in">
- Powiększ
- </button>
- <button class="zoom-out">
- Pomniejsz
+ <img src="{{STATIC_URL}}icons/go-next.png"
+ alt="{% trans "Next" %}" title="{% trans "Next" %}"/>
</button>
+ <button class="zoom-in">{% trans "Zoom in" %}</button>
+ <button class="zoom-out">{% trans "Zoom out" %}</button>
<div class="toolbar-end">
</div>
</div>
<div class="error_message">
</div>
<div class="gallery-image">
- <img src="{{MEDIA_URL}}/images/empty.png" />
+ <img src="{{MEDIA_URL}}images/empty.png" />
</div>
</div>
\ No newline at end of file
+{% load i18n %}
<div id="history-view-editor" class="editor" style="display: none">
<div class="toolbar">
- <button type="button" id="make-diff-button">Porównaj</button>
- <button type="button" id="tag-changeset-button">Oznacz wersje</button>
+ <button type="button" id="make-diff-button">{% trans "Compare versions" %}</button>
+ <button type="button" id="tag-changeset-button">{% trans "Mark version" %}</button>
<button id="open-preview-button"
- data-basehref="{% url wiki_details_readonly document_name %}">Podejrzyj wersje</button>
+ data-basehref="{% url wiki_details_readonly document_name %}">{% trans "View version" %}</button>
</div>
<div id="history-view">
<p class="message-box" style="display:none;"></p>
+{% load i18n %}
<li id="HistoryPerspective" data-ui-related="history-view-editor" data-ui-jsclass="HistoryPerspective">
- <span>Historia</span>
+ <span>{% trans "History" %}</span>
</li>
-{% load toolbar_tags %}
+{% load toolbar_tags i18n %}
<div id="source-editor" class="editor">
{% if not document_info.readonly %}{% toolbar %}{% endif %}
<textarea id="codemirror_placeholder"><br/></textarea>
+{% load i18n %}
<li id="CodeMirrorPerspective"
data-ui-related="source-editor"
data-ui-jsclass="CodeMirrorPerspective">
- <span>Kod źródłowy</span>
+ <span>{% trans "Source code" %}</span>
</li>
\ No newline at end of file
+{% load i18n %}
<div id="summary-view-editor" class="editor" style="display: none">
<!-- <div class="toolbar">
</div> -->
<div id="summary-view">
- <img class="book-cover" src="{{STATIC_URL}}img/sample_cover.png">
+ <img class="book-cover" src="{{ STATIC_URL }}img/sample_cover.png">
<h2>
- <label for="title">Tytuł:</label>
+ <label for="title">{% trans "Title" %}:</label>
<span data-ui-editable="true" data-edit-target="meta.displayTitle"
>{{ document_meta.title }}</span>
</h2>
<p>
- <label>ID dokumentu:</label>
+ <label>{% trans "Document ID" %}:</label>
<span>{{ document.name|urlencode }}</span>
</p>
<p>
- <label>Aktulana wersja:</label>
+ <label>{% trans "Current version" %}:</label>
{{ document_info.revision }} ({{document_info.last_update}})
<p>
- <label>Ostatnio edytowane przez:</label>
+ <label>{% trans "Last edited by" %}:</label>
{{document_info.last_comitter}}
</p>
<p>
- <label for="gallery">Link do galerii:</label>
+ <label for="gallery">{% trans "Link to gallery" %}:</label>
<span data-ui-editable="true" data-edit-target="meta.galleryLink"
>{{ document_meta.gallery}}</span>
</p>
- <p><button type="button" id="publish_button">Publikuj na wolnelektury.pl</button></p>
+ <p><button type="button" id="publish_button">{% trans "Publish" %}</button></p>
</div>
</div>
\ No newline at end of file
+{% load i18n %}
<li id="SummaryPerspective" data-ui-related="summary-view-editor" data-ui-jsclass="SummaryPerspective">
<span>{{ document_meta.title }}</span>
</li>
+{% load i18n %}
<div id="simple-editor" class="editor" style="display: none">
<div id="html-view" class="htmlview">
</div>
<div class="toolbar">
{% if not document_info.readonly %}
<button id="insert-theme-button">
- Wstaw motyw
+ {% trans "Insert theme" %}
</button>
<button id="insert-annotation-button">
- Wstaw przypis
+ {% trans "Insert annotation" %}
</button>
{% endif %}
<div class="toolbar-end">
+{% load i18n %}
<li id="VisualPerspective" data-ui-related="simple-editor" data-ui-jsclass="VisualPerspective">
- <span>Edytor</span>
+ <span>{% trans "Visual editor" %}</span>
</li>
+{% load i18n %}
<div id="add_tag_dialog" class="dialog" data-ui-jsclass="AddTagDialog">
<form method="POST" action="#">
{% for field in forms.add_tag.visible_fields %}
<p data-ui-error-for="__all__"> </p>
<p class="action_area">
- <button type="submit" class"ok" data-ui-action="save">Zapisz</button>
- <button type="button" class="cancel" data-ui-action="cancel">Anuluj</button>
+ <button type="submit" class"ok" data-ui-action="save">{% trans "Save" %}</button>
+ <button type="button" class="cancel" data-ui-action="cancel">{% trans "Cancel" %}</button>
</p>
</form>
</div>
document = storage.get_or_404(name, revision)
document.text = form.cleaned_data['text']
- storage.put(document,
- author=form.cleaned_data['author'] or request.user.username,
- comment=form.cleaned_data['comment'],
- parent=revision,
- )
+ comment = form.cleaned_data['comment']
+
+ if form.cleaned_data['stage_completed']:
+ comment += '\n#stage-finished: %s\n' % form.cleaned_data['stage_completed']
+
+ author = "%s <%s>" % (form.cleaned_data['author_name'], form.cleaned_data['author_email'])
+ storage.put(document, author=author, comment=comment, parent=revision)
document = storage.get(name)
return JSONResponse({
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-16 10:52+0000\n"
+"POT-Creation-Date: 2010-05-18 10:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: templates/explorer/editor.html:53
-msgid "Refresh panel"
-msgstr "Odśwież panel"
-
-#: templates/explorer/editor.html:67
-msgid "Print version"
-msgstr "Wersja do druku"
-
-#: templates/explorer/editor.html:96
-msgid "Next page"
-msgstr "Następna strona"
+#: templates/admin/index.html:21
+#, python-format
+msgid "Models available in the %(name)s application."
+msgstr ""
-#: templates/explorer/editor.html:100
-msgid "Zoom in"
-msgstr "Powiększ"
+#: templates/admin/index.html:22
+#, python-format
+msgid "%(name)s"
+msgstr ""
-#: templates/explorer/editor.html:103
-msgid "Zoom out"
-msgstr "Zmniejsz"
+#: templates/admin/index.html:32
+msgid "Add"
+msgstr ""
-#: templates/explorer/editor.html:106
-msgid "Reset zoom"
-msgstr "Oryginalny rozmiar"
+#: templates/admin/index.html:38
+msgid "Change"
+msgstr ""
-#: templates/explorer/editor.html:155
-msgid "History"
-msgstr "Historia"
+#: templates/admin/index.html:48
+msgid "You don't have permission to edit anything."
+msgstr ""
-#: templates/explorer/editor.html:156
-msgid "Push"
-msgstr "Zatwierdź"
+#: templates/admin/index.html:56
+msgid "Recent Actions"
+msgstr ""
-#: templates/explorer/editor.html:157
-msgid "Pull"
-msgstr "Uaktualnij"
+#: templates/admin/index.html:57
+msgid "My Actions"
+msgstr ""
-#: templates/explorer/editor.html:158
-msgid "Save"
-msgstr "Zapisz"
+#: templates/admin/index.html:61
+msgid "None available"
+msgstr ""
-#: templates/explorer/editor.html:159
-msgid "Quick save"
-msgstr "Szybki zapis"
+#: templates/admin/index.html:75
+msgid "Unknown content"
+msgstr ""
#: templates/registration/head_login.html:5
msgid "Log Out"
#: templates/registration/head_login.html:9
msgid "Log In"
msgstr "Logowanie"
+
+#~ msgid "Refresh panel"
+#~ msgstr "Odśwież panel"
+
+#~ msgid "Print version"
+#~ msgstr "Wersja do druku"
+
+#~ msgid "Next page"
+#~ msgstr "Następna strona"
+
+#~ msgid "Zoom in"
+#~ msgstr "Powiększ"
+
+#~ msgid "Zoom out"
+#~ msgstr "Zmniejsz"
+
+#~ msgid "Reset zoom"
+#~ msgstr "Oryginalny rozmiar"
+
+#~ msgid "History"
+#~ msgstr "Historia"
+
+#~ msgid "Push"
+#~ msgstr "Zatwierdź"
+
+#~ msgid "Pull"
+#~ msgstr "Uaktualnij"
+
+#~ msgid "Save"
+#~ msgstr "Zapisz"
+
+#~ msgid "Quick save"
+#~ msgstr "Szybki zapis"
# -*- coding: utf-8 -*-
import os.path
-PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__))
+PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
tag: function(value) {
return tags.filter("*[value='"+value+"']").text();
}
+// description: function(value) {
+// return value.replace('\n', ');
+// }
}
});
});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+{% load i18n %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>{% block title %}Platforma Redakcyjna{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
+ <title>{% block title %}{% trans "Platforma Redakcyjna" %}{% block subtitle %}{% endblock subtitle %}{% endblock title%}</title>
{% block extrahead %}
{% endblock %}
</head>
<body id="{% block bodyid %}base{% endblock %}">
+
+ <div id="loading-overlay" style="display: none;">
+ <div id="loading-message">
+ <img src="{{STATIC_URL}}img/spinner.gif" />
+ <p>{% trans "Loading" %}</p>
+ </div>
+ </div>
+
<div id="body-wrap">
<div id="content">{% block maincontent %} {% endblock %}</div>
</div>