"""
Form used for creating new documents.
"""
- file = forms.FileField(required=False)
template = forms.ModelChoiceField(Template.objects, required=False)
- text = forms.CharField(required=False, widget=forms.Textarea)
class Meta:
model = Book
- exclude = ['parent', 'parent_number', 'project']
+ exclude = ['parent', 'parent_number', 'project', 'gallery', 'public']
def __init__(self, *args, **kwargs):
super(DocumentCreateForm, self).__init__(*args, **kwargs)
self.fields['slug'].widget.attrs={'class': 'autoslug'}
- self.fields['gallery'].widget.attrs={'class': 'autoslug'}
self.fields['title'].widget.attrs={'class': 'autoslug-source'}
self.fields['template'].queryset = Template.objects.filter(is_main=True)
def clean(self):
super(DocumentCreateForm, self).clean()
- file = self.cleaned_data['file']
template = self.cleaned_data['template']
+ self.cleaned_data['gallery'] = self.cleaned_data['slug']
- if file is not None:
- try:
- self.cleaned_data['text'] = file.read().decode('utf-8')
- except UnicodeDecodeError:
- raise forms.ValidationError(_("Text file must be UTF-8 encoded."))
- elif template is not None:
+ if template is not None:
self.cleaned_data['text'] = template.content
- if not self.cleaned_data["text"]:
- self._errors["file"] = self.error_class([_("You must enter text, upload a file or select a template")])
+ if not self.cleaned_data.get("text"):
+ self._errors["template"] = self.error_class([_("You must select a template")])
return self.cleaned_data
msgstr ""
"Project-Id-Version: Platforma Redakcyjna\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-07-16 13:22+0200\n"
-"PO-Revision-Date: 2013-07-16 13:22+0100\n"
+"POT-Creation-Date: 2014-04-01 11:28+0200\n"
+"PO-Revision-Date: 2014-04-01 11:29+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org."
"pl>\n"
"|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.5.4\n"
-#: forms.py:39
-msgid "Text file must be UTF-8 encoded."
-msgstr "Plik powinien mieć kodowanie UTF-8."
-
-#: forms.py:42
-msgid "You must either enter text or upload a file"
-msgstr "Proszę wpisać tekst albo wybrać plik do załadowania"
+#: forms.py:38
+msgid "You must select a template"
+msgstr "Musisz wybrać szablon"
-#: forms.py:51
+#: forms.py:47
msgid "ZIP file"
msgstr "Plik ZIP"
-#: forms.py:52
+#: forms.py:48
msgid "Directories are documents in chunks"
msgstr "Katalogi zawierają dokumenty w częściach"
-#: forms.py:76
+#: forms.py:72
msgid "Assigned to"
msgstr "Przypisane do"
-#: forms.py:97 forms.py:111
+#: forms.py:93 forms.py:107
msgid "Chunk with this slug already exists"
msgstr "Część z tym slugiem już istnieje"
-#: forms.py:120
+#: forms.py:116
msgid "Append to"
msgstr "Dołącz do"
-#: views.py:160
+#: views.py:161
#, python-format
msgid "Slug already used for %s"
msgstr "Slug taki sam jak dla pliku %s"
-#: views.py:162
+#: views.py:163
msgid "Slug already used in repository."
msgstr "Dokument o tym slugu już istnieje w repozytorium."
-#: views.py:168
+#: views.py:169
msgid "File should be UTF-8 encoded."
msgstr "Plik powinien mieć kodowanie UTF-8."
-#: views.py:498 models/book.py:56
-msgid "books"
-msgstr "książki"
-
-#: views.py:500
-msgid "scan gallery"
-msgstr "galeria skanów"
-
#: models/book.py:28 models/chunk.py:23
msgid "title"
msgstr "tytuł"
msgid "public"
msgstr "publiczna"
-#: models/book.py:31
-msgid "scan gallery name"
-msgstr "nazwa galerii skanów"
-
#: models/book.py:35
msgid "parent"
msgstr "rodzic"
msgid "book"
msgstr "książka"
+#: models/book.py:56
+msgid "books"
+msgstr "książki"
+
#: models/book.py:255
msgid "No chunks in the book."
msgstr "Książka nie ma części."
msgid "notes"
msgstr "notatki"
-#: models/project.py:19 templates/catalogue/book_list/book_list.html:62
-msgid "project"
-msgstr "projekt"
-
-#: models/project.py:20
-msgid "projects"
-msgstr "projekty"
-
#: models/publish_log.py:18
msgid "time"
msgstr "czas"
msgstr "Dodaj część"
#: templates/catalogue/chunk_edit.html:5
-#: templates/catalogue/book_list/book.html:8
#: templates/catalogue/book_list/chunk.html:6
msgid "Chunk settings"
msgstr "Ustawienia części"
msgid "Book"
msgstr "Książka"
-#: templates/catalogue/document_create_missing.html:5
-msgid "Create a new book"
-msgstr "Utwórz nową książkę"
-
-#: templates/catalogue/document_create_missing.html:11
-msgid "Create book"
-msgstr "Utwórz książkę"
-
#: templates/catalogue/document_upload.html:8
msgid "Bulk documents upload"
msgstr "Hurtowe dodawanie dokumentów"
"Proszę wskazać archiwum ZIP z plikami XML w kodowaniu UTF-8. Pliki nie "
"kończące się na <code>.xml</code> zostaną zignorowane."
-#: templates/catalogue/document_upload.html:17 templatetags/catalogue.py:35
+#: templates/catalogue/document_upload.html:17
msgid "Upload"
msgstr "Załaduj"
msgid "No activity recorded."
msgstr "Nie zanotowano aktywności."
-#: templates/catalogue/book_list/book.html:7
-#: templates/catalogue/book_list/book.html:28
-msgid "Book settings"
-msgstr "Ustawienia książki"
-
-#: templates/catalogue/book_list/book_list.html:22
-msgid "Show hidden books"
-msgstr "Pokaż ukryte książki"
-
#: 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:32
msgid "stage"
msgstr "etap"
-#: templates/catalogue/book_list/book_list.html:34
-#: templates/catalogue/book_list/book_list.html:45
-#: templates/catalogue/book_list/book_list.html:64
+#: templates/catalogue/book_list/book_list.html:29
+#: templates/catalogue/book_list/book_list.html:40
+#: templates/catalogue/book_list/book_list.html:51
msgid "none"
msgstr "brak"
-#: templates/catalogue/book_list/book_list.html:43
+#: templates/catalogue/book_list/book_list.html:38
msgid "editor"
msgstr "redaktor"
-#: templates/catalogue/book_list/book_list.html:54
-msgid "status"
-msgstr "status"
-
-#: templates/catalogue/book_list/book_list.html:88
+#: templates/catalogue/book_list/book_list.html:76
#, python-format
-msgid "%(c)s book"
-msgid_plural "%(c)s books"
-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:93
-msgid "No books found."
-msgstr "Nie znaleziono książek."
+msgid "%(c)s module"
+msgid_plural "%(c)s modules"
+msgstr[0] "%(c)s moduł"
+msgstr[1] "%(c)s moduły"
+msgstr[2] "%(c)s modułów"
-#: templates/catalogue/book_list/book_list.html:99
+#: templates/catalogue/book_list/book_list.html:87
msgid "Set stage"
msgstr "Ustaw etap"
-#: templates/catalogue/book_list/book_list.html:100
+#: templates/catalogue/book_list/book_list.html:88
msgid "Set user"
msgstr "Przypisz redaktora"
-#: templates/catalogue/book_list/book_list.html:102
-msgid "Project"
-msgstr "Projekt"
-
-#: templates/catalogue/book_list/book_list.html:103
+#: templates/catalogue/book_list/book_list.html:91
msgid "Mark publishable"
msgstr "Oznacz do publikacji"
-#: templates/catalogue/book_list/book_list.html:104
+#: templates/catalogue/book_list/book_list.html:92
msgid "Mark not publishable"
msgstr "Odznacz do publikacji"
-#: templates/catalogue/book_list/book_list.html:105
+#: templates/catalogue/book_list/book_list.html:93
msgid "Other user"
msgstr "Inny użytkownik"
msgid "Add"
msgstr "Dodaj"
-#: templatetags/catalogue.py:37
-msgid "Covers"
-msgstr "Okładki"
-
#: templatetags/wall.py:49
msgid "Related edit"
msgstr "Powiązana zmiana"
msgid "Comment"
msgstr "Komentarz"
+#~ msgid "Text file must be UTF-8 encoded."
+#~ msgstr "Plik powinien mieć kodowanie UTF-8."
+
+#~ msgid "You must either enter text or upload a file"
+#~ msgstr "Proszę wpisać tekst albo wybrać plik do załadowania"
+
+#~ msgid "scan gallery"
+#~ msgstr "galeria skanów"
+
+#~ msgid "scan gallery name"
+#~ msgstr "nazwa galerii skanów"
+
+#~ msgid "project"
+#~ msgstr "projekt"
+
+#~ msgid "projects"
+#~ msgstr "projekty"
+
+#~ msgid "Create a new book"
+#~ msgstr "Utwórz nową książkę"
+
+#~ msgid "Create book"
+#~ msgstr "Utwórz książkę"
+
+#~ msgid "Book settings"
+#~ msgstr "Ustawienia książki"
+
+#~ msgid "Show hidden books"
+#~ msgstr "Pokaż ukryte książki"
+
+#~ msgid "Search in book titles"
+#~ msgstr "Szukaj w tytułach książek"
+
+#~ msgid "status"
+#~ msgstr "status"
+
+#~ msgid "No books found."
+#~ msgstr "Nie znaleziono książek."
+
+#~ msgid "Project"
+#~ msgstr "Projekt"
+
+#~ msgid "Covers"
+#~ msgstr "Okładki"
+
#~ msgid "Infobox"
#~ msgstr "Informacje"
title = models.CharField(_('title'), max_length=255, db_index=True)
slug = models.SlugField(_('slug'), max_length=128, unique=True, db_index=True)
public = models.BooleanField(_('public'), default=True, db_index=True)
- gallery = models.CharField(_('scan gallery name'), max_length=255, blank=True)
+ gallery = models.CharField(u'materiały', max_length=255, blank=True)
project = models.ForeignKey(Project, null=True, blank=True)
#wl_slug = models.CharField(_('title'), max_length=255, null=True, db_index=True, editable=False)
class Meta:
app_label = 'catalogue'
ordering = ['title', 'slug']
- verbose_name = _('book')
- verbose_name_plural = _('books')
+ verbose_name = u'moduł'
+ verbose_name_plural = u'moduły'
# Representing
verbose_name_plural = _('chunks')
permissions = [('can_pubmark', 'Can mark for publishing')]
+ class TagMeta:
+ verbose_name = u'etap pracy'
+ verbose_name_plural = u'etapy pracy'
+
# Representing
# ============
class Meta:
app_label = 'catalogue'
ordering = ['name']
- verbose_name = _('project')
- verbose_name_plural = _('projects')
+ verbose_name = u'poziom edukacyjny'
+ verbose_name_plural = u'poziomy edukacyjne'
def __unicode__(self):
return self.name
<div id="tabs-nav">
<a href="{% url 'catalogue_document_list' %}">
- <img id="logo" src="{{ STATIC_URL }}img/wl-orange.png" />
+ <img src="http://edukacjamedialna.edu.pl/static/img/logo.png" id="logo" width="70px">
</a>
<div id="tabs-nav-left">
{% with book.0 as chunk %}
<tr>
<td><input type="checkbox" name="select_book" value="{{book.id}}" data-chunk-id="{{chunk.id}}"/></td>
- <td><a href="{% url 'catalogue_book' book.slug %}" title='{% trans "Book settings" %}'>[B]</a></td>
- <td><a href="{% url 'catalogue_chunk_edit' book.slug chunk.slug %}" title='{% trans "Chunk settings" %}'>[c]</a></td>
<td><a target="_blank"
href="{% url 'wiki_editor' book.slug %}">
{{ book.title }}</a></td>
{% else %}–
{% endif %}</td>
<td class='user-column'>{% if chunk.user %}<a href="{% url 'catalogue_user' chunk.user.username %}">{{ chunk.user.first_name }} {{ chunk.user.last_name }}</a>{% endif %}</td>
- <td>
- {% if chunk.published %}P{% endif %}
- {% if book.new_publishable %}p{% endif %}
- {% if chunk.changed %}+{% endif %}
- </td>
<td>{{ book.project.name }}</td>
+ <td><a href="{% url 'catalogue_book_gallery' book.slug %}">Materiały</a></td>
</tr>
{% endwith %}
{% else %}
<tr>
<td><input type="checkbox" name="select_book" value="{{book.id}}"/></td>
- <td class='book-settings-link'><a href="{% url 'catalogue_book' book.slug %}" title='{% trans "Book settings" %}'>[B]</a></td>
- <td></td>
<td>{{ book.title }}</td>
<td></td>
<td class='user-column'></td>
- <td>
- {% if book.published %}P{% endif %}
- {% if book.new_publishable %}p{% endif %}
- </td>
<td>{{ book.project.name }}</td>
+ <td></td>
</tr>
{% endif %}
<table id="file-list"{% if viewed_user %} class="book-list-user"{% endif %}>
<thead><tr>
<th></th>
- <th></th>
- <th>
- <input class='check-filter' type='checkbox' name='all' title='{% trans "Show hidden books" %}'
- {% if request.GET.all %}checked='checked'{% endif %} />
- </th>
<th class='book-search-column'>
<form>
- <input title='{% trans "Search in book titles" %}' name="title"
+ <input title='Szukaj w tytułach modułów' name="title"
class='text-filter' value="{{ request.GET.title }}" />
</form>
</th>
</select></th>
{% endif %}
- <th><select name="status" class="filter">
- <option value=''>- {% trans "status" %} -</option>
- {% for state, label in states %}
- <option {% if request.GET.status == state %}selected="selected"
- {% endif %}value='{{ state }}'>{{ label }}</option>
- {% endfor %}
- </select></th>
-
<th><select name="project" class="filter">
- <option value=''>- {% trans "project" %} -</option>
+ <option value=''>- poziom edukacyjny -</option>
<option {% if request.GET.project == '-' %}selected="selected"
{% endif %}value="-">- {% trans "none" %} -</option>
{% for project in projects %}
{% endfor %}
</select></th>
+ <th></th>
</tr></thead>
{% with cnt=books|length %}
{% endfor %}
<tr><th class='paginator' colspan="5">
{% paginate %}
- {% blocktrans count c=cnt %}{{c}} book{% plural %}{{c}} books{% endblocktrans %}</th></tr>
+ {% blocktrans count c=cnt %}{{c}} module{% plural %}{{c}} modules{% endblocktrans %}</th></tr>
</tbody>
{% endwith %}
</table>
{% if not books %}
- <p>{% trans "No books found." %}</p>
+ <p>Nie znaleziono modułów.</p>
{% endif %}
<form id='chunk_mass_edit' action='{% url "catalogue_chunk_mass_edit" %}' style="display:none;">
<label for="mass_edit_stage">{% trans "Set stage" %}</label><input type="hidden" name="stage" id="mass_edit_stage"/>
<label for="mass_edit_user">{% trans "Set user" %}</label><input type="hidden" name="user" id="mass_edit_stage" />
<input type="hidden" name="status" />
-<label for="mass_edit_project">{% trans "Project" %}</label><input type="hidden" name="project" id="mass_edit_project" />
+<label for="mass_edit_project">Poziom edukacyjny</label><input type="hidden" name="project" id="mass_edit_project" />
<label for="mass_edit_publish">{% trans "Mark publishable" %}</label>
<label for="mass_edit_unpublish">{% trans "Mark not publishable" %}</label>
<label for="mass_edit_other">{% trans "Other user" %}</label>
{% load i18n %}
{% block content %}
- <h1>{% trans "Create a new book" %}</h1>
+ <h1>Utwórz nowy moduł</h1>
<form enctype="multipart/form-data" method="POST">
{% csrf_token %}
<table class='editable'>
{{ form.as_table}}
- <tr><td></td><td><button type="submit">{% trans "Create book" %}</button></td></tr>
+ <tr><td></td><td><button type="submit">Utwórz moduł</button></td></tr>
</table>
</form>
{% endblock content %}
if user.has_perm('catalogue.add_book'):
tabs.append(Tab('create', _('Add'), reverse("catalogue_create_missing")))
- tabs.append(Tab('upload', _('Upload'), reverse("catalogue_upload")))
-
- tabs.append(Tab('cover', _('Covers'), reverse("cover_image_list")))
return {"tabs": tabs, "active_tab": active}
+# -*- coding: utf-8 -*-
from datetime import datetime, date, timedelta
import logging
import os
gallery=form.cleaned_data['gallery'],
)
- return http.HttpResponseRedirect(reverse("catalogue_book", args=[book.slug]))
+ return http.HttpResponseRedirect(reverse("wiki_editor", args=[book.slug]))
else:
form = forms.DocumentCreateForm(initial={
"slug": slug,
"title": slug.replace('-', ' ').title(),
- "gallery": slug,
})
return render(request, "catalogue/document_create_missing.html", {
def breadcrumbs(self):
return [
- (_('books'), reverse('catalogue_document_list')),
+ (u'moduły', reverse('catalogue_document_list')),
(self.object.title, self.object.get_absolute_url()),
- (_('scan gallery'),),
+ (u'materiały'),
]
class Meta(Tag.Meta):
app_label = model._meta.app_label
+ if hasattr(model, 'TagMeta'):
+ for attr, value in model.TagMeta.__dict__.items():
+ setattr(Meta, attr, value)
+
attrs = {
'__module__': model.__module__,
'Meta': Meta,
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
- 'django_cas.backends.CASBackend',
+ 'fnpdjango.auth_backends.AttrCASBackend',
)
ROOT_URLCONF = 'redakcja.urls'
}
#tabs-nav-left {
- margin-left: 60px;
+ margin-left: 80px;
}
#tabs-nav-left a {
django-gravatar
django-celery
django-kombu
+fnpdjango
# migrations
south>=0.6