From: Lukasz Date: Wed, 2 Jun 2010 00:35:24 +0000 (+0200) Subject: Merge branch 'master' of http://github.com/fnp/wolnelektury X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/41e79f5deff58b34f185c8c7426f505793c1d9c7?hp=b4497f656baaee3053895d2b4060f26542e69ffe Merge branch 'master' of github.com/fnp/wolnelektury --- diff --git a/.gitignore b/.gitignore index 38a691b22..ffdcd2427 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,16 @@ dev.sqlite *~ *.orig +# Compress output +/wolnelektury/static/css/all.min*.css +/wolnelektury/static/js/all*.min.js +/wolnelektury/static/js/jquery.min.js + # Python garbage *.pyc .coverage pip-log.txt +nosetests.xml # Mac OS X garbage .DS_Store diff --git a/apps/catalogue/admin.py b/apps/catalogue/admin.py index 8a718ffd0..b2744ee70 100644 --- a/apps/catalogue/admin.py +++ b/apps/catalogue/admin.py @@ -21,7 +21,7 @@ class TagAdmin(admin.ModelAdmin): class BookAdmin(TaggableModelAdmin): tag_model = Tag - list_display = ('title', 'slug', 'has_pdf_file', 'has_odt_file', 'has_html_file', 'has_description',) + list_display = ('title', 'slug', 'has_pdf_file', 'has_epub_file', 'has_odt_file', 'has_html_file', 'has_description',) search_fields = ('title',) ordering = ('title',) diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index 828227d6f..60a99cdf8 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -72,6 +72,7 @@ FORMATS = ( ('pdf', 'PDF'), ('odt', 'ODT'), ('txt', 'TXT'), + ('epub', 'EPUB'), ) diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index 3ba9f7888..a9ea84254 100644 Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.po b/apps/catalogue/locale/pl/LC_MESSAGES/django.po index 83b0bc7a9..8598c3fe3 100644 --- a/apps/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/apps/catalogue/locale/pl/LC_MESSAGES/django.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-25 11:21+0200\n" -"PO-Revision-Date: 2010-05-19 16:15\n" -"Last-Translator: \n" +"POT-Creation-Date: 2010-06-11 15:43+0200\n" +"PO-Revision-Date: 2010-06-11 15:31\n" +"Last-Translator: \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -33,206 +33,208 @@ msgstr "Półki" msgid "Name of the new shelf" msgstr "nazwa nowej półki" -#: models.py:24 models.py:363 +#: models.py:25 models.py:438 msgid "author" msgstr "autor" -#: models.py:25 +#: models.py:26 msgid "epoch" msgstr "epoka" -#: models.py:26 +#: models.py:27 msgid "kind" msgstr "rodzaj" -#: models.py:27 +#: models.py:28 msgid "genre" msgstr "gatunek" -#: models.py:28 +#: models.py:29 msgid "theme" msgstr "motyw" -#: models.py:29 +#: models.py:30 msgid "set" msgstr "półka" -#: models.py:30 models.py:322 +#: models.py:31 models.py:142 msgid "book" msgstr "książka" -#: models.py:44 migrations/0001_initial.py:47 +#: models.py:45 msgid "name" msgstr "nazwa" -#: models.py:45 models.py:103 models.py:365 migrations/0001_initial.py:19 -#: migrations/0001_initial.py:48 +#: models.py:46 models.py:108 models.py:440 msgid "slug" msgstr "" -#: models.py:46 migrations/0001_initial.py:49 +#: models.py:47 msgid "sort key" msgstr "klucz sortowania" -#: models.py:47 migrations/0001_initial.py:50 +#: models.py:48 msgid "category" msgstr "kategoria" -#: models.py:49 models.py:60 models.py:104 models.py:185 -#: migrations/0001_initial.py:20 migrations/0001_initial.py:51 +#: models.py:50 models.py:76 models.py:109 models.py:226 msgid "description" msgstr "opis" -#: models.py:50 migrations/0001_initial.py:52 +#: models.py:51 msgid "main page" msgstr "strona główna" -#: models.py:50 migrations/0001_initial.py:52 +#: models.py:51 msgid "Show tag on main page" msgstr "Pokazuj tag na stronie głównej" -#: models.py:53 migrations/0001_initial.py:54 +#: models.py:54 msgid "book count" msgstr "liczba książek" -#: models.py:54 +#: models.py:55 msgid "year of death" msgstr "rok śmierci" -#: models.py:80 migrations/0001_initial.py:61 +#: models.py:61 msgid "tag" msgstr "tag" -#: models.py:81 +#: models.py:62 msgid "tags" msgstr "tagi" -#: models.py:102 models.py:362 migrations/0001_initial.py:18 +#: models.py:107 models.py:437 msgid "title" msgstr "tytuł" -#: models.py:105 migrations/0001_initial.py:21 +#: models.py:110 msgid "creation date" msgstr "data utworzenia" -#: models.py:106 migrations/0001_initial.py:22 +#: models.py:111 msgid "short HTML" msgstr "krótki HTML" -#: models.py:107 migrations/0001_initial.py:23 +#: models.py:112 msgid "parent number" msgstr "numer rodzica" -#: models.py:108 +#: models.py:113 msgid "extra information" msgstr "dodatkowe informacje" -#: models.py:114 migrations/0001_initial.py:24 +#: models.py:119 msgid "XML file" msgstr "Plik XML" -#: models.py:115 migrations/0001_initial.py:25 +#: models.py:120 msgid "HTML file" msgstr "Plik HTML" -#: models.py:116 migrations/0001_initial.py:26 +#: models.py:121 msgid "PDF file" msgstr "Plik PDF" -#: models.py:117 migrations/0001_initial.py:27 +#: models.py:122 +msgid "EPUB file" +msgstr "Plik EPUB" + +#: models.py:123 msgid "ODT file" msgstr "Plik ODT" -#: models.py:118 migrations/0001_initial.py:28 +#: models.py:124 msgid "TXT file" msgstr "Plik TXT" -#: models.py:119 +#: models.py:125 msgid "MP3 file" msgstr "Plik MP3" -#: models.py:120 +#: models.py:126 msgid "OGG file" msgstr "Plik OGG" -#: models.py:141 +#: models.py:143 +msgid "books" +msgstr "książki" + +#: models.py:195 msgid "Read online" msgstr "Czytaj online" -#: models.py:221 +#: models.py:276 #, python-format msgid "Book %s already exists" msgstr "Książka %s już istnieje" -#: models.py:264 +#: models.py:313 #, python-format msgid "Book with slug = \"%s\" does not exist." msgstr "Książki ο slug = \"%s\" nie istnieje." -#: models.py:323 -msgid "books" -msgstr "książki" - -#: models.py:357 +#: models.py:415 msgid "fragment" msgstr "fragment" -#: models.py:358 +#: models.py:416 msgid "fragments" msgstr "fragmenty" -#: models.py:364 +#: models.py:439 msgid "goes to public domain" msgstr "trafia do domeny publicznej" -#: models.py:366 +#: models.py:441 msgid "translator" msgstr "tłumacz" -#: models.py:367 +#: models.py:442 msgid "year of translator's death" msgstr "rok śmierci tłumacza" -#: models.py:385 +#: models.py:446 msgid "book stub" msgstr "zapowiedź książki" -#: models.py:386 +#: models.py:447 msgid "book stubs" msgstr "zapowiedzi książek" -#: views.py:339 +#: views.py:379 msgid "

To maintain your shelves you need to be logged in.

" msgstr "

Aby zarządzać swoimi półkami, musisz się zalogować.

" -#: views.py:357 +#: views.py:397 msgid "

Shelves were sucessfully saved.

" msgstr "

Półki zostały zapisane.

" -#: views.py:381 +#: views.py:421 msgid "Book was successfully removed from the shelf" msgstr "Usunięto" -#: views.py:383 +#: views.py:423 msgid "This book is not on the shelf" msgstr "Książki nie ma na półce" -#: views.py:479 +#: views.py:524 #, python-format msgid "

Shelf %s was successfully created

" msgstr "

Półka %s została utworzona

" -#: views.py:494 +#: views.py:539 #, python-format msgid "

Shelf %s was successfully removed

" msgstr "

Półka %s została usunięta

" -#: views.py:553 +#: views.py:598 #, python-format msgid "Today is %(month)s, %(day)s." msgstr "" -#: views.py:554 +#: views.py:599 #, python-format msgid "" "An error occurred: %(exception)s\n" @@ -243,19 +245,11 @@ msgstr "" "\n" "%(tb)s" -#: views.py:555 +#: views.py:600 msgid "Book imported successfully" msgstr "Książka zaimportowana" -#: views.py:557 +#: views.py:602 #, python-format msgid "Error importing file: %r" msgstr "Błąd podczas importowania pliku: %r" - -#: migrations/0001_initial.py:62 -msgid "content type" -msgstr "typ zawartości" - -#: migrations/0001_initial.py:63 -msgid "object id" -msgstr "id obiektu" diff --git a/apps/catalogue/management/commands/importbooks.py b/apps/catalogue/management/commands/importbooks.py index 52aa69feb..c5fbb2e82 100644 --- a/apps/catalogue/management/commands/importbooks.py +++ b/apps/catalogue/management/commands/importbooks.py @@ -67,6 +67,10 @@ class Command(BaseCommand): book.pdf_file.save('%s.pdf' % book.slug, File(file(file_base + '.pdf'))) if verbose: print "Importing %s.pdf" % file_base + if os.path.isfile(file_base + '.epub'): + book.epub_file.save('%s.epub' % book.slug, File(file(file_base + '.epub'))) + if verbose: + print "Importing %s.epub" % file_base if os.path.isfile(file_base + '.odt'): book.odt_file.save('%s.odt' % book.slug, File(file(file_base + '.odt'))) if verbose: diff --git a/apps/catalogue/migrations/0006_epub_tag_counters_and_ltags_descendants.py b/apps/catalogue/migrations/0006_epub_tag_counters_and_ltags_descendants.py new file mode 100644 index 000000000..7b2f2c517 --- /dev/null +++ b/apps/catalogue/migrations/0006_epub_tag_counters_and_ltags_descendants.py @@ -0,0 +1,186 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +def get_ltag(book, orm): + ltag, created = orm.Tag.objects.get_or_create(slug='l-' + book.slug, category='book') + if created: + ltag.name = book.title + ltag.sort_key = ('l-' + book.slug)[:120] + ltag.save() + return ltag + + +class Migration(SchemaMigration): + + def forwards(self, orm): + """ Add _tag_counter and make sure all books carry their ancestors' l-tags """ + + # Adding fields + db.add_column('catalogue_book', '_tag_counter', self.gf('catalogue.fields.JSONField')(null=True)) + db.add_column('catalogue_book', '_theme_counter', self.gf('catalogue.fields.JSONField')(null=True)) + db.add_column('catalogue_book', 'epub_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) + + def ltag_descendants(book, ltags=None): + if ltags is None: + ltags = [] + for tag in ltags: + orm.TagRelation(object_id=book.pk, tag=tag, content_type=book_ct).save() + print book, tag + ltag = get_ltag(book, orm) + for child in book.children.all(): + ltag_descendants(child, ltags + [ltag]) + + if not db.dry_run: + try: + book_ct = orm['contenttypes.contenttype'].objects.get(app_label='catalogue', model='book') + except: + return + # remove all l-tags on books + orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete() + for book in orm.Book.objects.filter(parent=None): + ltag_descendants(book) + + + def backwards(self, orm): + """ Delete _tag_counter and make sure books carry own l-tag. """ + + # Deleting fields + db.delete_column('catalogue_book', '_tag_counter') + db.delete_column('catalogue_book', '_theme_counter') + db.delete_column('catalogue_book', 'epub_file') + + if not db.dry_run: + try: + book_ct = orm['contenttypes.contenttype'].objects.get(app_label='catalogue', model='book') + except: + return + # remove all l-tags on books + orm.TagRelation.objects.filter(content_type=book_ct, tag__category='book').delete() + for book in orm.Book.objects.filter(parent=None): + orm.TagRelation(object_id=book.pk, tag=get_ltag(book, orm), content_type=book_ct).save() + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + 'Meta': {'object_name': 'Book'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'extra_info': ('catalogue.fields.JSONField', [], {}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), + 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) + }, + 'catalogue.bookstub': { + 'Meta': {'object_name': 'BookStub'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'catalogue.fragment': { + 'Meta': {'object_name': 'Fragment'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'short_text': ('django.db.models.fields.TextField', [], {}), + 'text': ('django.db.models.fields.TextField', [], {}) + }, + 'catalogue.tag': { + 'Meta': {'object_name': 'Tag'}, + 'book_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) + }, + 'catalogue.tagrelation': { + 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + } + } + + complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0007_remove_empty_html.py b/apps/catalogue/migrations/0007_remove_empty_html.py new file mode 100644 index 000000000..ca87ccb8b --- /dev/null +++ b/apps/catalogue/migrations/0007_remove_empty_html.py @@ -0,0 +1,146 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import DataMigration +from django.db import models + +class Migration(DataMigration): + + def forwards(self, orm): + """ Look for HTML files without any real content and delete them """ + from lxml import etree + from librarian.html import html_has_content + + for book in orm.Book.objects.exclude(html_file=''): + if not html_has_content(etree.parse(book.html_file)): + book.html_file.delete() + # must do it by hand, we don't see real Book.save + for key in filter(lambda x: x.startswith('_short_html'), book.__dict__): + book.__setattr__(key, '') + book.save() + + def backwards(self, orm): + """ Do nothing. We don't want empty HTML files anyway. """ + pass + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + 'Meta': {'object_name': 'Book'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'extra_info': ('catalogue.fields.JSONField', [], {}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), + 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) + }, + 'catalogue.bookstub': { + 'Meta': {'object_name': 'BookStub'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'catalogue.fragment': { + 'Meta': {'object_name': 'Fragment'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'short_text': ('django.db.models.fields.TextField', [], {}), + 'text': ('django.db.models.fields.TextField', [], {}) + }, + 'catalogue.tag': { + 'Meta': {'object_name': 'Tag'}, + 'book_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) + }, + 'catalogue.tagrelation': { + 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + } + } + + complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0008_unique_tag_category_slug.py b/apps/catalogue/migrations/0008_unique_tag_category_slug.py new file mode 100644 index 000000000..876d0fda5 --- /dev/null +++ b/apps/catalogue/migrations/0008_unique_tag_category_slug.py @@ -0,0 +1,147 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Removing unique constraint on 'Tag', fields ['slug'] + db.delete_unique('catalogue_tag', ['slug']) + + # Adding unique constraint on 'Tag', fields ['category', 'slug'] + db.create_unique('catalogue_tag', ['category', 'slug']) + + + def backwards(self, orm): + + # Adding unique constraint on 'Tag', fields ['slug'] + db.create_unique('catalogue_tag', ['slug']) + + # Removing unique constraint on 'Tag', fields ['category', 'slug'] + db.delete_unique('catalogue_tag', ['category', 'slug']) + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + 'Meta': {'object_name': 'Book'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'extra_info': ('catalogue.fields.JSONField', [], {}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), + 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) + }, + 'catalogue.bookstub': { + 'Meta': {'object_name': 'BookStub'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'catalogue.fragment': { + 'Meta': {'object_name': 'Fragment'}, + '_short_html': ('django.db.models.fields.TextField', [], {}), + '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'short_text': ('django.db.models.fields.TextField', [], {}), + 'text': ('django.db.models.fields.TextField', [], {}) + }, + 'catalogue.tag': { + 'Meta': {'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, + 'book_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) + }, + 'catalogue.tagrelation': { + 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + } + } + + complete_apps = ['catalogue'] diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index e2b263659..2008f0970 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -43,7 +43,7 @@ class TagSubcategoryManager(models.Manager): class Tag(TagBase): name = models.CharField(_('name'), max_length=50, db_index=True) - slug = models.SlugField(_('slug'), max_length=120, unique=True, db_index=True) + slug = models.SlugField(_('slug'), max_length=120, db_index=True) sort_key = models.SlugField(_('sort key'), max_length=120, db_index=True) category = models.CharField(_('category'), max_length=50, blank=False, null=False, db_index=True, choices=TAG_CATEGORIES) @@ -55,11 +55,22 @@ class Tag(TagBase): death = models.IntegerField(_(u'year of death'), blank=True, null=True) gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) + + categories_rev = { + 'autor': 'author', + 'epoka': 'epoch', + 'rodzaj': 'kind', + 'gatunek': 'genre', + 'motyw': 'theme', + 'polka': 'set', + } + categories_dict = dict((item[::-1] for item in categories_rev.iteritems())) class Meta: ordering = ('sort_key',) verbose_name = _('tag') verbose_name_plural = _('tags') + unique_together = (("slug", "category"),) def __unicode__(self): return self.name @@ -69,7 +80,7 @@ class Tag(TagBase): @permalink def get_absolute_url(self): - return ('catalogue.views.tagged_object_list', [self.slug]) + return ('catalogue.views.tagged_object_list', [self.url_chunk]) def has_description(self): return len(self.description) > 0 @@ -90,10 +101,40 @@ class Tag(TagBase): @staticmethod def get_tag_list(tags): if isinstance(tags, basestring): - tag_slugs = tags.split('/') - return [Tag.objects.get(slug=slug) for slug in tag_slugs] + real_tags = [] + ambiguous_slugs = [] + category = None + tags_splitted = tags.split('/') + for index, name in enumerate(tags_splitted): + if name in Tag.categories_rev: + category = Tag.categories_rev[name] + else: + if category: + real_tags.append(Tag.objects.get(slug=name, category=category)) + category = None + else: + try: + real_tags.append(Tag.objects.exclude(category='book').get(slug=name)) + except Tag.MultipleObjectsReturned, e: + ambiguous_slugs.append(name) + + if category: + # something strange left off + raise Tag.DoesNotExist() + if ambiguous_slugs: + # some tags should be qualified + e = Tag.MultipleObjectsReturned() + e.tags = real_tags + e.ambiguous_slugs = ambiguous_slugs + raise e + else: + return real_tags else: return TagBase.get_tag_list(tags) + + @property + def url_chunk(self): + return '/'.join((Tag.categories_dict[self.category], self.slug)) # TODO: why is this hard-coded ? @@ -119,6 +160,7 @@ class Book(models.Model): xml_file = models.FileField(_('XML file'), upload_to=book_upload_path('xml'), blank=True) html_file = models.FileField(_('HTML file'), upload_to=book_upload_path('html'), blank=True) pdf_file = models.FileField(_('PDF file'), upload_to=book_upload_path('pdf'), blank=True) + epub_file = models.FileField(_('EPUB file'), upload_to=book_upload_path('epub'), blank=True) odt_file = models.FileField(_('ODT file'), upload_to=book_upload_path('odt'), blank=True) txt_file = models.FileField(_('TXT file'), upload_to=book_upload_path('txt'), blank=True) mp3_file = models.FileField(_('MP3 file'), upload_to=book_upload_path('mp3'), blank=True) @@ -129,6 +171,9 @@ class Book(models.Model): objects = models.Manager() tagged = managers.ModelTaggedItemManager(Tag) tags = managers.TagDescriptor(Tag) + + _tag_counter = JSONField(null=True, editable=False) + _theme_counter = JSONField(null=True, editable=False) class AlreadyExists(Exception): pass @@ -141,7 +186,7 @@ class Book(models.Model): def __unicode__(self): return self.title - def save(self, force_insert=False, force_update=False, reset_short_html=True): + def save(self, force_insert=False, force_update=False, reset_short_html=True, refresh_mp3=True): if reset_short_html: # Reset _short_html during save for key in filter(lambda x: x.startswith('_short_html'), self.__dict__): @@ -149,7 +194,7 @@ class Book(models.Model): book = super(Book, self).save(force_insert, force_update) - if self.mp3_file: + if refresh_mp3 and self.mp3_file: print self.mp3_file, self.mp3_file.path extra_info = self.get_extra_info_value() extra_info.update(self.get_mp3_info()) @@ -165,6 +210,15 @@ class Book(models.Model): @property def name(self): return self.title + + def book_tag(self): + slug = ('l-' + self.slug)[:120] + book_tag, created = Tag.objects.get_or_create(slug=slug, category='book') + if created: + book_tag.name = self.title[:50] + book_tag.sort_key = slug + book_tag.save() + return book_tag def short_html(self): key = '_short_html_%s' % get_language() @@ -181,6 +235,8 @@ class Book(models.Model): formats.append(u'%s' % (reverse('book_text', kwargs={'slug': self.slug}), _('Read online'))) if self.pdf_file: formats.append(u'PDF' % self.pdf_file.url) + if self.epub_file: + formats.append(u'EPUB' % self.epub_file.url) if self.odt_file: formats.append(u'ODT' % self.odt_file.url) if self.txt_file: @@ -215,6 +271,11 @@ class Book(models.Model): has_pdf_file.short_description = 'PDF' has_pdf_file.boolean = True + def has_epub_file(self): + return bool(self.epub_file) + has_epub_file.short_description = 'EPUB' + has_epub_file.boolean = True + def has_odt_file(self): return bool(self.odt_file) has_odt_file.short_description = 'ODT' @@ -268,24 +329,17 @@ class Book(models.Model): if category == 'author': tag_sort_key = tag_name.last_name tag_name = ' '.join(tag_name.first_names) + ' ' + tag_name.last_name - tag, created = Tag.objects.get_or_create(slug=slughifi(tag_name)) + tag, created = Tag.objects.get_or_create(slug=slughifi(tag_name), category=category) if created: tag.name = tag_name tag.sort_key = slughifi(tag_sort_key) - tag.category = category tag.save() book_tags.append(tag) - book_tag, created = Tag.objects.get_or_create(slug=('l-' + book.slug)[:120]) - if created: - book_tag.name = book.title[:50] - book_tag.sort_key = ('l-' + book.slug)[:120] - book_tag.category = 'book' - book_tag.save() - book_tags.append(book_tag) - book.tags = book_tags + book_tag = book.book_tag() + if hasattr(book_info, 'parts'): for n, part_url in enumerate(book_info.parts): base, slug = part_url.rsplit('/', 1) @@ -300,6 +354,8 @@ class Book(models.Model): book_descendants = list(book.children.all()) while len(book_descendants) > 0: child_book = book_descendants.pop(0) + child_book.tags = list(child_book.tags) + [book_tag] + child_book.save() for fragment in child_book.fragments.all(): fragment.tags = set(list(fragment.tags) + [book_tag]) book_descendants += list(child_book.children.all()) @@ -328,11 +384,10 @@ class Book(models.Model): continue themes = [] for theme_name in theme_names: - tag, created = Tag.objects.get_or_create(slug=slughifi(theme_name)) + tag, created = Tag.objects.get_or_create(slug=slughifi(theme_name), category='theme') if created: tag.name = theme_name tag.sort_key = slughifi(theme_name) - tag.category = 'theme' tag.save() themes.append(tag) new_fragment.save() @@ -344,6 +399,40 @@ class Book(models.Model): book.save() return book + + + def refresh_tag_counter(self): + tags = {} + for child in self.children.all().order_by(): + for tag_pk, value in child.tag_counter.iteritems(): + tags[tag_pk] = tags.get(tag_pk, 0) + value + for tag in self.tags.exclude(category__in=('book', 'theme', 'set')).order_by(): + tags[tag.pk] = 1 + self.set__tag_counter_value(tags) + self.save(reset_short_html=False, refresh_mp3=False) + return tags + + @property + def tag_counter(self): + if self._tag_counter is None: + return self.refresh_tag_counter() + return dict((int(k), v) for k, v in self.get__tag_counter_value().iteritems()) + + def refresh_theme_counter(self): + tags = {} + for fragment in Fragment.tagged.with_any([self.book_tag()]).order_by(): + for tag in fragment.tags.filter(category='theme').order_by(): + tags[tag.pk] = tags.get(tag.pk, 0) + 1 + self.set__theme_counter_value(tags) + self.save(reset_short_html=False, refresh_mp3=False) + return tags + + @property + def theme_counter(self): + if self._theme_counter is None: + return self.refresh_theme_counter() + return dict((int(k), v) for k, v in self.get__theme_counter_value().iteritems()) + class Fragment(models.Model): diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 41be051f2..504ee69d7 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -11,6 +11,7 @@ from django.utils.encoding import smart_str from django.core.urlresolvers import reverse from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.db.models import Q +from django.conf import settings register = template.Library() @@ -138,7 +139,11 @@ def authentication_form(): def breadcrumbs(tags, search_form=True): from catalogue.forms import SearchForm context = {'tag_list': tags} - if search_form and len(tags) < 6: + try: + max_tag_list = settings.MAX_TAG_LIST + except AttributeError: + max_tag_list = -1 + if search_form and (max_tag_list == -1 or len(tags) < max_tag_list): context['search_form'] = SearchForm(tags=tags) return context @@ -182,10 +187,10 @@ class CatalogueURLNode(Node): else: tags_to_remove.append(tag) - tag_slugs = [tag.slug for tag in tags_to_add] + tag_slugs = [tag.url_chunk for tag in tags_to_add] for tag in tags_to_remove: try: - tag_slugs.remove(tag.slug) + tag_slugs.remove(tag.url_chunk) except KeyError: pass diff --git a/apps/catalogue/templatetags/switch_tag.py b/apps/catalogue/templatetags/switch_tag.py new file mode 100644 index 000000000..b91f872a4 --- /dev/null +++ b/apps/catalogue/templatetags/switch_tag.py @@ -0,0 +1,135 @@ +# Source: http://djangosnippets.org/snippets/967/ +# Author: adurdin +# Posted: August 13, 2008 +# +# +# We can use it based on djangosnippets Terms of Service: +# (http://djangosnippets.org/about/tos/) +# +# 2. That you grant any third party who sees the code you post +# a royalty-free, non-exclusive license to copy and distribute that code +# and to make and distribute derivative works based on that code. You may +# include license terms in snippets you post, if you wish to use +# a particular license (such as the BSD license or GNU GPL), but that +# license must permit royalty-free copying, distribution and modification +# of the code to which it is applied. + +from django import template +from django.template import Library, Node, VariableDoesNotExist + +register = Library() + + +@register.tag(name="switch") +def do_switch(parser, token): + """ + The ``{% switch %}`` tag compares a variable against one or more values in + ``{% case %}`` tags, and outputs the contents of the matching block. An + optional ``{% else %}`` tag sets off the default output if no matches + could be found:: + + {% switch result_count %} + {% case 0 %} + There are no search results. + {% case 1 %} + There is one search result. + {% else %} + Jackpot! Your search found {{ result_count }} results. + {% endswitch %} + + Each ``{% case %}`` tag can take multiple values to compare the variable + against:: + + {% switch username %} + {% case "Jim" "Bob" "Joe" %} + Me old mate {{ username }}! How ya doin? + {% else %} + Hello {{ username }} + {% endswitch %} + """ + bits = token.contents.split() + tag_name = bits[0] + if len(bits) != 2: + raise template.TemplateSyntaxError("'%s' tag requires one argument" % tag_name) + variable = parser.compile_filter(bits[1]) + + class BlockTagList(object): + # This is a bit of a hack, as it embeds knowledge of the behaviour + # of Parser.parse() relating to the "parse_until" argument. + def __init__(self, *names): + self.names = set(names) + def __contains__(self, token_contents): + name = token_contents.split()[0] + return name in self.names + + # Skip over everything before the first {% case %} tag + parser.parse(BlockTagList('case', 'endswitch')) + + cases = [] + token = parser.next_token() + got_case = False + got_else = False + while token.contents != 'endswitch': + nodelist = parser.parse(BlockTagList('case', 'else', 'endswitch')) + + if got_else: + raise template.TemplateSyntaxError("'else' must be last tag in '%s'." % tag_name) + + contents = token.contents.split() + token_name, token_args = contents[0], contents[1:] + + if token_name == 'case': + tests = map(parser.compile_filter, token_args) + case = (tests, nodelist) + got_case = True + else: + # The {% else %} tag + case = (None, nodelist) + got_else = True + cases.append(case) + token = parser.next_token() + + if not got_case: + raise template.TemplateSyntaxError("'%s' must have at least one 'case'." % tag_name) + + return SwitchNode(variable, cases) + +class SwitchNode(Node): + def __init__(self, variable, cases): + self.variable = variable + self.cases = cases + + def __repr__(self): + return "" + + def __iter__(self): + for tests, nodelist in self.cases: + for node in nodelist: + yield node + + def get_nodes_by_type(self, nodetype): + nodes = [] + if isinstance(self, nodetype): + nodes.append(self) + for tests, nodelist in self.cases: + nodes.extend(nodelist.get_nodes_by_type(nodetype)) + return nodes + + def render(self, context): + try: + value_missing = False + value = self.variable.resolve(context, True) + except VariableDoesNotExist: + no_value = True + value_missing = None + + for tests, nodelist in self.cases: + if tests is None: + return nodelist.render(context) + elif not value_missing: + for test in tests: + test_value = test.resolve(context, True) + if value == test_value: + return nodelist.render(context) + else: + return "" diff --git a/apps/catalogue/tests.py b/apps/catalogue/tests.py index f5a35a41e..829f8dce2 100644 --- a/apps/catalogue/tests.py +++ b/apps/catalogue/tests.py @@ -3,6 +3,7 @@ from django.test import TestCase from catalogue import models, views from django.core.files.base import ContentFile from django.contrib.auth.models import User, AnonymousUser +from django.test.client import Client from nose.tools import raises from StringIO import StringIO @@ -79,9 +80,11 @@ class PersonStub(object): self.first_names = first_names self.last_name = last_name +from slughifi import slughifi + class BookInfoStub(object): - def __init__(self, **kwargs): + def __init__(self, **kwargs): self.__dict = kwargs def __setattr__(self, key, value): @@ -95,6 +98,15 @@ class BookInfoStub(object): def to_dict(self): return dict((key, unicode(value)) for key, value in self.__dict.items()) +def info_args(title): + """ generate some keywords for comfortable BookInfoCreation """ + slug = unicode(slughifi(title)) + return {'title': unicode(title), + 'slug': slug, + 'url': u"http://wolnelektury.pl/example/%s" % slug, + 'about': u"http://wolnelektury.pl/example/URI/%s" % slug, + } + class BookImportLogicTests(TestCase): def setUp(self): @@ -110,13 +122,15 @@ class BookImportLogicTests(TestCase): self.expected_tags = [ ('author', 'jim-lazy'), - ('book', 'l-default_book'), ('genre', 'x-genre'), ('epoch', 'x-epoch'), ('kind', 'x-kind'), ] self.expected_tags.sort() + def tearDown(self): + models.Book.objects.all().delete() + def test_empty_book(self): BOOK_TEXT = "" book = models.Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info) @@ -124,7 +138,7 @@ class BookImportLogicTests(TestCase): self.assertEqual(book.title, "Default Book") self.assertEqual(book.slug, "default_book") self.assert_(book.parent is None) - self.assertTrue(book.has_html_file()) + self.assertFalse(book.has_html_file()) # no fragments generated self.assertEqual(book.fragments.count(), 0) @@ -139,6 +153,21 @@ class BookImportLogicTests(TestCase): tags.sort() self.assertEqual(tags, self.expected_tags) + + def test_not_quite_empty_book(self): + """ Not empty, but without any real text. + + Should work like any other non-empty book. + """ + + BOOK_TEXT = """ + + Nic + + """ + + book = models.Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info) + self.assertTrue(book.has_html_file()) def test_book_with_fragment(self): BOOK_TEXT = """ @@ -148,6 +177,7 @@ class BookImportLogicTests(TestCase): """ book = models.Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info) + self.assertTrue(book.has_html_file()) self.assertEqual(book.fragments.count(), 1) self.assertEqual(book.fragments.all()[0].text, u'

Ala ma kota

\n') @@ -183,3 +213,264 @@ class BookImportLogicTests(TestCase): slug="jim-lazy", category="author") + +class BooksByTagTests(TestCase): + """ tests the /katalog/tag page for found books """ + + def setUp(self): + author = PersonStub(("Common",), "Man") + tags = dict(genre='G', epoch='E', author=author, kind="K") + + # grandchild + kwargs = info_args(u"GChild") + kwargs.update(tags) + gchild_info = BookInfoStub(**kwargs) + # child + kwargs = info_args(u"Child") + kwargs.update(tags) + child_info = BookInfoStub(parts=[gchild_info.url], **kwargs) + # other grandchild + kwargs = info_args(u"Different GChild") + kwargs.update(tags) + diffgchild_info = BookInfoStub(**kwargs) + # other child + kwargs = info_args(u"Different Child") + kwargs.update(tags) + kwargs['kind'] = 'K2' + diffchild_info = BookInfoStub(parts=[diffgchild_info.url], **kwargs) + # parent + kwargs = info_args(u"Parent") + kwargs.update(tags) + parent_info = BookInfoStub(parts=[child_info.url, diffchild_info.url], **kwargs) + + # create the books + book_file = ContentFile('') + for info in gchild_info, child_info, diffgchild_info, diffchild_info, parent_info: + book = models.Book.from_text_and_meta(book_file, info) + + # useful tags + self.author = models.Tag.objects.get(name='Common Man', category='author') + tag_empty = models.Tag(name='Empty tag', slug='empty', category='author') + tag_empty.save() + + self.client = Client() + + + def tearDown(self): + models.Book.objects.all().delete() + + + def test_nonexistent_tag(self): + """ Looking for a non-existent tag should yield 404 """ + self.assertEqual(404, self.client.get('/katalog/czeslaw_milosz/').status_code) + + def test_book_tag(self): + """ Looking for a book tag isn't permitted """ + self.assertEqual(404, self.client.get('/katalog/parent/').status_code) + + def test_tag_empty(self): + """ Tag with no books should return no books """ + context = self.client.get('/katalog/empty/').context + self.assertEqual(0, len(context['object_list'])) + + def test_tag_common(self): + """ Filtering by tag should only yield top-level books. """ + context = self.client.get('/katalog/%s/' % self.author.slug).context + self.assertEqual([book.title for book in context['object_list']], + ['Parent']) + + def test_tag_child(self): + """ Filtering by child's tag should yield the child """ + context = self.client.get('/katalog/k2/').context + self.assertEqual([book.title for book in context['object_list']], + ['Different Child']) + + def test_tag_child_jump(self): + """ Of parent and grandchild, only parent should be returned. """ + context = self.client.get('/katalog/k/').context + self.assertEqual([book.title for book in context['object_list']], + ['Parent']) + + +class TagRelatedTagsTests(TestCase): + """ tests the /katalog/tag/ page for related tags """ + + def setUp(self): + author = PersonStub(("Common",), "Man") + + gchild_info = BookInfoStub(author=author, genre="GchildGenre", epoch='Epoch', kind="Kind", + **info_args(u"GChild")) + child1_info = BookInfoStub(author=author, genre="ChildGenre", epoch='Epoch', kind="ChildKind", + parts=[gchild_info.url], + **info_args(u"Child1")) + child2_info = BookInfoStub(author=author, genre="ChildGenre", epoch='Epoch', kind="ChildKind", + **info_args(u"Child2")) + parent_info = BookInfoStub(author=author, genre="Genre", epoch='Epoch', kind="Kind", + parts=[child1_info.url, child2_info.url], + **info_args(u"Parent")) + + for info in gchild_info, child1_info, child2_info, parent_info: + book_text = """ + + Theme, %sTheme + Ala ma kota + + + """ % info.title.encode('utf-8') + book = models.Book.from_text_and_meta(ContentFile(book_text), info) + book.save() + + tag_empty = models.Tag(name='Empty tag', slug='empty', category='author') + tag_empty.save() + + self.client = Client() + + + def tearDown(self): + models.Book.objects.all().delete() + + + def test_empty(self): + """ empty tag should have no related tags """ + + cats = self.client.get('/katalog/empty/').context['categories'] + self.assertEqual(cats, {}, 'tags related to empty tag') + + + def test_has_related(self): + """ related own and descendants' tags should be generated """ + + cats = self.client.get('/katalog/kind/').context['categories'] + self.assertTrue('Common Man' in [tag.name for tag in cats['author']], + 'missing `author` related tag') + self.assertTrue('Epoch' in [tag.name for tag in cats['epoch']], + 'missing `epoch` related tag') + self.assertTrue("ChildKind" in [tag.name for tag in cats['kind']], + "missing `kind` related tag") + self.assertTrue("Genre" in [tag.name for tag in cats['genre']], + 'missing `genre` related tag') + self.assertTrue("ChildGenre" in [tag.name for tag in cats['genre']], + "missing child's related tag") + self.assertTrue("GchildGenre" in [tag.name for tag in cats['genre']], + "missing grandchild's related tag") + self.assertTrue('Theme' in [tag.name for tag in cats['theme']], + "missing related theme") + self.assertTrue('Child1Theme' in [tag.name for tag in cats['theme']], + "missing child's related theme") + self.assertTrue('GChildTheme' in [tag.name for tag in cats['theme']], + "missing grandchild's related theme") + + + def test_related_differ(self): + """ related tags shouldn't include filtering tags """ + + cats = self.client.get('/katalog/kind/').context['categories'] + self.assertFalse('Kind' in [tag.name for tag in cats['kind']], + 'filtering tag wrongly included in related') + cats = self.client.get('/katalog/theme/').context['categories'] + self.assertFalse('Theme' in [tag.name for tag in cats['theme']], + 'filtering theme wrongly included in related') + + + def test_parent_tag_once(self): + """ if parent and descendants have a common tag, count it only once """ + + cats = self.client.get('/katalog/kind/').context['categories'] + self.assertEqual([(tag.name, tag.count) for tag in cats['epoch']], + [('Epoch', 1)], + 'wrong related tag epoch tag on tag page') + + + def test_siblings_tags_add(self): + """ if children have tags and parent hasn't, count the children """ + + cats = self.client.get('/katalog/epoch/').context['categories'] + self.assertTrue(('ChildKind', 2) in [(tag.name, tag.count) for tag in cats['kind']], + 'wrong related kind tags on tag page') + + def test_themes_add(self): + """ all occurencies of theme should be counted """ + + cats = self.client.get('/katalog/epoch/').context['categories'] + self.assertTrue(('Theme', 4) in [(tag.name, tag.count) for tag in cats['theme']], + 'wrong related theme count') + + + +class CleanTagRelationTests(TestCase): + """ tests for tag relations cleaning after deleting things """ + + def setUp(self): + author = PersonStub(("Common",), "Man") + + book_info = BookInfoStub(author=author, genre="G", epoch='E', kind="K", + **info_args(u"Book")) + book_text = """ + ThemeAla ma kota + + + """ + book = models.Book.from_text_and_meta(ContentFile(book_text), book_info) + book.save() + + self.client = Client() + + + def tearDown(self): + models.Book.objects.all().delete() + + + def test_delete_objects(self): + """ there should be no related tags left after deleting some objects """ + + models.Book.objects.all().delete() + cats = self.client.get('/katalog/k/').context['categories'] + self.assertEqual({}, cats) + + + def test_deleted_tag(self): + """ there should be no tag relations left after deleting tags """ + + models.Tag.objects.all().delete() + cats = self.client.get('/katalog/lektura/book/').context['categories'] + self.assertEqual(cats, {}) + + +class TestIdenticalTag(TestCase): + + def setUp(self): + author = PersonStub(("A",), "B") + + book_info = BookInfoStub(author=author, genre="A B", epoch='A B', kind="A B", + **info_args(u"A B")) + book_text = """ + A BAla ma kota + + + """ + book = models.Book.from_text_and_meta(ContentFile(book_text), book_info) + book.save() + + self.client = Client() + + + def tearDown(self): + models.Book.objects.all().delete() + + + def test_book_tags(self): + """ there should be all related tags in relevant categories """ + + cats = self.client.get('/katalog/lektura/a-b/').context['categories'] + for category in 'author', 'kind', 'genre', 'epoch', 'theme': + self.assertTrue('A B' in [tag.name for tag in cats[category]], + 'missing related tag for %s' % category) + + def test_qualified_url(self): + categories = {'author': 'autor', 'theme': 'motyw', 'epoch': 'epoka', 'kind':'rodzaj', 'genre':'gatunek'} + for cat, localcat in categories.iteritems(): + context = self.client.get('/katalog/%s/a-b/' % localcat).context + self.assertEqual(1, len(context['object_list'])) + self.assertNotEqual({}, context['categories']) + self.assertFalse(cat in context['categories']) + diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 0e146fd90..4476fd266 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -8,6 +8,8 @@ import sys import pprint import traceback import re +import itertools +from operator import itemgetter from django.conf import settings from django.template import RequestContext @@ -71,15 +73,33 @@ def book_list(request): context_instance=RequestContext(request)) -def tagged_object_list(request, tags=''): - # Prevent DoS attacks on our database - if len(tags.split('/')) > 6: - raise Http404 +def differentiate_tags(request, tags, ambiguous_slugs): + beginning = '/'.join(tag.url_chunk for tag in tags) + unparsed = '/'.join(ambiguous_slugs[1:]) + options = [] + for tag in models.Tag.objects.exclude(category='book').filter(slug=ambiguous_slugs[0]): + options.append({ + 'url_args': '/'.join((beginning, tag.url_chunk, unparsed)).strip('/'), + 'tags': [tag] + }) + return render_to_response('catalogue/differentiate_tags.html', + {'tags': tags, 'options': options, 'unparsed': ambiguous_slugs[1:]}, + context_instance=RequestContext(request)) + +def tagged_object_list(request, tags=''): try: tags = models.Tag.get_tag_list(tags) except models.Tag.DoesNotExist: raise Http404 + except models.Tag.MultipleObjectsReturned, e: + return differentiate_tags(request, e.tags, e.ambiguous_slugs) + + try: + if len(tags) > settings.MAX_TAG_LIST: + raise Http404 + except AttributeError: + pass if len([tag for tag in tags if tag.category == 'book']): raise Http404 @@ -88,7 +108,8 @@ def tagged_object_list(request, tags=''): shelf_is_set = len(tags) == 1 and tags[0].category == 'set' my_shelf_is_set = shelf_is_set and request.user.is_authenticated() and request.user == tags[0].user - objects = only_author = pd_counter = categories = None + objects = only_author = pd_counter = None + categories = {} if theme_is_set: shelf_tags = [tag for tag in tags if tag.category == 'set'] @@ -97,7 +118,7 @@ def tagged_object_list(request, tags=''): if shelf_tags: books = models.Book.tagged.with_all(shelf_tags).order_by() - l_tags = [models.Tag.objects.get(slug='l-' + book.slug) for book in books] + l_tags = [book.book_tag() for book in books] fragments = models.Fragment.tagged.with_any(l_tags, fragments) # newtagging goes crazy if we just try: @@ -113,26 +134,29 @@ def tagged_object_list(request, tags=''): objects = fragments else: - books = models.Book.tagged.with_all(tags).order_by() - l_tags = [models.Tag.objects.get(slug='l-' + book.slug) for book in books] - book_keys = [book.pk for book in books] - # newtagging goes crazy if we just try: - #related_tags = models.Tag.objects.usage_for_queryset(books, counts=True, - # extra={'where': ["catalogue_tag.category NOT IN ('set', 'book', 'theme')"]}) - if book_keys: - related_tags = models.Book.tags.usage(counts=True, - filters={'pk__in': book_keys}, - extra={'where': ["catalogue_tag.category NOT IN ('set', 'book', 'theme')"]}) - categories = split_tags(related_tags) - - fragment_keys = [fragment.pk for fragment in models.Fragment.tagged.with_any(l_tags)] - if fragment_keys: - categories['theme'] = models.Fragment.tags.usage(counts=True, - filters={'pk__in': fragment_keys}, - extra={'where': ["catalogue_tag.category = 'theme'"]}) - - books = books.exclude(parent__in=book_keys) - objects = books + # get relevant books and their tags + objects = models.Book.tagged.with_all(tags).order_by() + l_tags = [book.book_tag() for book in objects] + # eliminate descendants + descendants_keys = [book.pk for book in models.Book.tagged.with_any(l_tags)] + if descendants_keys: + objects = objects.exclude(pk__in=descendants_keys) + + # get related tags from `tag_counter` and `theme_counter` + related_counts = {} + tags_pks = [tag.pk for tag in tags] + for book in objects: + for tag_pk, value in itertools.chain(book.tag_counter.iteritems(), book.theme_counter.iteritems()): + if tag_pk in tags_pks: + continue + related_counts[tag_pk] = related_counts.get(tag_pk, 0) + value + related_tags = models.Tag.objects.filter(pk__in=related_counts.keys()) + related_tags = [tag for tag in related_tags if tag not in tags] + for tag in related_tags: + tag.count = related_counts[tag.pk] + + categories = split_tags(related_tags) + del related_tags if not objects: only_author = len(tags) == 1 and tags[0].category == 'author' @@ -158,8 +182,8 @@ def tagged_object_list(request, tags=''): def book_fragments(request, book_slug, theme_slug): book = get_object_or_404(models.Book, slug=book_slug) - book_tag = get_object_or_404(models.Tag, slug='l-' + book_slug) - theme = get_object_or_404(models.Tag, slug=theme_slug) + book_tag = get_object_or_404(models.Tag, slug='l-' + book_slug, category='book') + theme = get_object_or_404(models.Tag, slug=theme_slug, category='theme') fragments = models.Fragment.tagged.with_all([book_tag, theme]) form = forms.SearchForm() @@ -173,7 +197,7 @@ def book_detail(request, slug): except models.Book.DoesNotExist: return book_stub_detail(request, slug) - book_tag = get_object_or_404(models.Tag, slug='l-' + slug) + book_tag = book.book_tag() tags = list(book.tags.filter(~Q(category='set'))) categories = split_tags(tags) book_children = book.children.all().order_by('parent_number') @@ -282,7 +306,7 @@ def _get_result_link(match, tag_list): return match.get_absolute_url() else: return reverse('catalogue.views.tagged_object_list', - kwargs={'tags': '/'.join(tag.slug for tag in tag_list + [match])} + kwargs={'tags': '/'.join(tag.url_chunk for tag in tag_list + [match])} ) def _get_result_type(match): @@ -443,7 +467,7 @@ def download_shelf(request, slug): if form.is_valid(): formats = form.cleaned_data['formats'] if len(formats) == 0: - formats = ['pdf', 'odt', 'txt', 'mp3', 'ogg'] + formats = ['pdf', 'epub', 'odt', 'txt', 'mp3', 'ogg'] # Create a ZIP archive temp = tempfile.TemporaryFile() @@ -453,6 +477,9 @@ def download_shelf(request, slug): if 'pdf' in formats and book.pdf_file: filename = book.pdf_file.path archive.write(filename, str('%s.pdf' % book.slug)) + if 'epub' in formats and book.epub_file: + filename = book.epub_file.path + archive.write(filename, str('%s.epub' % book.slug)) if 'odt' in formats and book.odt_file: filename = book.odt_file.path archive.write(filename, str('%s.odt' % book.slug)) @@ -483,11 +510,13 @@ def shelf_book_formats(request, shelf): """ shelf = get_object_or_404(models.Tag, slug=shelf, category='set') - formats = {'pdf': False, 'odt': False, 'txt': False, 'mp3': False, 'ogg': False} + formats = {'pdf': False, 'epub': False, 'odt': False, 'txt': False, 'mp3': False, 'ogg': False} for book in collect_books(models.Book.tagged.with_all(shelf)): if book.pdf_file: formats['pdf'] = True + if book.epub_file: + formats['epub'] = True if book.odt_file: formats['odt'] = True if book.txt_file: diff --git a/apps/infopages/migrations/0001_initial.py b/apps/infopages/migrations/0001_initial.py index 94ca2b301..a1289a2c6 100644 --- a/apps/infopages/migrations/0001_initial.py +++ b/apps/infopages/migrations/0001_initial.py @@ -50,8 +50,9 @@ class Migration(SchemaMigration): ('page_title_ru', self.gf('django.db.models.fields.CharField')(max_length=120, null=True, blank=True)), )) - from django.core.management import call_command - call_command("loaddata", "wl_data") + if not db.dry_run: + from django.core.management import call_command + call_command("loaddata", "wl_data") db.send_create_signal('infopages', ['InfoPage']) diff --git a/deployment.py b/deployment.py old mode 100644 new mode 100755 diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 000000000..f3c7e8e6f --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1 @@ +nose diff --git a/requirements.txt b/requirements.txt index afecb8f2c..a577d714d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,6 +17,6 @@ sorl-thumbnail>=3.2 # home-brewed & dependencies lxml>=2.2.2 -git+git://github.com/fnp/librarian.git +-e git+git://github.com/fnp/librarian.git@d43d87400dcc19851442#egg=librarian # MySQL-python>=1.2,<2.0 diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.mo b/wolnelektury/locale/de/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/de/LC_MESSAGES/django.mo and b/wolnelektury/locale/de/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.po b/wolnelektury/locale/de/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/de/LC_MESSAGES/django.po +++ b/wolnelektury/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/en/LC_MESSAGES/django.mo b/wolnelektury/locale/en/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/en/LC_MESSAGES/django.mo and b/wolnelektury/locale/en/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/en/LC_MESSAGES/django.po b/wolnelektury/locale/en/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/en/LC_MESSAGES/django.po +++ b/wolnelektury/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/es/LC_MESSAGES/django.mo b/wolnelektury/locale/es/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/es/LC_MESSAGES/django.mo and b/wolnelektury/locale/es/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/es/LC_MESSAGES/django.po b/wolnelektury/locale/es/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/es/LC_MESSAGES/django.po +++ b/wolnelektury/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/fr/LC_MESSAGES/django.mo b/wolnelektury/locale/fr/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/fr/LC_MESSAGES/django.mo and b/wolnelektury/locale/fr/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/fr/LC_MESSAGES/django.po b/wolnelektury/locale/fr/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/fr/LC_MESSAGES/django.po +++ b/wolnelektury/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/lt/LC_MESSAGES/django.mo b/wolnelektury/locale/lt/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/lt/LC_MESSAGES/django.mo and b/wolnelektury/locale/lt/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/lt/LC_MESSAGES/django.po b/wolnelektury/locale/lt/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/lt/LC_MESSAGES/django.po +++ b/wolnelektury/locale/lt/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.mo b/wolnelektury/locale/pl/LC_MESSAGES/django.mo index 10a0b3083..3c3e522b4 100644 Binary files a/wolnelektury/locale/pl/LC_MESSAGES/django.mo and b/wolnelektury/locale/pl/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.po b/wolnelektury/locale/pl/LC_MESSAGES/django.po index 9dc31e3e8..f76237083 100644 --- a/wolnelektury/locale/pl/LC_MESSAGES/django.po +++ b/wolnelektury/locale/pl/LC_MESSAGES/django.po @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" -"PO-Revision-Date: 2010-06-01 12:20\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" +"PO-Revision-Date: 2010-06-11 16:14\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -53,8 +53,12 @@ msgid "Page does not exist" msgstr "Podana strona nie istnieje" #: templates/404.html:17 -msgid "We are sorry, but this page does not exist. Please check if you entered correct address or go to " -msgstr "Przepraszamy, ale ta strona nie istnieje. Sprawdź czy podałeś dobry adres, lub przejdź do" +msgid "" +"We are sorry, but this page does not exist. Please check if you entered " +"correct address or go to " +msgstr "" +"Przepraszamy, ale ta strona nie istnieje. Sprawdź czy podałeś dobry adres, " +"lub przejdź do" #: templates/404.html:17 msgid "main page" @@ -65,10 +69,16 @@ msgid "Server error" msgstr "Błąd serwera" #: templates/500.html:55 -msgid "

The Wolnelektury.pl site is currently unavailable. Meanwhile, visit our blog.

Inform our administrators about the error.

" +msgid "" +"

The Wolnelektury.pl site is currently unavailable. Meanwhile, visit our " +"blog.

Inform our administrators about the " +"error.

" msgstr "" -"

Serwis Wolnelektury.pl jest chwilowo niedostępny. Odwiedź naszego bloga

\n" -"

Powiadom administratorów o błędzie.

" +"

Serwis Wolnelektury.pl jest chwilowo niedostępny. Odwiedź naszego bloga

\n" +"

Powiadom administratorów o błędzie.

" #: templates/503.html:6 templates/503.html.py:54 msgid "Service unavailable" @@ -76,11 +86,17 @@ msgstr "Serwis niedostępny" #: templates/503.html:56 msgid "The Wolnelektury.pl site is currently unavailable due to maintainance." -msgstr "Serwis Wolnelektury.pl jest obecnie niedostępny z powodu prac konserwacyjnych." +msgstr "" +"Serwis Wolnelektury.pl jest obecnie niedostępny z powodu prac " +"konserwacyjnych." #: templates/base.html:20 -msgid "Internet Explorer cannot display this site properly. Click here to read more..." -msgstr "Internet Explorer nie potrafi poprawnie wyświetlić tej strony. Kliknij tutaj, aby dowiedzieć się więcej..." +msgid "" +"Internet Explorer cannot display this site properly. Click here to read " +"more..." +msgstr "" +"Internet Explorer nie potrafi poprawnie wyświetlić tej strony. Kliknij " +"tutaj, aby dowiedzieć się więcej..." #: templates/base.html:33 msgid "Welcome" @@ -126,45 +142,53 @@ msgstr "Wybierz język" #: templates/base.html:70 msgid "" "\n" -"\t\t\t\tWolne Lektury is a project lead by Modern Poland Foundation.\n" -"\t\t\t\tDigital reproductions are made by The National Library, based on TNL resources. \n" +"\t\t\t\tWolne Lektury is a project lead by Modern Poland Foundation.\n" +"\t\t\t\tDigital reproductions are made by The National Library, based on TNL resources. \n" "\t\t\t\tHosting EO Networks.\n" "\t\t\t\t" msgstr "" "\n" -"Wolne Lektury to projekt prowadzony przez Fundację Nowoczesna Polska. \n" -"Reprodukcje cyfrowe wykonane przez Bibliotekę Narodową z egzemplarzy pochodzących ze zbiorów BN.\n" +"Wolne Lektury to projekt prowadzony przez Fundację Nowoczesna Polska. \n" +"Reprodukcje cyfrowe wykonane przez Bibliotekę Narodową z egzemplarzy pochodzących ze zbiorów BN.\n" "Hosting EO Networks. " #: templates/base.html:77 msgid "" "\n" -"\t\t\t\tModern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17\n" -" e-mail: fundacja@nowoczesnapolska.org.pl\n" +"\t\t\t\tModern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 " +"lok. 125, tel/fax: (22) 621-30-17\n" +" e-mail: fundacja@nowoczesnapolska.org.pl\n" "\t\t\t\t" msgstr "" "\n" -"Fundacja Nowoczesna Polska, 00-514 Warszawa, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17, e-mail: fundacja@nowoczesnapolska.org.pl" +"Fundacja Nowoczesna Polska, 00-514 Warszawa, ul. Marszałkowska 84/92 lok. " +"125, tel/fax: (22) 621-30-17, e-mail: fundacja@nowoczesnapolska.org.pl" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "Zamknij" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "Ładowanie" @@ -200,7 +224,7 @@ msgstr "Szukaj" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -247,70 +271,74 @@ msgid "Download PDF" msgstr "Pobierz plik PDF" #: templates/catalogue/book_detail.html:37 +msgid "Download EPUB" +msgstr "Pobierz plik EPUB" + +#: templates/catalogue/book_detail.html:40 msgid "Download ODT" msgstr "Pobierz plik ODT" -#: templates/catalogue/book_detail.html:40 +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "Pobierz plik TXT" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "Czyta" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "Reżyseruje" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "Pobierz plik MP3" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "Pobierz plik Ogg Vorbis" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "O utworze" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "Autor" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "Epoka" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "Rodzaj" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "Gatunek" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "W innych miejscach" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "Lektura na wiki projektu" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "Źródło lektury" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "Opis lektury w Lektury.Gazeta.pl" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "Opis lektury w Wikipedii" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "Motywy w utworze" @@ -354,7 +382,9 @@ msgstr "Wrzuć lekturę na półkę!" #: templates/catalogue/book_sets.html:4 msgid "You do not have any shelves. You can create one below, if you want to." -msgstr "Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej." +msgstr "" +"Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę " +"poniżej." #: templates/catalogue/book_sets.html:9 templates/catalogue/book_short.html:4 msgid "Put on the shelf!" @@ -374,16 +404,26 @@ msgid "Categories" msgstr "Utwór w kategoriach" #: templates/catalogue/book_stub_detail.html:17 -msgid "This work is in public domain and will be published on Internet school library of Wolne Lektury soon." -msgstr "To dzieło znajduje się w domenie publicznej i niedługo zostanie opublikowane w szkolnej bibliotece internetowej Wolne Lektury." +msgid "" +"This work is in public domain and will be published on Internet school " +"library of Wolne Lektury soon." +msgstr "" +"To dzieło znajduje się w domenie publicznej i niedługo zostanie opublikowane " +"w szkolnej bibliotece internetowej Wolne Lektury." #: templates/catalogue/book_stub_detail.html:20 -msgid "This work will become part of public domain and will be allowed to be published without restrictions in" -msgstr "To dzieło przejdzie do zasobów domeny publicznej i będzie mogło być publikowane bez żadnych ograniczeń za" +msgid "" +"This work will become part of public domain and will be allowed to be " +"published without restrictions in" +msgstr "" +"To dzieło przejdzie do zasobów domeny publicznej i będzie mogło być " +"publikowane bez żadnych ograniczeń za" #: templates/catalogue/book_stub_detail.html:22 msgid "Find out why Internet libraries can't publish this work." -msgstr "Dowiedz się, dlaczego biblioteki internetowe nie mogą udostępniać dzieł tego autora." +msgstr "" +"Dowiedz się, dlaczego biblioteki internetowe nie mogą udostępniać dzieł tego " +"autora." #: templates/catalogue/book_stub_detail.html:24 msgid "This work is copyrighted." @@ -394,7 +434,7 @@ msgid "Table of contents" msgstr "Spis treści" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "Motywy" @@ -422,7 +462,9 @@ msgstr "Półki zawierające fragment" #: templates/catalogue/fragment_sets.html:4 #: templates/catalogue/main_page.html:28 msgid "You do not own any shelves. You can create one below, if you want to." -msgstr "Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej." +msgstr "" +"Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę " +"poniżej." #: templates/catalogue/fragment_sets.html:9 msgid "Save all shelves" @@ -467,8 +509,12 @@ msgid "Create shelf" msgstr "Utwórz półkę" #: templates/catalogue/main_page.html:37 -msgid "Create your own book set. You can share it with friends by sending them link to your shelf." -msgstr "Stwórz własny zestaw lektur. Możesz się nim później podzielić z innymi, przesyłając im link do Twojej półki." +msgid "" +"Create your own book set. You can share it with friends by sending them link " +"to your shelf." +msgstr "" +"Stwórz własny zestaw lektur. Możesz się nim później podzielić z innymi, " +"przesyłając im link do Twojej półki." #: templates/catalogue/main_page.html:38 msgid "You need to " @@ -488,30 +534,37 @@ msgid "Hand-outs for teachers" msgstr "Materiały pomocnicze dla nauczycieli" #: templates/catalogue/main_page.html:42 -msgid "Lessons' prospects and other ideas for using Wolnelektury.pl for teaching." -msgstr "Scenariusze lekcji i inne pomysły na wykorzytanie serwisu WolneLektury.pl podczas nauczania." +msgid "" +"Lessons' prospects and other ideas for using Wolnelektury.pl for teaching." +msgstr "" +"Scenariusze lekcji i inne pomysły na wykorzytanie serwisu WolneLektury.pl " +"podczas nauczania." #: templates/catalogue/main_page.html:47 -msgid "are professional recordings of literary texts from our repository, available on free license in MP3 and Ogg Vorbis formats as well as in DAISY system." -msgstr "to profesjonalne nagrania tekstów literackich z naszego zbioru dostępne na wolnej licencji w formatach MP3, Ogg Vorbis oraz w systemie DAISY." +msgid "" +"are professional recordings of literary texts from our repository, available " +"on free license in MP3 and Ogg Vorbis formats as well as in DAISY system." +msgstr "" +"to profesjonalne nagrania tekstów literackich z naszego zbioru dostępne na " +"wolnej licencji w formatach MP3, Ogg Vorbis oraz w systemie DAISY." #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "Autorzy" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "Rodzaje" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "Gatunki" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "Epoki" @@ -536,12 +589,21 @@ msgid "You can help us!" msgstr "Możesz nam pomóc!" #: templates/catalogue/main_page.html:268 -msgid "We try our best to elaborate works appended to our library. It is possible only due to support of our volunteers." -msgstr "Utwory włączane sukcesywnie do naszej biblioteki staramy się opracowywać jak najdokładniej. Jest to możliwe tylko dzięki współpracującym z nami wolontariuszom." +msgid "" +"We try our best to elaborate works appended to our library. It is possible " +"only due to support of our volunteers." +msgstr "" +"Utwory włączane sukcesywnie do naszej biblioteki staramy się opracowywać jak " +"najdokładniej. Jest to możliwe tylko dzięki współpracującym z nami " +"wolontariuszom." #: templates/catalogue/main_page.html:269 -msgid "We invite people who want to take part in developing Internet school library Wolne Lektury." -msgstr "Zapraszamy wszystkie osoby, które chcą współtworzyć szkolną bibliotekę internetową Wolne Lektury." +msgid "" +"We invite people who want to take part in developing Internet school library " +"Wolne Lektury." +msgstr "" +"Zapraszamy wszystkie osoby, które chcą współtworzyć szkolną bibliotekę " +"internetową Wolne Lektury." #: templates/catalogue/main_page.html:273 msgid "About us" @@ -550,11 +612,19 @@ msgstr "O projekcie" #: templates/catalogue/main_page.html:275 msgid "" "\n" -"\t\t\tInternet library with school readings “Wolne Lektury” (www.wolnelektury.pl) is a project made by Modern Poland Foundation. It started in 2007 and shares school readings, which are recommended by Ministry of National Education and are in public domain.\n" +"\t\t\tInternet library with school readings “Wolne Lektury” (www.wolnelektury.pl) is a project made by " +"Modern Poland Foundation. It started in 2007 and shares school readings, " +"which are recommended by Ministry of National Education and are in public " +"domain.\n" "\t\t\t" msgstr "" "\n" -"Biblioteka internetowa z lekturami szkolnymi „Wolne Lektury” (www.wolnelektury.pl) to projekt realizowany przez Fundację Nowoczesna Polska. Działa od 2007 roku i udostępnia w swoich zbiorach lektury szkolne, które są zalecane do użytku przez Ministerstwo Edukacji Narodowej i które trafiły już do domeny publicznej." +"Biblioteka internetowa z lekturami szkolnymi „Wolne Lektury” (www.wolnelektury.pl) to projekt realizowany " +"przez Fundację Nowoczesna Polska. Działa od 2007 roku i udostępnia w swoich " +"zbiorach lektury szkolne, które są zalecane do użytku przez Ministerstwo " +"Edukacji Narodowej i które trafiły już do domeny publicznej." #: templates/catalogue/search_multiple_hits.html:5 #: templates/catalogue/search_too_short.html:5 @@ -570,15 +640,19 @@ msgid "Search in WolneLektury.pl" msgstr "Wyszukiwanie w WolneLektury.pl" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "Przepraszamy! Brak wyników spełniających kryteria podane w zapytaniu." #: templates/catalogue/search_no_hits.html:16 msgid "" -"Search engine supports following criteria: title, author, theme/topic, epoch, kind and genre.\n" +"Search engine supports following criteria: title, author, theme/topic, " +"epoch, kind and genre.\n" "\t\tAs for now we do not support full text search." -msgstr "Wyszukiwarka obsługuje takie kryteria jak tytuł, autor, motyw/temat, epoka, rodzaj i gatunek utworu. Obecnie nie obsługujemy wyszukiwania fraz w tekstach utworów." +msgstr "" +"Wyszukiwarka obsługuje takie kryteria jak tytuł, autor, motyw/temat, epoka, " +"rodzaj i gatunek utworu. Obecnie nie obsługujemy wyszukiwania fraz w " +"tekstach utworów." #: templates/catalogue/search_too_short.html:14 msgid "Sorry! Search query must have at least two characters." @@ -593,8 +667,12 @@ msgid "Your shelf is empty" msgstr "Twoja półka jest pusta" #: templates/catalogue/tagged_object_list.html:16 -msgid "You can put a book on a shelf by entering page of the reading and clicking 'Put on the shelf'." -msgstr "Możesz wrzucić książkę na półkę, wchodząc na stronę danej lektury i klikając na przycisk „Na półkę!”." +msgid "" +"You can put a book on a shelf by entering page of the reading and clicking " +"'Put on the shelf'." +msgstr "" +"Możesz wrzucić książkę na półkę, wchodząc na stronę danej lektury i klikając " +"na przycisk „Na półkę!”." #: templates/catalogue/tagged_object_list.html:31 msgid "Download all books from this shelf" @@ -605,8 +683,8 @@ msgid "Choose books' formats which you want to download:" msgstr "Wybierz formaty książek, które chcesz pobrać:" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "do czytania" @@ -614,96 +692,133 @@ msgstr "do czytania" msgid "and printing using" msgstr "i drukowania przy pomocy" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "i edytowania przy pomocy" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "na małych ekranach, np. na komórce" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "do słuchania" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "w ulubionym odtwarzaczu MP3" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "otwarty format" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "Fundacji Xiph.Org" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "Pobierz" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "Uaktualnianie listy formatów książek na półce." -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "anuluj" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "Podziel się tą półką" -#: templates/catalogue/tagged_object_list.html:48 -msgid "Copy this link and share it with other people to let them see your shelf." -msgstr "Skopiuj ten link i przekaż go osobom, z którymi chcesz się podzielić tą półką." +#: templates/catalogue/tagged_object_list.html:49 +msgid "" +"Copy this link and share it with other people to let them see your shelf." +msgstr "" +"Skopiuj ten link i przekaż go osobom, z którymi chcesz się podzielić tą " +"półką." -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "Przeczytaj omówienia utworów autora w serwisie Lektury.Gazeta.pl" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" -msgstr "Przeczytaj omówienia z epoki" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" +msgstr "Przeczytaj omówienia z epoki %(last_tag)s w serwisie Lektury.Gazeta.pl" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" -msgstr "w serwisie Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" +"Przeczytaj omówienia z rodzaju %(last_tag)s w serwisie Lektury.Gazeta.pl" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" +"Przeczytaj omówienia z gatunku %(last_tag)s w serwisie Lektury.Gazeta.pl" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "Przeczytaj powiązane omówienia w serwisie Lektury.Gazeta.pl" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "Przeczytaj artykuł o autorze w Wikipedii" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" -msgstr "Przeczytaj artykuł o epoce" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "Przeczytaj artykuł o epoce %(last_tag)s w Wikipedii" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" +msgstr "Przeczytaj artykuł o rodzaju %(last_tag)s w Wikipedii" + +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" +msgstr "Przeczytaj artykuł o gatunku %(last_tag)s w Wikipedii" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" -msgstr "w Wikipedii" +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "Przeczytaj powiązany artykuł w Wikipedii" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "Usuń" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "Dzieła tego autora objęte są prawem autorskim." -#: templates/catalogue/tagged_object_list.html:91 -msgid "This author's works are in public domain and will be published on Internet school library of Wolne Lektury soon." -msgstr "Dzieła tego autora znajdują się w domenie publicznej i niedługo zostaną opublikowane w szkolnej bibliotece internetowej Wolne Lektury." +#: templates/catalogue/tagged_object_list.html:104 +msgid "" +"This author's works are in public domain and will be published on Internet " +"school library of Wolne Lektury soon." +msgstr "" +"Dzieła tego autora znajdują się w domenie publicznej i niedługo zostaną " +"opublikowane w szkolnej bibliotece internetowej Wolne Lektury." -#: templates/catalogue/tagged_object_list.html:95 -msgid "This author's works will become part of public domain and will be allowed to be published without restrictions in" -msgstr "Dzieła tego autora przejdą do zasobów domeny publicznej i będą mogły być publikowane bez żadnych ograniczeń za" +#: templates/catalogue/tagged_object_list.html:108 +msgid "" +"This author's works will become part of public domain and will be allowed to " +"be published without restrictions in" +msgstr "" +"Dzieła tego autora przejdą do zasobów domeny publicznej i będą mogły być " +"publikowane bez żadnych ograniczeń za" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." -msgstr "Dowiedz się, dlaczego biblioteki internetowe nie mogą udostępniać dzieł tego autora." +msgstr "" +"Dowiedz się, dlaczego biblioteki internetowe nie mogą udostępniać dzieł tego " +"autora." #: templates/catalogue/user_shelves.html:6 msgid "remove" @@ -711,19 +826,22 @@ msgstr "usuń" #: templates/catalogue/user_shelves.html:10 msgid "You do not own any shelves. You can create one below if you want to" -msgstr "Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć półkę poniżej." +msgstr "" +"Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć półkę poniżej." #: templates/info/base.html:10 msgid "return to the main page" msgstr "wróć do strony głównej" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." -msgstr "W serwisie Wolne Lektury już teraz opublikowanych jest ponad 1000 utworów! Pomóż w rozwijaniu biblioteki i uwalnianiu nowych lektur przekazując nam darowiznę lub 1%% podatku." +"making a donation or transferring 1% of your income tax." +msgstr "" +"W serwisie Wolne Lektury już teraz opublikowanych jest ponad 1000 utworów! " +"Pomóż w rozwijaniu biblioteki i uwalnianiu nowych lektur przekazując nam " +"darowiznę lub 1% podatku." #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 msgid "More..." @@ -734,7 +852,10 @@ msgid "" "Become an editor of Wolne Lektury! Find out if\n" "we're currently working on a reading you're looking for and prepare\n" "a publication by yourself by logging into the Editorial Platform." -msgstr "Zostań redaktorem lub redaktorką Wolnych Lektur! Sprawdź, czy obecnie pracujemy nad publikacją wyszukiwanej przez ciebie lektury i samodzielnie przygotuj publikację logując się na Platformie Redakcyjnej." +msgstr "" +"Zostań redaktorem lub redaktorką Wolnych Lektur! Sprawdź, czy obecnie " +"pracujemy nad publikacją wyszukiwanej przez ciebie lektury i samodzielnie " +"przygotuj publikację logując się na Platformie Redakcyjnej." #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.mo b/wolnelektury/locale/ru/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/ru/LC_MESSAGES/django.mo and b/wolnelektury/locale/ru/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.po b/wolnelektury/locale/ru/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/ru/LC_MESSAGES/django.po +++ b/wolnelektury/locale/ru/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/locale/uk/LC_MESSAGES/django.mo b/wolnelektury/locale/uk/LC_MESSAGES/django.mo index bcaab3060..40859fe0e 100644 Binary files a/wolnelektury/locale/uk/LC_MESSAGES/django.mo and b/wolnelektury/locale/uk/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/uk/LC_MESSAGES/django.po b/wolnelektury/locale/uk/LC_MESSAGES/django.po index ab85ecb03..e9f78ecec 100644 --- a/wolnelektury/locale/uk/LC_MESSAGES/django.po +++ b/wolnelektury/locale/uk/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-06-01 10:53+0200\n" +"POT-Creation-Date: 2010-06-11 16:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -151,24 +151,24 @@ msgid "" msgstr "" #: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 -#: templates/catalogue/book_detail.html:129 +#: templates/catalogue/book_detail.html:132 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 #: templates/catalogue/search_multiple_hits.html:23 #: templates/catalogue/search_no_hits.html:22 #: templates/catalogue/search_too_short.html:19 -#: templates/catalogue/tagged_object_list.html:141 +#: templates/catalogue/tagged_object_list.html:154 msgid "Close" msgstr "" #: templates/base.html:109 templates/base.html.py:115 -#: templates/catalogue/book_detail.html:131 +#: templates/catalogue/book_detail.html:134 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 #: templates/catalogue/search_no_hits.html:24 #: templates/catalogue/search_too_short.html:21 -#: templates/catalogue/tagged_object_list.html:143 +#: templates/catalogue/tagged_object_list.html:156 msgid "Loading" msgstr "" @@ -204,7 +204,7 @@ msgstr "" #: templates/catalogue/book_list.html:12 #: templates/catalogue/book_stub_detail.html:12 #: templates/catalogue/main_page.html:13 -#: templates/catalogue/tagged_object_list.html:41 templates/info/base.html:10 +#: templates/catalogue/tagged_object_list.html:42 templates/info/base.html:10 #: templates/lessons/document_detail.html:9 #: templates/lessons/document_list.html:51 msgid "or" @@ -251,70 +251,74 @@ msgid "Download PDF" msgstr "" #: templates/catalogue/book_detail.html:37 -msgid "Download ODT" +msgid "Download EPUB" msgstr "" #: templates/catalogue/book_detail.html:40 +msgid "Download ODT" +msgstr "" + +#: templates/catalogue/book_detail.html:43 msgid "Download TXT" msgstr "" -#: templates/catalogue/book_detail.html:45 +#: templates/catalogue/book_detail.html:48 msgid "Artist" msgstr "" -#: templates/catalogue/book_detail.html:47 +#: templates/catalogue/book_detail.html:50 msgid "Director" msgstr "" -#: templates/catalogue/book_detail.html:51 +#: templates/catalogue/book_detail.html:54 msgid "Download MP3" msgstr "" -#: templates/catalogue/book_detail.html:52 +#: templates/catalogue/book_detail.html:55 msgid "Download Ogg Vorbis" msgstr "" -#: templates/catalogue/book_detail.html:79 +#: templates/catalogue/book_detail.html:82 msgid "Details" msgstr "" -#: templates/catalogue/book_detail.html:82 +#: templates/catalogue/book_detail.html:85 msgid "Author" msgstr "" -#: templates/catalogue/book_detail.html:88 +#: templates/catalogue/book_detail.html:91 msgid "Epoch" msgstr "" -#: templates/catalogue/book_detail.html:94 +#: templates/catalogue/book_detail.html:97 msgid "Kind" msgstr "" -#: templates/catalogue/book_detail.html:100 +#: templates/catalogue/book_detail.html:103 msgid "Genre" msgstr "" -#: templates/catalogue/book_detail.html:106 +#: templates/catalogue/book_detail.html:109 msgid "Other resources" msgstr "" -#: templates/catalogue/book_detail.html:108 +#: templates/catalogue/book_detail.html:111 msgid "Book on project's wiki" msgstr "" -#: templates/catalogue/book_detail.html:109 +#: templates/catalogue/book_detail.html:112 msgid "Source of the book" msgstr "" -#: templates/catalogue/book_detail.html:111 +#: templates/catalogue/book_detail.html:114 msgid "Book description on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/book_detail.html:114 +#: templates/catalogue/book_detail.html:117 msgid "Book description on Wikipedia" msgstr "" -#: templates/catalogue/book_detail.html:119 +#: templates/catalogue/book_detail.html:122 msgid "Work's themes " msgstr "" @@ -402,7 +406,7 @@ msgid "Table of contents" msgstr "" #: templates/catalogue/book_text.html:18 -#: templates/catalogue/tagged_object_list.html:132 +#: templates/catalogue/tagged_object_list.html:145 msgid "Themes" msgstr "" @@ -509,22 +513,22 @@ msgid "" msgstr "" #: templates/catalogue/main_page.html:54 -#: templates/catalogue/tagged_object_list.html:114 +#: templates/catalogue/tagged_object_list.html:127 msgid "Authors" msgstr "" #: templates/catalogue/main_page.html:58 -#: templates/catalogue/tagged_object_list.html:118 +#: templates/catalogue/tagged_object_list.html:131 msgid "Kinds" msgstr "" #: templates/catalogue/main_page.html:62 -#: templates/catalogue/tagged_object_list.html:122 +#: templates/catalogue/tagged_object_list.html:135 msgid "Genres" msgstr "" #: templates/catalogue/main_page.html:66 -#: templates/catalogue/tagged_object_list.html:126 +#: templates/catalogue/tagged_object_list.html:139 msgid "Epochs" msgstr "" @@ -589,7 +593,7 @@ msgid "Search in WolneLektury.pl" msgstr "" #: templates/catalogue/search_no_hits.html:14 -#: templates/catalogue/tagged_object_list.html:102 +#: templates/catalogue/tagged_object_list.html:115 msgid "Sorry! Search cirteria did not match any resources." msgstr "" @@ -627,8 +631,8 @@ msgid "Choose books' formats which you want to download:" msgstr "" #: templates/catalogue/tagged_object_list.html:36 -#: templates/catalogue/tagged_object_list.html:37 #: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "for reading" msgstr "" @@ -636,99 +640,121 @@ msgstr "" msgid "and printing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:37 +#: templates/catalogue/tagged_object_list.html:38 msgid "and editing using" msgstr "" -#: templates/catalogue/tagged_object_list.html:38 +#: templates/catalogue/tagged_object_list.html:39 msgid "on small displays, for example mobile phones" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 #: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "for listening" msgstr "" -#: templates/catalogue/tagged_object_list.html:39 +#: templates/catalogue/tagged_object_list.html:40 msgid "on favourite MP3 player" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "open format" msgstr "" -#: templates/catalogue/tagged_object_list.html:40 +#: templates/catalogue/tagged_object_list.html:41 msgid "Xiph.org Foundation" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 #: templates/lessons/ajax_document_detail.html:3 #: templates/lessons/document_detail.html:13 msgid "Download" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "Updating list of books' formats on the shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:41 +#: templates/catalogue/tagged_object_list.html:42 msgid "cancel" msgstr "" -#: templates/catalogue/tagged_object_list.html:46 +#: templates/catalogue/tagged_object_list.html:47 msgid "Share this shelf" msgstr "" -#: templates/catalogue/tagged_object_list.html:48 +#: templates/catalogue/tagged_object_list.html:49 msgid "" "Copy this link and share it with other people to let them see your shelf." msgstr "" -#: templates/catalogue/tagged_object_list.html:57 +#: templates/catalogue/tagged_object_list.html:59 msgid "Read work's study of this author on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "Read study of epoch" +#: templates/catalogue/tagged_object_list.html:61 +#, python-format +msgid "Read study of epoch %(last_tag)s on Lektury.Gazeta.pl" msgstr "" -#: templates/catalogue/tagged_object_list.html:60 -msgid "on Lektury.Gazeta.pl" +#: templates/catalogue/tagged_object_list.html:63 +#, python-format +msgid "Read study of kind %(last_tag)s on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:65 +#, python-format +msgid "Read study of genre %(last_tag)s on Lektury.Gazeta.pl" msgstr "" #: templates/catalogue/tagged_object_list.html:67 +msgid "Read related study on Lektury.Gazeta.pl" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:75 msgid "Read article about this author on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "Read article about epoch" +#: templates/catalogue/tagged_object_list.html:77 +#, python-format +msgid "Read article about epoch %(last_tag)s on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:79 +#, python-format +msgid "Read article about kind %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:70 -msgid "on Wikipedia" +#: templates/catalogue/tagged_object_list.html:81 +#, python-format +msgid "Read article about genre %(last_tag)s on Wikipedia" msgstr "" -#: templates/catalogue/tagged_object_list.html:80 +#: templates/catalogue/tagged_object_list.html:83 +msgid "Read related article on Wikipedia" +msgstr "" + +#: templates/catalogue/tagged_object_list.html:93 msgid "Delete" msgstr "" -#: templates/catalogue/tagged_object_list.html:88 +#: templates/catalogue/tagged_object_list.html:101 msgid "This author's works are copyrighted." msgstr "" -#: templates/catalogue/tagged_object_list.html:91 +#: templates/catalogue/tagged_object_list.html:104 msgid "" "This author's works are in public domain and will be published on Internet " "school library of Wolne Lektury soon." msgstr "" -#: templates/catalogue/tagged_object_list.html:95 +#: templates/catalogue/tagged_object_list.html:108 msgid "" "This author's works will become part of public domain and will be allowed to " "be published without restrictions in" msgstr "" -#: templates/catalogue/tagged_object_list.html:97 +#: templates/catalogue/tagged_object_list.html:110 msgid "Find out why Internet libraries can't publish this author's works." msgstr "" @@ -745,11 +771,10 @@ msgid "return to the main page" msgstr "" #: templates/info/join_us.html:2 -#, python-format msgid "" "We have over 1000 works published in Wolne Lektury!\n" "Help us expand the library and set new readings free by\n" -"making a donation or transferring 1%% of your income tax." +"making a donation or transferring 1% of your income tax." msgstr "" #: templates/info/join_us.html:5 templates/info/join_us.html.py:10 diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index 66f2f6ce3..0237281e7 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -159,7 +159,7 @@ COMPRESS_JS = { 'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js', 'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js', - 'js/jquery.cookie.js',), + ), 'output_filename': 'js/all?.min.js', }, 'book': { @@ -186,6 +186,9 @@ THUMBNAIL_PROCESSORS = ( TRANSLATION_REGISTRY = "wolnelektury.translation" +# limit number of filtering tags +MAX_TAG_LIST = 6 + # Load localsettings, if they exist try: from localsettings import * diff --git a/wolnelektury/static/css/master.css b/wolnelektury/static/css/master.css index c75c38133..0c9128d70 100644 --- a/wolnelektury/static/css/master.css +++ b/wolnelektury/static/css/master.css @@ -352,6 +352,7 @@ div.shown-tags p, div.all-tags p { #description { margin-top: 0.5em; text-align: justify; + overflow: hidden; } #description .meta { diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js index c038e2421..a76215aa5 100644 --- a/wolnelektury/static/js/catalogue.js +++ b/wolnelektury/static/js/catalogue.js @@ -316,12 +316,10 @@ function serverTime() { function() { $(this).css({background: '#EEE'}); } ).click(function() { if ($('#description').hasClass('hidden')) { - $('#description').slideDown('fast').removeClass('hidden'); - $.cookie('description-state', 'opened', {path: '/', expires: 30}); + $('#description').animate({"height": $('#description').attr("box_h")+'px'}, {duration: "fast" }).removeClass('hidden'); $('p', this).html(LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▲'); } else { - $('#description').slideUp('fast').addClass('hidden'); - $.cookie('description-state', 'closed', {path: '/', expires: 30}); + $('#description').animate({"height": '4em'}, {duration: "fast" }).addClass('hidden'); $('p', this).html(LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_DESCRIPTION'] + ' ▼'); } }); @@ -364,10 +362,9 @@ function serverTime() { }); }); - if ($.cookie('description-state') == 'closed') { - $('#description').hide().addClass('hidden'); - $('#toggle-description p').html(LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_DESCRIPTION']+' ▼'); - } + $('#description').attr("box_h", $('#description').height()); + $('#description').css("height", '4em').addClass('hidden'); + $('#toggle-description p').html(LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_DESCRIPTION']+' ▼'); $('#share-shelf').hide().addClass('hidden'); $('#share-shelf input').focus(function(){this.select();}); diff --git a/wolnelektury/static/js/jquery.cookie.js b/wolnelektury/static/js/jquery.cookie.js deleted file mode 100644 index 6df1faca2..000000000 --- a/wolnelektury/static/js/jquery.cookie.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Cookie plugin - * - * Copyright (c) 2006 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * Create a cookie with the given name and value and other optional parameters. - * - * @example $.cookie('the_cookie', 'the_value'); - * @desc Set the value of a cookie. - * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); - * @desc Create a cookie with all available options. - * @example $.cookie('the_cookie', 'the_value'); - * @desc Create a session cookie. - * @example $.cookie('the_cookie', null); - * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain - * used when the cookie was set. - * - * @param String name The name of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. - * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. - * If set to null or omitted, the cookie will be a session cookie and will not be retained - * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will - * require a secure protocol (like HTTPS). - * @type undefined - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ - -/** - * Get the value of a cookie with the given name. - * - * @example $.cookie('the_cookie'); - * @desc Get the value of a cookie. - * - * @param String name The name of the cookie. - * @return The value of the cookie. - * @type String - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -}; \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index e85f1938e..7963fe6a9 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -33,6 +33,9 @@ {% if book.pdf_file %} {% trans "Download PDF" %} {% endif %} + {% if book.epub_file %} + {% trans "Download EPUB" %} + {% endif %} {% if book.odt_file %} {% trans "Download ODT" %} {% endif %} diff --git a/wolnelektury/templates/catalogue/differentiate_tags.html b/wolnelektury/templates/catalogue/differentiate_tags.html new file mode 100644 index 000000000..51b382164 --- /dev/null +++ b/wolnelektury/templates/catalogue/differentiate_tags.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} +{% load i18n %} +{% load catalogue_tags %} + +{% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} + +{% block bodyid %}differentiate_tags{% endblock %} + +{% block body %} +

{% title_from_tags tags %}

+ {% breadcrumbs tags %} + +

{% trans "The criteria are ambiguous. Please select one of the following options:" %}

+ + +
+ +
+

* {% trans "Loading" %}

+
+
+{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index fd6517c49..07fda03ad 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load i18n %} -{% load catalogue_tags pagination_tags %} +{% load catalogue_tags pagination_tags switch_tag %} {% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} @@ -34,6 +34,7 @@

{% trans "Choose books' formats which you want to download:" %}

  • {% trans "for reading" %} {% trans "and printing using" %} Adobe Reader
  • +
  • {% trans "for reading" %} {% trans "and editing using" %} OpenOffice.org
  • {% trans "for reading" %} {% trans "on small displays, for example mobile phones" %}
  • {% trans "for listening" %} {% trans "on favourite MP3 player" %}
  • @@ -53,22 +54,34 @@ {% endif %} {% if last_tag.gazeta_link %}

    - {% ifequal last_tag.category "author" %} - {% trans "Read work's study of this author on Lektury.Gazeta.pl" %} - {% endifequal %} - {% ifequal last_tag.category "epoch" %} - {% trans "Read study of epoch" %} {{ last_tag }} {% trans "on Lektury.Gazeta.pl" %} - {% endifequal %} + {% switch last_tag.category %} + {% case "author" %} + {% trans "Read work's study of this author on Lektury.Gazeta.pl" %} + {% case "epoch" %} + {% blocktrans %}Read study of epoch {{ last_tag }} on Lektury.Gazeta.pl{% endblocktrans %} + {% case "kind" %} + {% blocktrans %}Read study of kind {{ last_tag }} on Lektury.Gazeta.pl{% endblocktrans %} + {% case "genre" %} + {% blocktrans %}Read study of genre {{ last_tag }} on Lektury.Gazeta.pl{% endblocktrans %} + {% else %} + {% trans "Read related study on Lektury.Gazeta.pl" %} + {% endswitch %}

    {% endif %} {% if last_tag.wiki_link %}

    - {% ifequal last_tag.category "author" %} - {% trans "Read article about this author on Wikipedia" %} - {% endifequal %} - {% ifequal last_tag.category "epoch" %} - {% trans "Read article about epoch" %} {{ last_tag }} {% trans "on Wikipedia" %} - {% endifequal %} + {% switch last_tag.category %} + {% case "author" %} + {% trans "Read article about this author on Wikipedia" %} + {% case "epoch" %} + {% blocktrans %}Read article about epoch {{ last_tag }} on Wikipedia{% endblocktrans %} + {% case "kind" %} + {% blocktrans %}Read article about kind {{ last_tag }} on Wikipedia{% endblocktrans %} + {% case "genre" %} + {% blocktrans %}Read article about genre {{ last_tag }} on Wikipedia{% endblocktrans %} + {% else %} + {% trans "Read related article on Wikipedia" %} + {% endswitch %}

    {% endif %} diff --git a/wolnelektury/templates/info/join_us.html b/wolnelektury/templates/info/join_us.html index b38a56694..fd4ea7d24 100644 --- a/wolnelektury/templates/info/join_us.html +++ b/wolnelektury/templates/info/join_us.html @@ -1,7 +1,7 @@ {% load i18n %}

    {% blocktrans %}We have over 1000 works published in Wolne Lektury! Help us expand the library and set new readings free by -making a donation or transferring 1%% of your income tax.{% endblocktrans %} +making a donation or transferring 1% of your income tax.{% endblocktrans %} {% comment %}{% trans "More..." %}{% endcomment %}

    {% blocktrans %}Become an editor of Wolne Lektury! Find out if