From: Radek Czajka Date: Tue, 19 Nov 2013 13:12:55 +0000 (+0100) Subject: Merge branch 'minimal-double-reader' into rwd X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/68dbe44bdbc497a82064c6a47eeaecbb34463f64?hp=ca9f237a37a38af28136307a5e372c40265907b6 Merge branch 'minimal-double-reader' into rwd --- diff --git a/.gitignore b/.gitignore index 6714e2301..cceada847 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ dev.sqlite # Compress output /static +# SCSS output +apps/wolnelektury_core/static/scss/*.css + # Python garbage *.pyc .coverage diff --git a/apps/api/handlers.py b/apps/api/handlers.py index da5c0ed27..b436024b1 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -18,6 +18,7 @@ from api.helpers import timestamp from api.models import Deleted from catalogue.forms import BookImportForm from catalogue.models import Book, Tag, BookMedia, Fragment, Collection +from catalogue.utils import related_tag_name from picture.models import Picture from picture.forms import PictureImportForm @@ -244,7 +245,7 @@ def _tags_getter(category): def _tag_getter(category): @classmethod def get_tag(cls, book): - return ", ".join(t[0] for t in book.related_info()['tags'].get(category, [])) + return ", ".join(related_tag_name(t) for t in book.related_info()['tags'].get(category, [])) return get_tag for plural, singular in category_singular.items(): setattr(BookDetails, plural, _tags_getter(singular)) diff --git a/apps/catalogue/constants.py b/apps/catalogue/constants.py index bfad4b075..36f4f5dd3 100644 --- a/apps/catalogue/constants.py +++ b/apps/catalogue/constants.py @@ -21,3 +21,18 @@ EBOOK_FORMATS_WITH_CHILDREN = ['pdf', 'epub', 'mobi'] EBOOK_FORMATS_WITH_COVERS = ['pdf', 'epub', 'mobi'] EBOOK_FORMATS = EBOOK_FORMATS_WITHOUT_CHILDREN + EBOOK_FORMATS_WITH_CHILDREN + +LANGUAGES_3TO2 = { + 'deu': 'de', + 'ger': 'de', + 'eng': 'en', + 'spa': 'es', + 'fra': 'fr', + 'fre': 'fr', + 'ita': 'it', + 'jpn': 'jp', + 'lit': 'lt', + 'pol': 'pl', + 'rus': 'ru', + 'ukr': 'uk', +} diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index bb9f26efe..e2978e877 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -7,6 +7,7 @@ from django.core.files import File from django.db import models from django.db.models.fields.files import FieldFile from catalogue import app_settings +from catalogue.constants import LANGUAGES_3TO2 from catalogue.utils import remove_zip, truncate_html_words from celery.task import Task, task from waiter.utils import clear_cache @@ -140,6 +141,11 @@ class BuildHtml(BuildEbook): html_output = self.transform( book.wldocument(parse_dublincore=False), fieldfile) + lang = book.language + lang = LANGUAGES_3TO2.get(lang, lang) + if lang not in [ln[0] for ln in settings.LANGUAGES]: + lang = None + if html_output: fieldfile.save(None, ContentFile(html_output.get_string()), save=False) @@ -167,14 +173,26 @@ class BuildHtml(BuildEbook): for theme_name in theme_names: if not theme_name: continue - tag, created = Tag.objects.get_or_create( - slug=slughifi(theme_name), - category='theme') - if created: - tag.name = theme_name - tag.sort_key = sortify(theme_name.lower()) - tag.save() - themes.append(tag) + if lang == settings.LANGUAGE_CODE: + # Allow creating themes if book in default language. + tag, created = Tag.objects.get_or_create( + slug=slughifi(theme_name), + category='theme') + if created: + tag.name = theme_name + setattr(tag, "name_%s" % lang, theme_name) + tag.sort_key = sortify(theme_name.lower()) + tag.save() + themes.append(tag) + elif lang is not None: + # Don't create unknown themes in non-default languages. + try: + tag = Tag.objects.get(category='theme', + **{"name_%s" % lang: theme_name}) + except Tag.DoesNotExist: + pass + else: + themes.append(tag) if not themes: continue diff --git a/apps/catalogue/migrations/0007_auto__add_field_tag_name_de__add_field_tag_name_en__add_field_tag_name.py b/apps/catalogue/migrations/0007_auto__add_field_tag_name_de__add_field_tag_name_en__add_field_tag_name.py new file mode 100644 index 000000000..641095791 --- /dev/null +++ b/apps/catalogue/migrations/0007_auto__add_field_tag_name_de__add_field_tag_name_en__add_field_tag_name.py @@ -0,0 +1,289 @@ +# -*- coding: 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): + # Adding field 'Tag.name_de' + db.add_column(u'catalogue_tag', 'name_de', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_en' + db.add_column(u'catalogue_tag', 'name_en', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_es' + db.add_column(u'catalogue_tag', 'name_es', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_fr' + db.add_column(u'catalogue_tag', 'name_fr', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_it' + db.add_column(u'catalogue_tag', 'name_it', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_lt' + db.add_column(u'catalogue_tag', 'name_lt', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_pl' + db.add_column(u'catalogue_tag', 'name_pl', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_ru' + db.add_column(u'catalogue_tag', 'name_ru', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.name_uk' + db.add_column(u'catalogue_tag', 'name_uk', + self.gf('django.db.models.fields.CharField')(blank=True, max_length=50, null=True, db_index=True), + keep_default=False) + + # Adding field 'Tag.description_de' + db.add_column(u'catalogue_tag', 'description_de', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_en' + db.add_column(u'catalogue_tag', 'description_en', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_es' + db.add_column(u'catalogue_tag', 'description_es', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_fr' + db.add_column(u'catalogue_tag', 'description_fr', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_it' + db.add_column(u'catalogue_tag', 'description_it', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_lt' + db.add_column(u'catalogue_tag', 'description_lt', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_pl' + db.add_column(u'catalogue_tag', 'description_pl', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_ru' + db.add_column(u'catalogue_tag', 'description_ru', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + # Adding field 'Tag.description_uk' + db.add_column(u'catalogue_tag', 'description_uk', + self.gf('django.db.models.fields.TextField')(null=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Tag.name_de' + db.delete_column(u'catalogue_tag', 'name_de') + + # Deleting field 'Tag.name_en' + db.delete_column(u'catalogue_tag', 'name_en') + + # Deleting field 'Tag.name_es' + db.delete_column(u'catalogue_tag', 'name_es') + + # Deleting field 'Tag.name_fr' + db.delete_column(u'catalogue_tag', 'name_fr') + + # Deleting field 'Tag.name_it' + db.delete_column(u'catalogue_tag', 'name_it') + + # Deleting field 'Tag.name_lt' + db.delete_column(u'catalogue_tag', 'name_lt') + + # Deleting field 'Tag.name_pl' + db.delete_column(u'catalogue_tag', 'name_pl') + + # Deleting field 'Tag.name_ru' + db.delete_column(u'catalogue_tag', 'name_ru') + + # Deleting field 'Tag.name_uk' + db.delete_column(u'catalogue_tag', 'name_uk') + + # Deleting field 'Tag.description_de' + db.delete_column(u'catalogue_tag', 'description_de') + + # Deleting field 'Tag.description_en' + db.delete_column(u'catalogue_tag', 'description_en') + + # Deleting field 'Tag.description_es' + db.delete_column(u'catalogue_tag', 'description_es') + + # Deleting field 'Tag.description_fr' + db.delete_column(u'catalogue_tag', 'description_fr') + + # Deleting field 'Tag.description_it' + db.delete_column(u'catalogue_tag', 'description_it') + + # Deleting field 'Tag.description_lt' + db.delete_column(u'catalogue_tag', 'description_lt') + + # Deleting field 'Tag.description_pl' + db.delete_column(u'catalogue_tag', 'description_pl') + + # Deleting field 'Tag.description_ru' + db.delete_column(u'catalogue_tag', 'description_ru') + + # Deleting field 'Tag.description_uk' + db.delete_column(u'catalogue_tag', 'description_uk') + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + '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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, + '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), + 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), + 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", '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': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'}) + }, + 'catalogue.bookmedia': { + 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), + 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'db_index': 'True'}), + 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) + }, + 'catalogue.collection': { + 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, + 'book_slugs': ('django.db.models.fields.TextField', [], {}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) + }, + 'catalogue.fragment': { + 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + u'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': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, + 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'description_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_it': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'name_de': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_en': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_es': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_fr': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_it': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_lt': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_pl': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_ru': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_uk': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"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': "u'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'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']"}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'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'] \ No newline at end of file diff --git a/apps/catalogue/migrations/0008_clear_related.py b/apps/catalogue/migrations/0008_clear_related.py new file mode 100644 index 000000000..3a9892d8e --- /dev/null +++ b/apps/catalogue/migrations/0008_clear_related.py @@ -0,0 +1,155 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import DataMigration +from django.db import models +from django.conf import settings + +class Migration(DataMigration): + + def forwards(self, orm): + "Write your forwards methods here." + # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..." + for t in orm.Tag.objects.filter(category__in=('author', 'epoch', 'genre', 'kind', 'theme')): + setattr(t, "name_%s" % settings.LANGUAGE_CODE, t.name) + t.save() + orm.Book.objects.all().update(_related_info=None) + + def backwards(self, orm): + "Write your backwards methods here." + orm.Book.objects.all().update(_related_info=None) + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'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': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + '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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'catalogue.book': { + 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, + '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), + 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), + 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", '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': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}), + 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'}) + }, + 'catalogue.bookmedia': { + 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), + 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'db_index': 'True'}), + 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}) + }, + 'catalogue.collection': { + 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, + 'book_slugs': ('django.db.models.fields.TextField', [], {}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) + }, + 'catalogue.fragment': { + 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, + 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), + u'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': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, + 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'description_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_it': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'description_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), + 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'name_de': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_en': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_es': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_fr': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_it': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_lt': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_pl': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_ru': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'name_uk': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"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': "u'catalogue_tag_relation'"}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'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']"}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'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'] + symmetrical = True diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 9025e3e5b..3cab67632 100644 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -3,7 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # import re -from django.conf import settings as settings +from django.conf import settings from django.core.cache import get_cache from django.db import models from django.db.models import permalink @@ -14,7 +14,7 @@ import jsonfield from catalogue import constants from catalogue.fields import EbookField from catalogue.models import Tag, Fragment, BookMedia -from catalogue.utils import create_zip, split_tags, book_upload_path +from catalogue.utils import create_zip, split_tags, book_upload_path, related_tag_name from catalogue import app_settings from catalogue import tasks from newtagging import managers @@ -36,7 +36,7 @@ class Book(models.Model): created_at = models.DateTimeField(_('creation date'), auto_now_add=True, db_index=True) changed_at = models.DateTimeField(_('creation date'), auto_now=True, db_index=True) parent_number = models.IntegerField(_('parent number'), default=0) - extra_info = jsonfield.JSONField(_('extra information'), default='{}') + extra_info = jsonfield.JSONField(_('extra information'), default={}) gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) # files generated during publication @@ -406,8 +406,15 @@ class Book(models.Model): 'author', 'kind', 'genre', 'epoch')) tags = split_tags(tags) for category in tags: - rel['tags'][category] = [ - (t.name, t.slug) for t in tags[category]] + cat = [] + for tag in tags[category]: + tag_info = {'slug': tag.slug} + for lc, ln in settings.LANGUAGES: + tag_name = getattr(tag, "name_%s" % lc) + if tag_name: + tag_info["name_%s" % lc] = tag_name + cat.append(tag_info) + rel['tags'][category] = cat for media_format in BookMedia.formats: rel['media'][media_format] = self.has_media(media_format) @@ -491,8 +498,8 @@ class Book(models.Model): def pretty_title(self, html_links=False): book = self rel_info = book.related_info() - names = [(name, Tag.create_url('author', slug)) - for name, slug in rel_info['tags']['author']] + names = [(related_tag_name(tag), Tag.create_url('author', tag['slug'])) + for tag in rel_info['tags'].get('author', ())] if 'parents' in rel_info: books = [(name, Book.create_url(slug)) for name, slug in rel_info['parents']] diff --git a/apps/catalogue/models/bookmedia.py b/apps/catalogue/models/bookmedia.py index 88f60f16a..186bb405c 100644 --- a/apps/catalogue/models/bookmedia.py +++ b/apps/catalogue/models/bookmedia.py @@ -27,7 +27,7 @@ class BookMedia(models.Model): name = models.CharField(_('name'), max_length="100") file = OverwritingFileField(_('file'), upload_to=book_upload_path()) uploaded_at = models.DateTimeField(_('creation date'), auto_now_add=True, editable=False, db_index=True) - extra_info = jsonfield.JSONField(_('extra information'), default='{}', editable=False) + extra_info = jsonfield.JSONField(_('extra information'), default={}, editable=False) book = models.ForeignKey('Book', related_name='media') source_sha1 = models.CharField(null=True, blank=True, max_length=40, editable=False) diff --git a/apps/catalogue/models/listeners.py b/apps/catalogue/models/listeners.py index 373a2fcc8..5ef7e9efd 100644 --- a/apps/catalogue/models/listeners.py +++ b/apps/catalogue/models/listeners.py @@ -8,6 +8,7 @@ from django.db.models.signals import post_save, pre_delete, post_delete import django.dispatch from catalogue.models import Tag, BookMedia, Book, Fragment, Collection from catalogue import tasks +from catalogue.utils import delete_from_cache_by_language from newtagging.models import tags_updated @@ -43,8 +44,8 @@ pre_delete.connect(_pre_delete_handler) def _post_delete_handler(sender, instance, **kwargs): """ refresh Book on BookMedia delete """ if sender == Collection: - permanent_cache.delete('catalogue.collection:%s' % instance.slug) - permanent_cache.delete('catalogue.catalogue') + delete_from_cache_by_language(permanent_cache, 'catalogue.collection:%s/%%s' % instance.slug) + delete_from_cache_by_language(permanent_cache, 'catalogue.catalogue/%s') post_delete.connect(_post_delete_handler) @@ -52,17 +53,17 @@ def _post_save_handler(sender, instance, **kwargs): """ refresh all the short_html stuff on BookMedia update """ if sender == BookMedia: instance.book.save() - permanent_cache.delete_many([ - 'catalogue.audiobook_list', 'catalogue.daisy_list']) + delete_from_cache_by_language(permanent_cache, 'catalogue.audiobook_list/%s') + delete_from_cache_by_language(permanent_cache, 'catalogue.daisy_list/%s') elif sender == Collection: - permanent_cache.delete('catalogue.collection:%s' % instance.slug) - permanent_cache.delete('catalogue.catalogue') + delete_from_cache_by_language(permanent_cache, 'catalogue.collection:%s/%%s' % instance.slug) + delete_from_cache_by_language(permanent_cache, 'catalogue.catalogue/%s') post_save.connect(_post_save_handler) def post_publish(sender, **kwargs): - permanent_cache.delete('catalogue.book_list') - permanent_cache.delete('catalogue.catalogue') + delete_from_cache_by_language(permanent_cache, 'catalogue.book_list/%s') + delete_from_cache_by_language(permanent_cache, 'catalogue.catalogue/%s') Book.published.connect(post_publish) diff --git a/apps/catalogue/models/tag.py b/apps/catalogue/models/tag.py index b0c75fbb4..1309cbbd2 100644 --- a/apps/catalogue/models/tag.py +++ b/apps/catalogue/models/tag.py @@ -2,6 +2,7 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models @@ -166,14 +167,26 @@ class Tag(TagBase): # For instance, Pictures do not have 'genre' field. continue for tag_name in tag_names: + lang = getattr(tag_name, 'lang', settings.LANGUAGE_CODE) tag_sort_key = tag_name if category == 'author': tag_sort_key = tag_name.last_name tag_name = tag_name.readable() - tag, created = Tag.objects.get_or_create(slug=slughifi(tag_name), category=category) - if created: - tag.name = tag_name - tag.sort_key = sortify(tag_sort_key.lower()) - tag.save() - meta_tags.append(tag) + if lang == settings.LANGUAGE_CODE: + # Allow creating new tag, if it's in default language. + tag, created = Tag.objects.get_or_create(slug=slughifi(tag_name), category=category) + if created: + tag.name = tag_name + setattr(tag, "name_%s" % lang, tag_name) + tag.sort_key = sortify(tag_sort_key.lower()) + tag.save() + meta_tags.append(tag) + else: + # Ignore unknown tags in non-default languages. + try: + tag = Tag.objects.get(category=category, **{"name_%s" % lang: tag_name}) + except Tag.DoesNotExist: + pass + else: + meta_tags.append(tag) return meta_tags diff --git a/apps/catalogue/templates/catalogue/book_detail.html b/apps/catalogue/templates/catalogue/book_detail.html index 4c14158ef..480c85a28 100644 --- a/apps/catalogue/templates/catalogue/book_detail.html +++ b/apps/catalogue/templates/catalogue/book_detail.html @@ -1,7 +1,7 @@ {% extends "base.html" %} -{% load cache i18n %} +{% load i18n %} {% load thumbnail %} -{% load common_tags catalogue_tags pagination_tags %} +{% load common_tags catalogue_tags %} {% block titleextra %}{{ book.pretty_title }}{% endblock %} {% block ogimage %}{% if book.cover %}{{ book.cover.url|build_absolute_uri:request }}{% endif %}{% endblock %} @@ -17,7 +17,9 @@ {% work_list book_children %} -

{% trans "See also" %}:

+
+

{% trans "See also" %}:

{% related_books book %} +
{% endblock %} diff --git a/apps/catalogue/templates/catalogue/book_list.html b/apps/catalogue/templates/catalogue/book_list.html index ddeb3ce3f..00088a58e 100644 --- a/apps/catalogue/templates/catalogue/book_list.html +++ b/apps/catalogue/templates/catalogue/book_list.html @@ -17,16 +17,16 @@ -
- {% trans "Table of Content" %} - {{ rendered_nav }} +
+

{% trans "Table of Content" %}

+
+ {{ rendered_nav }} +
-
+
{% block book_list %} {{ rendered_book_list }} {% endblock %}
- + {% trans "↑ top ↑" %} {% endblock %} diff --git a/apps/catalogue/templates/catalogue/book_short.html b/apps/catalogue/templates/catalogue/book_short.html index 73e5cb8fb..4acefe285 100644 --- a/apps/catalogue/templates/catalogue/book_short.html +++ b/apps/catalogue/templates/catalogue/book_short.html @@ -2,23 +2,10 @@ {% load catalogue_tags social_tags %} {% load thumbnail %}
-
+
+
-
- {% if book.cover %} - {% if main_link %}{% endif %} - Cover - {% if main_link %}{% endif %} - {% endif %} - {% block cover-area-extra %}{% endblock %} -
@@ -40,9 +27,9 @@
-
- {% for name, slug in related.tags.author %} - {{ name }}{% if not forloop.last %}, +
+ {% for tag in related.tags.author %} + {% related_tag_name tag %}{% if not forloop.last %}, {% endif %}{% endfor %}{% for title, slug in related.parents %}, {{ title }}{% endfor %}
@@ -53,29 +40,46 @@
+
+ {% if book.cover %} + {% if main_link %}{% endif %} + Cover + {% if main_link %}{% endif %} + {% endif %} + {% block cover-area-extra %}{% endblock %} +
{% spaceless %} + {% trans "Epoch" %}:  - {% for name, slug in related.tags.epoch %} - {{ name }} - {% if not forloop.last %}{% endif %} + {% for tag in related.tags.epoch %} + {% related_tag_name tag %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + + {% trans "Kind" %}:  - {% for name, slug in related.tags.kind %} - {{ name }} - {% if not forloop.last %}{% endif %} + {% for tag in related.tags.kind %} + {% related_tag_name tag %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + + {% trans "Genre" %}:  - {% for name, slug in related.tags.genre %} - {{ name }} - {% if not forloop.last %}{% endif %} + {% for tag in related.tags.genre %} + {% related_tag_name tag %} + {% if not forloop.last %}, {% endif %} {% endfor %} - + {% endspaceless %}
@@ -85,12 +89,12 @@ {% block book-box-extra-info %}{% endblock %} {% block box-append %} {% endblock %} +
{% block right-column %} {% endblock %}
diff --git a/apps/catalogue/templates/catalogue/book_text_new.html b/apps/catalogue/templates/catalogue/book_text_new.html new file mode 100644 index 000000000..a993656a1 --- /dev/null +++ b/apps/catalogue/templates/catalogue/book_text_new.html @@ -0,0 +1,115 @@ + +{% load i18n %} +{% load static from staticfiles %} +{% load chunks compressed catalogue_tags %} +{% load thumbnail %} + + + + + {{ book.pretty_title }} :: {% trans "Wolne Lektury" %} + + {% compressed_css "book_text" %} + + + + > + + +
+ +
+ {{ book.html_file.read|safe }} +
+ + + + + + + +
+ + + {% compressed_js "book_text" %} + + diff --git a/apps/catalogue/templates/catalogue/menu.html b/apps/catalogue/templates/catalogue/menu.html index 4fe776925..2da629d74 100644 --- a/apps/catalogue/templates/catalogue/menu.html +++ b/apps/catalogue/templates/catalogue/menu.html @@ -1,10 +1,14 @@ {% load i18n static %} + + {% trans "Catalogue of the library" %} + {% trans "Catalogue" %} + diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 6a30a9c26..d6a795fb4 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -14,7 +14,7 @@ from django.core.urlresolvers import reverse from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.utils.translation import ugettext as _ -from catalogue.utils import split_tags +from catalogue.utils import split_tags, related_tag_name as _related_tag_name from catalogue.models import Book, BookMedia, Fragment, Tag from catalogue.constants import LICENSES @@ -350,8 +350,8 @@ def book_short(context, book): @register.inclusion_tag('catalogue/book_mini_box.html') def book_mini(book): - author_str = ", ".join(name - for name, url in book.related_info()['tags']['author']) + author_str = ", ".join(related_tag_name(tag) + for tag in book.related_info()['tags'].get('author', ())) return { 'book': book, 'author_str': author_str, @@ -463,3 +463,8 @@ def license_icon(license_url): "icon": "img/licenses/%s.png" % known['icon'], "license_description": known['description'], } + + +@register.simple_tag +def related_tag_name(tag, lang=None): + return _related_tag_name(tag, lang) diff --git a/apps/catalogue/tests/tags.py b/apps/catalogue/tests/tags.py index 2608eb632..99edebbe7 100644 --- a/apps/catalogue/tests/tags.py +++ b/apps/catalogue/tests/tags.py @@ -225,7 +225,7 @@ class TestIdenticalTag(WLTestCase): related_info = book.related_info() related_themes = book.related_themes() for category in 'author', 'kind', 'genre', 'epoch': - self.assertTrue('tag' in [tag[1] for tag in related_info['tags'][category]], + self.assertTrue('tag' in [tag['slug'] for tag in related_info['tags'][category]], 'missing related tag for %s' % category) self.assertTrue('tag' in [tag.slug for tag in related_themes]) @@ -271,9 +271,9 @@ class BookTagsTests(WLTestCase): related_themes = book.related_themes() self.assertEqual(related_info['tags']['author'], - [('Common Man', 'common-man')]) + [{'name_pl': 'Common Man', 'slug': 'common-man'}]) self.assertEqual(related_info['tags']['kind'], - [('Kind', 'kind')]) + [{'name_pl': 'Kind', 'slug': 'kind'}]) self.assertEqual([(tag.name, tag.count) for tag in related_themes], [('ChildTheme', 1), ('ParentTheme', 1), ('Theme', 2)]) diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py index 43209198b..e9f638345 100644 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@ -57,6 +57,7 @@ urlpatterns += patterns('catalogue.views', # Public interface. Do not change this URLs. url(r'^lektura/(?P%s)\.html$' % SLUG, 'book_text', name='book_text'), + url(r'^lektura/(?P%s)\.html2$' % SLUG, 'book_text2'), url(r'^lektura/(?P%s)/audiobook/$' % SLUG, 'player', name='book_player'), url(r'^lektura/(?P%s)/$' % SLUG, 'book_detail', name='book_detail'), url(r'^lektura/(?P%s)/motyw/(?P[a-zA-Z0-9-]+)/$' % SLUG, diff --git a/apps/catalogue/utils.py b/apps/catalogue/utils.py index 5ae9db5f9..edc287f98 100644 --- a/apps/catalogue/utils.py +++ b/apps/catalogue/utils.py @@ -14,6 +14,7 @@ from django.http import HttpResponse from django.core.files.uploadedfile import UploadedFile from django.core.files.storage import DefaultStorage from django.utils.encoding import force_unicode +from django.utils.translation import get_language from django.conf import settings from os import mkdir, path, unlink from errno import EEXIST, ENOENT @@ -312,4 +313,12 @@ This can sometimes occupy lots of memory, so trim it here a bit. connection.queries = trim_to > 0 \ and connection.queries[-trim_to:] \ or [] - + + +def related_tag_name(tag_info, language=None): + return tag_info.get("name_%s" % (language or get_language()), + tag_info.get("name_%s" % settings.LANGUAGE_CODE, "")) + + +def delete_from_cache_by_language(cache, key_template): + cache.delete_many([key_template % lc for lc, ln in settings.LANGUAGES]) diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index e9b1465dd..b0575403b 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -17,7 +17,7 @@ from django.contrib.auth.decorators import login_required, user_passes_test from django.utils.datastructures import SortedDict from django.utils.http import urlquote_plus from django.utils import translation -from django.utils.translation import ugettext as _, ugettext_lazy +from django.utils.translation import get_language, ugettext as _, ugettext_lazy from django.views.decorators.vary import vary_on_headers from ajaxable.utils import JSONResponse, AjaxableFormView @@ -36,7 +36,7 @@ permanent_cache = get_cache('permanent') @vary_on_headers('X-Requested-With') def catalogue(request): - cache_key='catalogue.catalogue' + cache_key='catalogue.catalogue/' + get_language() output = permanent_cache.get(cache_key) if output is None: tags = models.Tag.objects.exclude( @@ -70,6 +70,7 @@ def book_list(request, filter=None, get_filter=None, context=None, ): """ generates a listing of all books, optionally filtered with a test function """ + cache_key = "%s/%s" % (cache_key, get_language()) cached = permanent_cache.get(cache_key) if cached is not None: rendered_nav, rendered_book_list = cached @@ -289,6 +290,14 @@ def book_text(request, slug): related = book.related_info() return render_to_response('catalogue/book_text.html', locals(), context_instance=RequestContext(request)) +def book_text2(request, slug): + book = get_object_or_404(models.Book, slug=slug) + + if not book.has_html_file(): + raise Http404 + related = book.related_info() + return render_to_response('catalogue/book_text_new.html', locals(), + context_instance=RequestContext(request)) # ========== diff --git a/apps/funding/models.py b/apps/funding/models.py index de52ac9d8..ba1494753 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -12,7 +12,7 @@ from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext, override import getpaid from catalogue.models import Book -from catalogue.utils import get_random_hash +from catalogue.utils import get_random_hash, related_tag_name from polls.models import Poll from django.contrib.sites.models import Site from . import app_settings @@ -175,7 +175,7 @@ class Offer(models.Model): 'funding/email/published.txt', { 'offer': self, 'book': self.book, - 'author': ", ".join(a[0] for a in self.book.related_info()['tags']['author']), + 'author': ", ".join(related_tag_name(a) for a in self.book.related_info()['tags']['author']), 'current': self.current(), }) diff --git a/apps/funding/static/funding/funding.css b/apps/funding/static/funding/funding.css deleted file mode 100755 index 89dd7aa79..000000000 --- a/apps/funding/static/funding/funding.css +++ /dev/null @@ -1 +0,0 @@ -.funding,.funding-top-header{background:orange;margin:auto;padding:5px 0;position:relative}.funding a.call,.funding-top-header a.call{height:1.2em;width:9em;padding:.35em .5em;margin:.5em;display:inline-block;vertical-align:top;text-align:center;background:rgb(.465%, 59.936%, 63.653%)}.funding .description,.funding-top-header .description{display:inline-block;padding-left:.6em}.funding .description a,.funding-top-header .description a{display:block;color:#000;padding:0 3px}.funding strong,.funding-top-header strong{font-size:1.5em;padding:.2em 0 0}.funding .progress,.funding-top-header .progress{width:95.7em;margin:.3em 0 .4em;border-radius:2em;background-image:url(/static/img/progress-pixel.png);background-repeat:repeat-y;background-color:#f68900;box-shadow:.1em .1em .1em #888}.funding .progress .piece,.funding-top-header .progress .piece{font-size:1.3em;padding:.3em .5em}.funding .with-button .progress,.funding-top-header .with-button .progress{width:78em}.funding .funding .funding-title-strong,.funding .funding-title,.funding-top-header .funding-title,.funding-top-header .funding-top-header .funding-title-strong{font-size:1.1em}.funding .funding-title-strong,.funding-top-header .funding-title-strong{font-weight:bold;font-size:1.5em}.funding .close,.funding-top-header .close{position:absolute;top:0;right:5px}.funding-top-header{width:97.5em}.wlfund{width:100%;border-spacing:0}.wlfund td{padding:1em .5em 1em;text-align:center;border-top:1em solid rgba(255, 255, 255, 0);border-bottom:2px solid #DDD;background-clip:padding-box;-moz-background-clip:padding;-webkit-background-clip:padding}.wlfund td.oneline{white-space:nowrap}.wlfund td:last-child{text-align:right}.wlfund .funding-plus td{background-color:#cfe5e7}.wlfund .funding-minus td{background-color:#fff}.honking{background:#018189;font-size:1.5em;padding:.5em;color:#fff;border:0;box-shadow:.2em .2em .3em #888;position:relative}.honking:hover{box-shadow:none;top:.1em;left:.1em}.share a{margin-right:1.5em}.share a img{vertical-align:middle}.funding-handle{position:absolute;top:0;right:0;z-index:2;background:orange;cursor:pointer;padding:.2em 1em;border-radius:0 0 0 1em;font-size:13px}.funding-cover{float:left;margin-right:10px}.funding-details-intro{padding-top:1em}.funding-details-intro h3:first-of-type{margin-top:0} \ No newline at end of file diff --git a/apps/funding/static/funding/funding.scss b/apps/funding/static/funding/funding.scss deleted file mode 100755 index 13c6ce062..000000000 --- a/apps/funding/static/funding/funding.scss +++ /dev/null @@ -1,152 +0,0 @@ -.funding { - background: orange; - margin: auto; - padding: 5px 0; - position: relative; - a.call { - height: 1.2em; - width: 9em; - padding: .35em .5em; - margin: .5em; - display: inline-block; - vertical-align: top; - text-align: center; - - background: lighten(#018189, .05); - } - .description { - display: inline-block; - padding-left: .6em; - a { - display: block; - color: black; - padding: 0 3px; - } - } - strong { - font-size: 1.5em; - padding: .2em 0 0; - //display: block; - } - .progress { - .piece { - font-size: 1.3em; - padding: .3em .5em; - } - width: 95.7em; - margin: .3em 0 .4em; - border-radius: 2em; - background-image: url(/static/img/progress-pixel.png); - background-repeat: repeat-y; - background-color: mix(#ec6d00, orange, .5); - box-shadow: .1em .1em .1em #888; - } - .with-button .progress { - width: 78em; - } - - .funding-title { - font-size: 1.1em; - } - .funding-title-strong { - @extend .funding-title; - font-weight: bold; - font-size: 1.5em; - } - .close { - position: absolute; - top: 0px; - right: 5px; - } -} - -.funding-top-header { - @extend .funding; - width: 97.5em; -} - - -.wlfund { - width: 100%; - border-spacing:0; - - td { - padding: 1em .5em 1em; - text-align: center; - border-top: 1em solid rgba(255, 255, 255, 0); - border-bottom: 2px solid #DDDDDD; - - background-clip: padding-box; - -moz-background-clip: padding; - -webkit-background-clip: padding; - } - td.oneline { - white-space: nowrap; - } - - td:last-child { - text-align: right; - } - - .funding-plus td { - background-color: mix(#0D7E85, white, .2); - } - - .funding-minus td { - background-color: white; - } -} - - - -.honking { - background: #018189; - font-size: 1.5em; - padding: .5em; - color: white; - border: 0; - box-shadow: 0.2em 0.2em 0.3em #888888; - position: relative; -} -.honking:hover { - box-shadow: none; - top: .1em; - left: .1em; -} - - - -.share { - a { - margin-right: 1.5em; - - img { - vertical-align: middle; - } - } -} - -.funding-handle { - position: absolute; - top: 0; - right: 0; - z-index:2; - background: orange; - cursor:pointer; - padding: .2em 1em; - border-radius: 0 0 0 1em; - font-size: 13px; -} - -.funding-cover { - float:left; - margin-right: 10px; -} - -.funding-details-intro { - padding-top: 1em; - - h3:first-of-type { - margin-top: 0; - } -} diff --git a/apps/funding/templates/funding/tags/funding.html b/apps/funding/templates/funding/tags/funding.html index ffe326e9c..a26c6ca61 100755 --- a/apps/funding/templates/funding/tags/funding.html +++ b/apps/funding/templates/funding/tags/funding.html @@ -5,16 +5,15 @@
{% if closeable %}X{% endif %} {% if link and is_current %} -
+
{% trans "Support!" %} - {% endif %} - diff --git a/apps/polls/static/polls/polls.css b/apps/polls/static/polls/polls.css deleted file mode 100644 index 0dd10fadf..000000000 --- a/apps/polls/static/polls/polls.css +++ /dev/null @@ -1 +0,0 @@ -.poll{width:400px}.poll ul{list-style-type:none}.poll-bar{border:solid 1px #ddd;height:6px;margin-bottom:10px}.poll-bar-inner{background:orange;height:6px}.poll-msg{font-weight:bold} \ No newline at end of file diff --git a/apps/polls/static/polls/polls.scss b/apps/polls/static/polls/polls.scss deleted file mode 100644 index 28cd5a5cf..000000000 --- a/apps/polls/static/polls/polls.scss +++ /dev/null @@ -1,21 +0,0 @@ -.poll { - width: 400px; - ul { - list-style-type: none; - } -} - -.poll-bar { - border: solid 1px #ddd; - height:6px; - margin-bottom: 10px; -} - -.poll-bar-inner { - background: orange; - height: 6px; -} - -.poll-msg { - font-weight: bold; -} \ No newline at end of file diff --git a/apps/sponsors/models.py b/apps/sponsors/models.py index 2d18d1664..cbc8d9ba4 100644 --- a/apps/sponsors/models.py +++ b/apps/sponsors/models.py @@ -35,7 +35,7 @@ class Sponsor(models.Model): class SponsorPage(models.Model): name = models.CharField(_('name'), max_length=120) - sponsors = JSONField(_('sponsors'), default='{}') + sponsors = JSONField(_('sponsors'), default={}) _html = models.TextField(blank=True, editable=False) sprite = models.ImageField(upload_to='sponsorzy/sprite', blank=True) diff --git a/apps/wolnelektury_core/static/css/antiscreen.css b/apps/wolnelektury_core/static/css/antiscreen.css deleted file mode 100644 index 5a8e34c59..000000000 --- a/apps/wolnelektury_core/static/css/antiscreen.css +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Style for handheld devices. Should cancel screen.css. - */ - -a { - display: inline-block; - padding: .5em; -} - -.left-column { - width: auto !important; - float: none !important; -} -.right-column { - float: none !important; - width: auto !important; -} - -.hidden-box ul { - width: 20em !important; - column-width: auto !important; - -moz-column-width: auto !important; - -webkit-column-width: auto !important; -} - -#header-content, div#main-content, div#half-header-content, #footer-content { - width: auto !important; - margin: 0 !important; -} - -#promo-box { - float: none !important; - margin-top: 0 !important; -} - -#promo-box-body { - height: auto !important; -} - -#big-cite .vip { - float: none !important; - text-align: left !important; - width: auto !important; -} - -#big-cite .cite-body { - margin-left: 0 !important; -} - -#big-cite .source { - margin-left: 0 !important; -} - - -.book-wide-box { - width: auto !important; -} -.book-wide-box .book-box-body { - width: auto !important; -} - - -#tagged-object-list .left-column, #tagged-object-list .right-column { - width: auto !important; -} - - - - -.inline-body { - width: auto !important; -} - - -.search-result { - width: auto !important; -} - - -.book-list-header { - width: auto !important; -} - -.book-wide-box .right-column { - width: auto !important; - margin-top: 0 !important; -} - -.book-wide-box #theme-list-wrapper { - margin-bottom: 0 !important; -} - -.snippets { - width: auto !important; - float: none !important; - margin-top: 0 !important; -} - - -/* HEADER */ - -#header { - height: auto !important; - padding-top: 0 !important; -} -#logo { - position: static !important; -} -#user-info { - float: none !important; - padding: 1em 0 !important; -} - -#tagline { - display: block !important; - margin-left: 0 !important; -} - -#search-area { - margin-left: 0 !important; - width: auto !important; -} - -#search-field { - width: auto !important; - padding-right: 0.5em !important; -} - -#search { - width: auto !important; -} - -#search-button { - float: none !important; -} - -#promo-box { - width: auto; -} - -/* Book list */ - -#book-list-nav { - border-left: none !important; - padding: 0 !important; - position: static !important; - right: 0 !important; - width: auto !important; -} diff --git a/apps/wolnelektury_core/static/css/auth.css b/apps/wolnelektury_core/static/css/auth.css deleted file mode 100644 index 2979d0d98..000000000 --- a/apps/wolnelektury_core/static/css/auth.css +++ /dev/null @@ -1,67 +0,0 @@ -#auth-page #main-content p { - font-size: 1.2em; -} -#auth-page #main-content h2 { - font-size: 2em; - margin-top: 1em; -} - -.uniForm { - font-size: 1.2em; -} -.uniForm fieldset { - border: none; - margin: .5em 0; -} -.uniForm .ctrlHolder { - margin: .5em 0; -} - -.inlineLabels label { - width: 8em; - display: inline-block; -} -.inlineLabels .buttonHolder, .inlineLabels .formHint { - margin-left: 8em; -} - - - -.email_list .verified { - display: inline-block; - margin-left: 2em; - font-style: italic; -} -.email_list .unverified { - display: inline-block; - margin-left: 2em; - color: #717171; - font-style: italic; -} -.email_list .primary { - display: inline-block; - margin-left: 2em; - font-weight: bold; -} -.socialaccount_provider { - display: inline-block; - background-repeat: no-repeat; - color: transparent; - height: 40px; - width: 40px; - vertical-align: middle; -} -.socialaccount_provider.google { - background-image: url(/static/img/auth/google.png); -} - - -.socialaccount_providers { - margin: 1em 0; - padding: 0; -} -.socialaccount_providers li { - display: inline; - list-style: none; - margin-right: 1em; -} \ No newline at end of file diff --git a/apps/wolnelektury_core/static/css/base.css b/apps/wolnelektury_core/static/css/base.css deleted file mode 100755 index 3496937ea..000000000 --- a/apps/wolnelektury_core/static/css/base.css +++ /dev/null @@ -1,184 +0,0 @@ -html { - margin: 0; - padding: 0; -} - -body { - margin: 0; - background: #f7f7f7; - font-size: .625em; - font-family: Georgia; - /*line-height: 1.4em;*/ -} - -a img { - border: 0; -} - -a { - color: #0d7e85; /*#1199a2;*/ /* #01adba; */ - text-decoration: none; -} - -/* jquery UI overrides us */ -.ui-menu .ui-menu-item a { - color: #0d7e85 !important; - line-height: 1.636em !important; -} - -.ui-widget { - font-family: Georgia !important; - font-size: 1em !important; -} - -.ui-widget-content { - background: #EEEEEE !important; /* #E2E2E2 ? */ - border-radius: 0px !important; -} - - -h1 { - font-size: 3.5em; - font-weight: normal; - margin-top: .4em -} -h1 a { - color: inherit; -} - -ul.plain { - list-style:none; - margin: 0; - padding: 0; -} - -.normal-text { - font-size: 1.3em; - line-height: 1.3em; -} - -h2 { - font-size: 2em; - font-weight: normal; -} - -h2.plain { - margin: 0; - font-size: 1em; -} - -h3 { - font-size: 1.5em; - font-weight: normal; -} - -.mono { - font-family: "Andale Mono", "Lucida Sans Typewriter", "Courier New"; -/* font-weight: bold; */ -} - -.accent1 { - color: #191919; -} - -.accent2 { - color: #242424; -} - -.accent3 { - color: #575c63; -} - - -.accent4 { - color: #707b7a; -} - -.contrast { - #1199a2; -} - -/* #281d1c */ - -.clearboth { - clear: both; -} - -.white-box { - border: 1px solid #ddd; - padding: 1em; - background: #fff; - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; -} - -.page-desc { - margin-left: 1.5em; -} - -.inline-tag-lists p span:first-child { - color: #281d1c; -} - -.inline-tag-lists { - font-size: 1.1em; -} - -.theme-list-link:after { - padding-left: 1em; - content: url("/static/img/arrow-teal.png"); - vertical-align: middle; -} -.theme-list-link { - font-size: 1.1em; -} -.hidden-box-wrapper { - position: relative; -} -.hidden-box { - position: absolute; - left: 0; - display: none; - border: 1px solid #ddd; - padding: 1em 1em .5em 1em; - background: #fff; - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; - z-index: 500; -} -.hidden-box ul { - list-style: none; - padding: 0; - margin: 0; - font-size: 1.1em; -} -.hidden-box li { - margin-bottom: .5em; -} - - -.pagination { - display: block; - font-size: 1.2em; - padding: .5em; - text-align:center; -} - -#footer { - color: #767676; - margin-top: 5em; - padding-top:3em; - background: #fff; - border-top: 1px solid #ddd; -} -#footer p { - margin: .25em 0; -} - -/* just on search page */ -.top-tag-list { - margin-top: 2.2em; - margin-bottom: 1.6em; -} diff --git a/apps/wolnelektury_core/static/css/book_box.css b/apps/wolnelektury_core/static/css/book_box.css deleted file mode 100755 index 190ddd773..000000000 --- a/apps/wolnelektury_core/static/css/book_box.css +++ /dev/null @@ -1,345 +0,0 @@ -.book-mini-box, .Book-item { - display: inline-block; - vertical-align: top; -} - -.book-wide-box, .book-box { - margin: 0; - vertical-align: top; -} - -.book-box { - width: 48.75em; -} - -.book-mini-box { - width: 16.15em; -} - -.book-wide-box { - /** This is a fullpage box, it must be aligned with the top menu. - This corresponds to a .1em margin below **/ - margin-left: -0.1em; -} - -/* - * A mini-box wraps it's contents (image + label) in an - * other boxes have an inner box as a wrapper. - */ - -.book-box-inner { - /* min, so it can grow */ - min-height: 19.75em; - margin: .5em; -} - -.book-mini-box a, .book-box-inner { - display: block; - color: black; - border: 1px solid #ddd; -/* height: 20em; */ - padding: .8em 1em; - margin: .1em; - background: #fff; - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; -} - -.book-mini-box a { - height: 27.1em; - margin: .1em; - overflow: hidden; -} - - -.book-wide-box .book-box-inner { - /* min, so it can grow */ - min-height: 24.4em; -} - -.search-result .book-box-body { - width: 31em; -} - -.book-list-header { - padding: 0em; - margin-left: -0.1em; -} - -.book-list-header .book-box-inner { - min-height: 1em; -} - -.book-list-header p { - font-size: 2.4em; - margin: 0.5em; -} - - -/* - * ingenous float containment hack - * http://www.mikepadgett.com/technology/technical/alternative-to-the-pie-clearfix-hack/ - */ -/* -.search-result .book-box-inner { - height: 1%; - overflow: hidden; -} -*/ - -.book-mini-box img.cover, -.book-box img.cover, -.book-wide-box img.cover, -.search-result img.cover { - width: 13.9em; - height: 19.3em; -} -.book-mini-box img.cover { - margin-bottom: 1.8em; -} -.book-box-inner .cover-area, -.book-wide-box .cover-area -{ - float: left; - margin-right: 1.5em; -} - -.book-mini-box .desc { - margin-left:0em; -} -.book-mini-box .author { - font-size: 1.1em; - color: #6d7877; - display: block; - overflow:hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.book-mini-box .title { - font-size: 1.4em; - color: #242424; -} - - -.book-box-body { - height: 17em; - overflow:hidden; - position: relative; -} - -.book-wide-box .book-box-body { - min-height: 17em; -} - -.book-box-head { - min-height: 7em; - padding-top: 1.4em; - margin-bottom: 1em; -} -.book-box-head a { - color: black; -} -.book-box-head .author { - font-size: 1.1em; - max-width: 24em; -} -.book-box-head .title { - font-size: 2.4em; - height: 2.4em; - overflow:hidden; - margin-top: .3em; -} -.book-box-body .tags { - font-size: 1.1em; -} -.book-box-tag { - margin-right: .5em; - margin-left: .4em; -} -.book-box-download { - position: relative; -} - -.book-box-download a { - position: relative; - z-index: 101; -} - -.book-box-formats { - display: none; - position: absolute; - - width: 16.363em; - border: 1px solid #ddd; - padding: 3.454em 1.727em .818em 1.727em; - background: #fff; - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; - - z-index: 100; - top: -1.454em; - left: -1.727em; -} -.book-box-formats span { - display: block; -} - -.book-box-download .book-box-formats span:first-child { - margin-top: 1.454em; -} - -.book-box-download:hover .book-box-formats, -.book-box-download.hover .book-box-formats { - display: block; -} - -.book-box-tools { - width: 46em; - font-size: 1.1em; -} - -.book-wide-box { - min-width: 48.75em; -} -.book-wide-box .book-box-tools { - margin-left: 14em; - width: 32em; -} - -.book-wide-box #theme-list-wrapper { - margin-left: 15.4em; - margin-bottom: 3em; - width: 30em; -} - - - -.book-box-read a:before { - content: url("/static/img/read.png"); - font-size: 2.25em; - margin-right: .15em; - vertical-align: middle; - font-weight: normal; -} - -.book-box-download a.downarrow:before { - content: url("/static/img/download.png"); - font-size: 2.25em; - margin-right: .15em; - vertical-align: middle; - font-weight: normal; -} - -.book-box-audiobook a:before { - content: url("/static/img/listen.png"); - font-size: 2.25em; - margin-right: .15em; - vertical-align: middle; - font-weight: normal; -} - -ul.book-box-tools { - margin: 0; - padding: 0; -} - -.book-box-tools li { - display: inline-block; -} - -.book-box-read { - width: 11.5em; -} -.book-box-download { - width: 8.5em; -} -.book-box-audiobook { - width: 7em; -} - -ul.inline-items, ul.inline-items li { - margin: 0; - padding: 0; -} - -ul.inline-items li { - display: inline-block; -} - -.book-wide-box .other-tools { - float: left; - width: 14.5em; - margin: 5em 0 0 1.5em; - -} - -.book-wide-box .other-download { - float: left; - width: 22em; - margin: 5em 1.5em 0em 1.5em; -} -.book-wide-box .other-tools h2, -.book-wide-box .other-download h2, -.book-wide-box .other-tools ul, -.book-wide-box .other-download ul { - font-size: 1.1em; -} -.book-wide-box .other-tools h2, -.book-wide-box .other-download h2 { - margin: 0; -} - - - -.book-wide-box .license-icon { - display:block; - margin-top: .5em -} - - -.star { - font-size: 2.25em; - margin-right: .5em; - position: absolute; - right: 0; -} -.star button::-moz-focus-inner { - padding: 0; - border: 0 -} -.if-unlike button { - font-size: 1em; - font-family: inherit; - border: 0; - background: none; - margin: 0; - padding: 0; - color: #757575; -} - -.if-like a { - display:block; - text-align:right; - padding: 0; -} - -.like .if-unlike { - display: none; -} - -.unlike .if-like { - display: none; -} - -.snippets .snippet-text { - background: #f7f7f7; - font-size: 1.2em; - margin: 1.083em 0em; - padding: 1em; -} - -.snippets .anchor { - display: none; -} diff --git a/apps/wolnelektury_core/static/css/catalogue.css b/apps/wolnelektury_core/static/css/catalogue.css deleted file mode 100755 index 5f52f248c..000000000 --- a/apps/wolnelektury_core/static/css/catalogue.css +++ /dev/null @@ -1,161 +0,0 @@ -.work-list { - margin: 0; - padding: 0; - list-style: none; -} - -.work-item { - margin: 0; - padding: 0; -} - -.books .work-item { - display: inline-block; -} - - -/* listing of all books */ -#book-list { - padding-left: 50px; -} -/* FIXME: MEDIA? - * -#book-list-nav { - position: absolute; - right: 50px; - width: 200px; - border-left: 1px #cfcfcf solid; - padding: 10px; - font-size: 1.2em; -} - */ - -#book-list-nav ul { - list-style-type: none; - margin: 5px; - padding: 0; -} - -.book-list-show-index { - display: none; - margin: 0; - padding: 0; -} - - -#book-a-list #book-list ol { - padding-left: 1em; - margin: 0.3em 0 1.2em 0; - list-style: none; -} - -#book-a-list #book-list h2 { - font-size: 1em; - margin: 0; -} - -#book-a-list #book-list h2 a { - color: black; -} - -#book-list-up { - position: fixed; - bottom: 50px; - right: 50px; - border-left: 1px #cfcfcf solid; - padding: 10px; - background-color: white; -} - - - -.catalogue-catalogue h2 { - font-size: 2em; - margin: 0; -} -.catalogue-catalogue ul { - column-width: 30em; - -moz-column-width: 30em; - -webkit-column-width: 30em; -} - - -#description { - margin-bottom: 2em; - cursor: pointer; -} -#description dl { - margin-top: 0; -} -#description dt { - display: inline; - font-weight: bold; - margin: 0; -} -#description dd { - display: inline; - margin: 0; -} -#description p { - margin-top: 0; -} -#description .meta { - list-style: none; - padding: 0; - margin: 0; -} -#description .meta li { - text-align:right; - color: #666; - font-size: .9em; -} - -.inline-header { - display: inline-block; - vertical-align: top; - width: 7em; -} -.inline-body { - display: inline-block; - vertical-align: top; - margin-bottom: .5em; -} -.inline-body ul { - list-style: none; - padding: 0; - margin: 0; -} -.inline-body li { - display: inline-block; - margin-right: 1em; -} - - -.see-also { - margin-left: 8em; - float: left; - width: 14.3em; -} -.download { - margin-left: 2em; - float: left; -} - -.see-also, .download { - margin-top: 2em; - margin-bottom: 2em; -} -.see-also h2, .download h2 { - font-size: 1.1em; - margin: 0; -} -.see-also ul, .download ul { - list-style: none; - padding: 0; - margin: 0; - font-size: 1.1em; -} - -.left-column .see-also { - margin-left: 0; -} diff --git a/apps/wolnelektury_core/static/css/cite.css b/apps/wolnelektury_core/static/css/cite.css deleted file mode 100755 index d397da2ee..000000000 --- a/apps/wolnelektury_core/static/css/cite.css +++ /dev/null @@ -1,136 +0,0 @@ -.cite { - display: block; - color: black; - background: white; - padding: 3em 2em .1em 8em; -} -.book-wide-box .cite-body, -#tagged-object-list .cite-body - { - font-size: 1.8em; - line-height: 1.3em; -} -.book-wide-box .source, -#tagged-object-list .source -{ - color: #444; - font-size: 1.1em; - margin-top: 1.6em; -} -.cite .vip { - margin: 0; - color: #575C63; - font-size: 1.1em; -} - - - -#big-cite { - background-color: #444; - color: white; - padding: 0; - margin: 0; - background-image: url(/static/img/backdrop/book-drawer2.jpg); - background-size: 100%; - background-position: 50% 68%; - background-repeat: no-repeat; -} - -#big-cite .cite { - padding: 4.6em 4em 4.8em 0; - background: none; - color: white; -} - -#big-cite h2 { - margin: 0; - font-size: 1.1em; - color: #575c63; -} - - -#big-cite .cite-body { - margin: .05em .05em .05em 1em; -} -#big-cite .cite-body span { - font-size: 3em; - line-height: 1.16em; -} - -#big-cite .vip { - margin-left: 1em; - margin-top: .25em; -} - -#big-cite .vip span { - font-size:1.1em; -} - -#big-cite .cite-body span, -#big-cite .vip span, -#big-cite .source span -{ - color: white; - background-color: rgb(0, 0, 0); - background-color: rgba(0, 0, 0, 0.6); - /* For IE 5.5 - 7*/ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); - /* For IE 8*/ - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; -} -/* a long cite displays smaller */ -#big-cite .cite-small .cite-body span { - font-size: 2em; -} - - -#big-cite .source { - margin: 1.6em 0.2em 1.6em 1em; -} -#big-cite .source span { - font-size: 1.2em; -} - - - - - -.cite blockquote p { - margin: 0; -} - -.cite blockquote { - padding: 0; - margin: 0; -} - -.book-wide-box .cite { - position: relative; - top: -1em; - right: -1em; - background-color: #f7f7f7; - vertical-align: middle; - width: 39.5em; - margin: 0; - padding: 1em; -} - - -.Fragment-item .fragment { - color: black; - display: block; -} -.Fragment-item .toggle { - font-size: 1.1em; - display:block; - padding: .5em 0; -} -.Fragment-item { - margin-bottom: 2em; - /* white-box */ - border: 1px solid #ddd; - background: #fff; - -moz-box-shadow: 2px 2px 2px #ddd; - -webkit-box-shadow: 2px 2px 2px #ddd; - box-shadow: 2px 2px 2px #ddd; -} diff --git a/apps/wolnelektury_core/static/css/core.css b/apps/wolnelektury_core/static/css/core.css deleted file mode 100644 index 514f8af3a..000000000 --- a/apps/wolnelektury_core/static/css/core.css +++ /dev/null @@ -1,3 +0,0 @@ -@import url(screen.css); -@import url(antiscreen.css) handheld; -@import url(antiscreen.css) only screen and (max-device-width:480px); diff --git a/apps/wolnelektury_core/static/css/dialogs.css b/apps/wolnelektury_core/static/css/dialogs.css deleted file mode 100755 index d83116ba6..000000000 --- a/apps/wolnelektury_core/static/css/dialogs.css +++ /dev/null @@ -1,117 +0,0 @@ -.cuteform { - font-size: 1.1em; -} -.cuteform ol, .cuteform ul { - padding: 0; - margin: 0; - list-style: none; - font-style: 1.1em; -} - -.cuteform ol li, .cuteform ul li { - margin-top: 0.7em; -} - -.cuteform label { - display: block; -} - -.cuteform span.help-text { - display: block; - font-size: 0.8em; - color: #999; -} - -.cuteform .error { - color: #BF3024; - display: block; -} -.cuteform .errorlist { - color: #BF3024; -} - - -.jqmOverlay { background-color: #000; } - - -.dialog-window { - position: absolute; - display: none; - background-color: transparent; - margin-top: -0.5em; - margin-left: 1em; - width: 20em; -} - -.dialog-window div.header { - font-size: 1.1em; - width: 4em; - background-color: #FFF; - border-right: 0.3em solid #DDD; - padding: 0.5em 1em 0.5em 1em; - right: 0; - left: auto; - float: right; - text-align: center; -} - - -.dialog-window div.target { - background-color: #FFF; - color: black; - border-right: 0.3em solid #DDD; - border-bottom: 0.3em solid #DDD; - padding: 1em; - clear: both; -} - -.dialog-window h1 { - font-size: 1.2em; -} - -.dialog-window textarea, .dialog-window input { - width: 100%; -} - -.hidelabels label { - display: block; - width: 1px; - height: 1px; - overflow:hidden; -} - - - -#login-window { - width: 26em; -} -#register-window { - width: 26em; -} -#context-login-window { - width: 26em; -} - -#suggest-window { - width: 26em; -} - -#suggest-window textarea { - height: 6em; -} - -#suggest-publishing-window { - width: 29em; -} - -#suggest-publishing-window textarea { - height: 3em; -} - -#custom-pdf-window { - width: 24em; -} - -#custom-pdf-window label { - display: inline; -} diff --git a/apps/wolnelektury_core/static/css/form.css b/apps/wolnelektury_core/static/css/form.css deleted file mode 100644 index 65d0482ef..000000000 --- a/apps/wolnelektury_core/static/css/form.css +++ /dev/null @@ -1 +0,0 @@ -form table th{vertical-align:top;text-align:left;font-weight:normal}form table td{padding-bottom:1em}form table .required th:after{content:" *"}form table .errorlist{color:red;margin:0;padding:0;list-style:none}form table .helptext{color:#888;font-size:.9em;font-style:italic} \ No newline at end of file diff --git a/apps/wolnelektury_core/static/css/form.scss b/apps/wolnelektury_core/static/css/form.scss deleted file mode 100644 index 42e867595..000000000 --- a/apps/wolnelektury_core/static/css/form.scss +++ /dev/null @@ -1,26 +0,0 @@ -form table { - th { - vertical-align: top; - text-align: left; - font-weight: normal; - } - td { - padding-bottom: 1em; - } - - .required th:after { - content: " *"; - } - - .errorlist { - color: red; - margin: 0; - padding: 0; - list-style: none; - } - .helptext { - color: #888; - font-size: .9em; - font-style: italic; - } -} diff --git a/apps/wolnelektury_core/static/css/header.css b/apps/wolnelektury_core/static/css/header.css deleted file mode 100755 index f1bd0df94..000000000 --- a/apps/wolnelektury_core/static/css/header.css +++ /dev/null @@ -1,251 +0,0 @@ -#header-bg { - z-index: -1; - background: #191919; - position: absolute; - width: 50%; - height: 9.4em; -} - -#header { - padding-bottom: 0; - color: #989898; - background: #191919; - position: relative; -} -#header a { - color: #17CFDB; -} - -#half-header { - padding-bottom: 0; -} - -#half-header-content { - background: #191919; - color: #989898; -} - -#logo a, #logo img { - display: block; -} - -#tagline { - margin-left: 1.5em; -} - -#tagline span { - font-size: 1.3em; - color: #bbb; -} - -#user-info { - margin: 0; -} - -#search-area { - margin: 0; - background: #444; - color: white; -} - -#search-field { - display: inline-block; - padding-left: .5em; - padding-top: 0.5em; - padding-bottom: 0; -} - -#search { - font-size: 1.3em; - padding: 0; - /*height: 3.3em; - width: 62.6em; - padding-left: .5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - border: none; - border-radius: .5em; - -webkit-box-shadow:0 0 .5em #444 inset; - -moz-box-shadow:0 0 .5em #444 inset; - box-shadow: 0 0 .5em #444 inset;*/ - height: 2.54em; - padding-left: 1em; - -webkit-border-radius: .38em; - -moz-border-radius: .38em; - border: none; - border-radius: .38em; - -webkit-box-shadow:0 0 .38em #444 inset; - -moz-box-shadow:0 0 .38em #444 inset; - box-shadow: 0 0 .5em #444 inset; - line-height: 2.5em; - - font-family: Georgia; - background-color: #fff; - color: #000; - z-index: 200; - position: relative; -} - -/* styling search placeholder */ - -#search:-webkit-input-placeholder -{ - font-family: Georgia; - font-style: italic; - color: #767676; -} - -#search.placeholder -{ - font-family: Georgia; - font-style: italic; - color: #767676; -} - -#search:-moz-placeholder -{ - font-family: Georgia; - font-style: italic; - color: #767676; -} - -#search-button { - display: inline-block; - background: #018189; - color: white; - padding: 0; - margin: 0; - width: 9.4em; -} -#search-button button { - font-size: 1em; - height: 4.5em; - border: none; - background: #018189; - color: white; - width: 100%; - padding: 0; -} - -#search-button button span { - font-size: 1.1em; - position:relative; -} - - -#nav-line { - background-color: #e2e2e2; - height: 4.9em; -} - -ul#menu { - list-style: none; - padding: 0; - margin: 0 0 0 .6em; -} - -li.menu { - background-color: #e2e2e2; - float: left; -} -a.menu { - display: block; - padding-left: 1.4em; - padding-right: 1.4em; - /* must match grid-line */ - height: 3.1em; - padding-top: 1.8em; - color: #0c7076; -} -#menu a.hidden-box-trigger:hover { - border-bottom: 3px solid white; - margin-bottom: -3px; -} -a.menu span { - font-size: 1.1em; -} - - -#lang-button { - color: #717171; -} -#lang-button:after { - padding-left: 1em; - content: url("/static/img/arrow-gray.png"); - vertical-align: middle; -} -#lang-menu { - position: relative; - float: right; - display: block; - padding-left: 2.5em; - padding-right: 2em; - /* must match grid-line */ - height: 3.3em; - padding-top: 1.6em; - background: #f7f7f7; -} -#lang-menu .lang-flag { - font-size: 1.3em; -} - -#lang-menu-items { - z-index: 9999; -} - -#lang-menu-items button { - display: none; - background: #f7f7f7; - color: #6f6f6f; - cursor: pointer; - width: 100%; - border: solid #ddd; - border-width: 0 0 1px 0; - padding: .5em 0; - margin: 0; - font-size: 1.3em; -} - -#lang-menu:hover button, -#lang-menu.hover button { - display: block; -} - -#lang-menu:hover #lang-menu-items, -#lang-menu.hover #lang-menu-items { - position: absolute; - width: 100%; - padding: 0; - left: 0; - /* must match grid-line height */ - top: 3.9em; -} - -#lang-menu .active { - color: #000; -} - -.search-hint-label { - display: inline-block; - width: 25em; - font-size: 1.1em; - line-height: 1.636em; -} - -.search-hint-category { - font-size: 1.1em; - line-height: 1.636em; - -} - - - -#user-menu { - left: 0; - top: 2em; - width: 15em; - line-height:1.6em; -} -#user-menu a { - color: #0D7E85; -} diff --git a/apps/wolnelektury_core/static/css/ie.css b/apps/wolnelektury_core/static/css/ie.css deleted file mode 100644 index ff6b41242..000000000 --- a/apps/wolnelektury_core/static/css/ie.css +++ /dev/null @@ -1,9 +0,0 @@ -#logo { - margin-top: 2.7em; - width: 17em; - height: 10em; - overflow: hidden; -} -#logo a { - padding-top: 3em; -} diff --git a/apps/wolnelektury_core/static/css/main_page.css b/apps/wolnelektury_core/static/css/main_page.css deleted file mode 100755 index 4bf75ea23..000000000 --- a/apps/wolnelektury_core/static/css/main_page.css +++ /dev/null @@ -1,101 +0,0 @@ - -#promo-box-header { - padding-top: 2em; - height: 3.1em; - padding-bottom: 0; - padding-left: 2.5em; - padding-right: 2.5em; - background: #191919; - color: white; -} -#promo-box-header h2 { - font-size: 1.3em; - margin: 0; -} -#promo-box-body { - border-bottom: 2px solid #efefef; - padding: 2em 2.8em; - background: #efefef; -} -#promo-box h3 { - color: #0d777e; - font-size: 1.1em; - height: 2.5em; /* 2.75@1.1 */ - margin: 0; - font-family: "Andale Mono", "Lucida Sans Typewriter", "Courier New"; - font-weight: normal; -} -#promo-box h3:after { - content: " >"; -} -#promo-box a { - color: #0d777e; -} -#promo-box-body a { - display: block; - color: #6c6c6c; -} -#promo-box-body p { - margin-top: 0; - font-size: 1.2em; - line-height: 1.55em; - color: #6c6c6c; -} - -.main-last { - padding-top: 1.9em; - height: 3.2em; - padding-left: 1.9em; - margin: 0; - font-size: 1em; -} -.main-last span { - font-size: 1.1em; - color: black; -} -.main-last span:after { - content: " >"; -} - - -.infopages-box { - width: 20.6em; - display: inline-block; - margin: .5em 0 0 0; - padding: 0 1.7em; - vertical-align: top; - color: #989898; -} -.infopages-box h2 { - color: #017e85; - height: 2.8em; - padding-top: 2.5em; - font-size: 1em; - margin: 0; -} -.infopages-box h2 span { - font-size: 1.1em; -} -.infopages-box a { - color: black; -} - -.infopages-box ol, .infopages-box ul { - font-size: 1.1em; - list-style: none; - padding: 0; - margin: 0; - line-height: 1.45em; -} - -.infopages-box li { - margin-bottom: .25em; -} - -.infopages-box .social-links { - margin-top: 1em; -} - -.infopages-box .social-links a { - margin-right: .6em; -} diff --git a/apps/wolnelektury_core/static/css/new.book.css b/apps/wolnelektury_core/static/css/new.book.css new file mode 100644 index 000000000..b148020b4 --- /dev/null +++ b/apps/wolnelektury_core/static/css/new.book.css @@ -0,0 +1,269 @@ +body { + font-size: 16px; + font: Georgia, "Times New Roman", serif; + line-height: 1.5em; + margin: 0; +} + +a { + color: blue; + text-decoration: none; +} + +/* ================================== */ +/* = Header with logo and menu = */ +/* ================================== */ +#toc ol, #themes ol { + list-style: none; + padding: 0; + margin: 0; +} + +#toc ol li { + font-weight: bold; +} + +#toc ol ol { + padding: 0 0 1.5em 1.5em; + margin: 0; +} + +#toc ol ol li { + font-weight: normal; +} + +#toc h2 { + display: none; +} + +#toc .anchor { + float: none; + margin: 0; + color: blue; + font-size: 16px; + position: inherit; +} + +#info p { + text-align: justify; + margin: 1.5em 0 0; +} + +/* =================================================== */ +/* = Common elements: headings, paragraphs and lines = */ +/* =================================================== */ +h1 { + font-size: 3em; + margin: 1.5em 0; + text-align: center; + line-height: 1.5em; + font-weight: bold; +} + +h2 { + font-size: 2em; + margin: 1.5em 0 0; + font-weight: bold; + line-height: 1.5em; +} + +h3 { + font-size: 1.5em; + margin: 1.5em 0 0; + font-weight: normal; + line-height: 1.5em; +} + +h4 { + font-size: 1em; + margin: 1.5em 0 0; + line-height: 1.5em; +} + +p { + margin: 0; +} + +/* ======================== */ +/* = Footnotes and themes = */ +/* ======================== */ + +.annotation { + font-style: normal; + font-weight: normal; + font-size: 12px; + padding-left: 2px; + position: relative; + top: -4px; +} + +#footnotes { + margin-top: 3em; +} + +#footnotes .annotation { + display: block; + float: left; + width: 2.5em; + clear: both; +} + +#footnotes div { + margin: 1.5em 0 0 0; +} + +#footnotes p, #footnotes ul { + margin-left: 2.5em; + font-size: 0.875em; +} + +#footnotes .permalink { + font-size: .75em; +} + +blockquote { + font-size: 0.875em; +} + +/* ============= */ +/* = Numbering = */ +/* ============= */ +.verse, .paragraph { + position:relative; +} +/*.anchor { + position: absolute; + margin: -0.25em -0.5em; + color: #777; + font-size: 12px; + text-align: center; + padding: 0.25em 0.5em; + line-height: 1.5em; +}*/ + + +/* =================== */ +/* = Custom elements = */ +/* =================== */ +span.author { + font-size: 0.5em; + display: block; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +span.collection { + font-size: 0.375em; + display: block; + line-height: 1.5em; + margin-bottom: -0.25em; +} + +span.subtitle { + font-size: 0.5em; + display: block; + line-height: 1.5em; + margin-top: -0.25em; +} + +span.translator { + font-size: 0.375em; + display: block; + line-height: 1.5em; + margin-top: 0.25em; +} + +div.didaskalia { + font-style: italic; + margin: 0.5em 0 0 1.5em; +} + +div.kwestia { + margin: 0.5em 0 0; +} + +div.stanza { + margin: 1.5em 0 0; +} + +div.kwestia div.stanza { + margin: 0; +} + +p.paragraph { + text-align: justify; + margin: 1.5em 0 0; +} + +p.motto { + text-align: justify; + font-style: italic; + margin: 1.5em 0 0; +} + +p.motto_podpis { + font-size: 0.875em; + text-align: right; +} + +div.fragment { + border-bottom: 0.1em solid #999; + padding-bottom: 1.5em; +} + +div.note p, div.dedication p, div.note p.paragraph, div.dedication p.paragraph { + text-align: right; + font-style: italic; +} + +hr.spacer { + height: 3em; + visibility: hidden; +} + +hr.spacer-line { + margin: 1.5em 0; + border: none; + border-bottom: 0.1em solid #000; +} + +p.spacer-asterisk { + padding: 0; + margin: 1.5em 0; + text-align: center; +} + +div.person-list ol { + list-style: none; + padding: 0 0 0 1.5em; +} + +p.place-and-time { + font-style: italic; +} + +em.math, em.foreign-word, em.book-title, em.didaskalia { + font-style: italic; +} + +em.author-emphasis { + letter-spacing: 0.1em; +} + +em.person { + font-style: normal; + font-variant: small-caps; +} + +.verse:after { + content: "\feff"; +} + + +/* =================================== */ +/* = Hide some elements for printing = */ +/* =================================== */ + +@media print { + #menu {display: none;} +} diff --git a/apps/wolnelektury_core/static/css/picture_box.css b/apps/wolnelektury_core/static/css/picture_box.css index 83022eb77..e77ced239 100755 --- a/apps/wolnelektury_core/static/css/picture_box.css +++ b/apps/wolnelektury_core/static/css/picture_box.css @@ -1,3 +1,5 @@ +/* This need reviewing and updating before any pictures are published. */ + .picture-mini-box, .picture-box { display: inline-block; margin: 0; diff --git a/apps/wolnelektury_core/static/css/screen.css b/apps/wolnelektury_core/static/css/screen.css deleted file mode 100644 index 8522996dc..000000000 --- a/apps/wolnelektury_core/static/css/screen.css +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Should only be applied for big-screen pc-like devices. - */ - -.left-column { - width: 47em; - float: left; -} -.right-column { - float:right; - width: 47em; -} - -.hidden-box ul { - width: 48em; - column-width: 12em; - -moz-column-width: 12em; - -webkit-column-width: 12em; -} - -#menu-collections ul { - width: 18em; -} - - -#header-content, div#main-content, div#half-header-content, #footer-content { - width: 97.5em; - margin: auto; -} - -#promo-box { - float: right; - margin-top: -5.1em; -} - -#promo-box-body { - height: 30em; -} - -#big-cite .vip { - float:left; - text-align:right; - width: 14.7em; -} - -#big-cite .cite-body { - margin-left: 17.5em; -} - -#big-cite .source { - margin-left: 17.5em; -} - - -.book-wide-box { - width: 97.5em; -} -.book-wide-box .book-box-body { - width: 38.2em; -} - - -#tagged-object-list .left-column, #tagged-object-list .right-column { - width: 48em; -} - - - - -.inline-body { - width: 35em; -} - - -.search-result { - width: 97.5em; -} - - -.book-list-header { - width: 97.5em; -} - -.book-wide-box .right-column { - width: 41.5em; - margin-top: -23em; -} - -.book-wide-box #theme-list-wrapper { - margin-bottom: 0; -} - -.snippets { - width: 44em; - float: right; - margin-top: -20em; -} - - -/* HEADER */ - -#header { - height: 3em; - padding-top: 1.9em; -} - -#logo { - position: absolute; - top: 0; -} - -#user-info { - float: right; - padding: 0; -} - -#tagline { - display: inline-block; - margin-left: 25.5em; -} - -#search-area { - margin-left: 24em; - width: 73.5em; -} - -#search-field { - width: 63.1em; - padding-right: 0; -} - -#search { - width: 47.47em; -} - -#search-button { - float: right; -} - -#promo-box { - width: 32em; -} - - -/* Book list */ - -#book-list-nav { - border-left: 1px solid #CFCFCF; - padding: .75em; - position: absolute; - right: 4em; - width: 25em; -} diff --git a/apps/wolnelektury_core/static/css/simple.css b/apps/wolnelektury_core/static/css/simple.css index 6b8a54cc9..f723889a2 100755 --- a/apps/wolnelektury_core/static/css/simple.css +++ b/apps/wolnelektury_core/static/css/simple.css @@ -1,3 +1,5 @@ +/* Legacy simple style for some very old pages. */ + html { margin: 0; } diff --git a/apps/wolnelektury_core/static/js/base.js b/apps/wolnelektury_core/static/js/base.js index 9676d5b4c..7db29ab24 100755 --- a/apps/wolnelektury_core/static/js/base.js +++ b/apps/wolnelektury_core/static/js/base.js @@ -101,6 +101,14 @@ })(); +$('#show-menu').click(function(event) { + event.preventDefault(); + $('#menu').toggle('slow'); +}); +$('#book-list-nav h2').click(function(event) { + event.preventDefault(); + $('#book-list-nav-index').toggle(); +}); $('#themes-list-toggle').click(function(event) { diff --git a/apps/wolnelektury_core/static/js/book_text/box.js b/apps/wolnelektury_core/static/js/book_text/box.js new file mode 100644 index 000000000..e26762c2d --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/box.js @@ -0,0 +1,19 @@ +$(function() { + /* Toggle hidden box on click. */ + $("nav a[data-box]").each(function() { + $("#" + $(this).attr("data-box")).hide(); + + $(this).click(function(e) { + e.preventDefault(); + var showing = $(this).hasClass("active"); + $("nav .active").each(function() { + $(this).removeClass("active"); + $("#" + $(this).attr("data-box")).hide(); + }); + if (!showing) { + $(this).addClass("active"); + $("#" + $(this).attr("data-box")).show(); + } + }); + }); +}); diff --git a/apps/wolnelektury_core/static/js/book_text/info.js b/apps/wolnelektury_core/static/js/book_text/info.js new file mode 100644 index 000000000..e69de29bb diff --git a/apps/wolnelektury_core/static/js/book_text/menu.js b/apps/wolnelektury_core/static/js/book_text/menu.js new file mode 100644 index 000000000..3c7f57c73 --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/menu.js @@ -0,0 +1,24 @@ +(function($){$(function(){ + + +$('#menu-toggle-on').click(function(e) { + e.preventDefault(); + var body = $("body"); + body.removeClass("menu-hidden"); + if (!$("#menu").is(":visible")) { + body.addClass("menu-showed"); + } +}); + +$('#menu-toggle-off').click(function(e) { + e.preventDefault(); + var body = $("body"); + body.removeClass("menu-showed"); + if ($("#menu").is(":visible")) { + body.addClass("menu-hidden"); + } +}); + + + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/js/book_text/note.js b/apps/wolnelektury_core/static/js/book_text/note.js new file mode 100644 index 000000000..2f0feaaea --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/note.js @@ -0,0 +1,10 @@ +(function($){$(function(){ + + +if ($('#nota_red li').length > 0) { + $("#menu-nota_red").show(); +} + + + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/js/book_text/other.js b/apps/wolnelektury_core/static/js/book_text/other.js new file mode 100644 index 000000000..1956aa80e --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/other.js @@ -0,0 +1,36 @@ +(function($){$(function(){ + + +$("#menu-other").show(); + + +$(".display-other").click(function(e) { + e.preventDefault(); + + if ($('#big-pane').length == 0) + $("#other-text").show(); + $("#other-versions").slideUp('fast'); + $(".menu").removeClass('selected'); + + $("#other").hide(); + $("nav .active").removeClass('active'); + $("body").addClass('with-other-text'); + + $.ajax($(this).attr('data-other'), { + success: function(text) { + $("#other-text-body").html(text); + $("#other-text-waiter").hide(); + $("#other-text-body").show(); + } + }); +}); + + +$("#other-text-close").click(function(e) { + e.preventDefault(); + if ($('#big-pane').length == 0) + $("#other-text").hide(); + $("body").removeClass('with-other-text'); +}); + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/js/book_text/settings.js b/apps/wolnelektury_core/static/js/book_text/settings.js new file mode 100644 index 000000000..e398ba3ed --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/settings.js @@ -0,0 +1,12 @@ +(function($){$(function(){ + + +$("#menu-settings").show(); + +$(".settings-switch").click(function(e) { + e.preventDefault(); + $("body").toggleClass($(this).attr("data-setting")); +}); + + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/js/book_text/themes.js b/apps/wolnelektury_core/static/js/book_text/themes.js new file mode 100644 index 000000000..32e2e81ce --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/themes.js @@ -0,0 +1,16 @@ +(function($){$(function(){ + + +if ($('#themes li').length > 0) { + $("#menu-themes").show(); +} + + +$(".theme-begin").click(function(e) { + e.preventDefault(); + if ($(this).css("overflow") == "hidden" || $(this).hasClass('showing')) { + $(this).toggleClass("showing"); + } +}); + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/js/book_text/toc.js b/apps/wolnelektury_core/static/js/book_text/toc.js new file mode 100644 index 000000000..31f4e9ffc --- /dev/null +++ b/apps/wolnelektury_core/static/js/book_text/toc.js @@ -0,0 +1,9 @@ +(function($){$(function(){ + + +if ($('#toc li').length > 0) { + $('#menu-toc').show(); +} + + +})})(jQuery); diff --git a/apps/wolnelektury_core/static/scss/book_text.scss b/apps/wolnelektury_core/static/scss/book_text.scss new file mode 100644 index 000000000..8e91f5f2e --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text.scss @@ -0,0 +1,13 @@ +@import "tools"; + +@import "book_text/body"; +@import "book_text/box"; +@import "book_text/info"; +@import "book_text/menu"; +@import "book_text/note"; +@import "book_text/numbering"; +@import "book_text/other"; +@import "book_text/settings"; +@import "book_text/themes"; +@import "book_text/toc"; + diff --git a/apps/wolnelektury_core/static/scss/book_text/body.scss b/apps/wolnelektury_core/static/scss/book_text/body.scss new file mode 100644 index 000000000..99867c3b8 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/body.scss @@ -0,0 +1,84 @@ +/* + * #big-pane + * Everything besides the menu. + */ +@include min-screen(640px) { + #big-pane { + margin-left: 80px; + } + .menu-hidden { + #big-pane { + margin-left: 0; + } + } +} + + + +/* + * #main-text + * + * This is where the text lives + * together with line numbers, themes and stuff. + */ + +@mixin left-without-numbers { + padding-left: 20px; + @include min-screen(240px) { + padding-left: 30px; + } +} + +@mixin right-without-themes { + padding-right: 20px; + @include min-screen(240px) { + padding-right: 30px; + } + @include min-screen(320px) { + padding-right: 44px; + } +} + +#main-text { + @include left-without-numbers; + @include right-without-themes; + + /* make room for line numbers */ + @include min-screen(320px) { + padding-left: 50px; + } + + /* make room for themes */ + @include min-screen(600px) { + padding-right: 160px; + } +} + +.always-hide-line-numbers { + /* Cancel making room for line numbers. */ + #main-text { + @include left-without-numbers; + } +} + +.always-hide-themes { + /* Cancel making room for themes. */ + #main-text { + @include right-without-themes; + } +} + + + + + + + +#book-text { + max-width: 600px; + margin: 20px auto; + + h1 { + margin-top: 0px; + } +} diff --git a/apps/wolnelektury_core/static/scss/book_text/box.scss b/apps/wolnelektury_core/static/scss/book_text/box.scss new file mode 100644 index 000000000..4762e45cf --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/box.scss @@ -0,0 +1,27 @@ +/* TODO: +There should be a JS-less way of seeing at least some of +the hidden boxes (TOC and Themes). +*/ + +.box, #toc, #themes, #nota_red { + display: none; + + position: fixed; + left: 80px; + top: 0; + bottom: 0; + max-width: 380px; + padding: 10px; + margin: 0; + overflow-x: hidden; + overflow-y: auto; + z-index: 100000; + + color: black; + background: white; + opacity: .9; + + border-width: 0 2px 2px 0; + border-style: solid; + border-color: #191919; +} diff --git a/apps/wolnelektury_core/static/scss/book_text/info.scss b/apps/wolnelektury_core/static/scss/book_text/info.scss new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/info.scss @@ -0,0 +1 @@ + diff --git a/apps/wolnelektury_core/static/scss/book_text/menu.scss b/apps/wolnelektury_core/static/scss/book_text/menu.scss new file mode 100644 index 000000000..e2879b429 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/menu.scss @@ -0,0 +1,78 @@ +/* Button for showing menu */ +#menu-toggle-on { + width: 20px; + height: 20px; + position: fixed; + top: 0; + left: 0; + background: #191919; + color: white; + text-align: center; + z-index: 500; + + @include min-screen(240px) { + width: 30px; + height: 30px; + } + + @include min-screen(320px) { + width: 44px; + height: 44px; + } +} + +#menu { + display: none; + z-index: 1000; + + width: 80px; + position: fixed; + top: 0; + left: 0; + text-align: center; + background: #191919; + height: 100%; + + ul { + list-style: none; + margin: 0; + padding: 0; + + li { + + a { + padding: 10px 0; + color: white; + display: block; + text-decoration: none; + + &.active { + background: white; + color: black; + } + + .label { + display: block; + font-size: 12px; + } + } + } + + } +} + +/* body class for showing menu */ +.menu-showed #menu { + display: block; +} + +/* menu showing by default */ +@include min-screen(640px) { + #menu { + display: block; + } + /* body class for hiding menu */ + .menu-hidden #menu { + display: none; + } +} diff --git a/apps/wolnelektury_core/static/scss/book_text/note.scss b/apps/wolnelektury_core/static/scss/book_text/note.scss new file mode 100644 index 000000000..55dd76567 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/note.scss @@ -0,0 +1,3 @@ +#menu-nota_red { + display: none; +} diff --git a/apps/wolnelektury_core/static/scss/book_text/numbering.scss b/apps/wolnelektury_core/static/scss/book_text/numbering.scss new file mode 100644 index 000000000..fc611df94 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/numbering.scss @@ -0,0 +1,64 @@ +@mixin hide-line-numbers { + float: left; + margin-left: -20px; + + width: 20px; + height: 100%; + padding: 0; + overflow: hidden; + + color: white; + text-align: right; + + &:hover, &:active { + color: #ccc; + background-color: #CCC; + } + + &:before { + content: "#"; + display: block; + float: left; + width: 9px; + height: 100%; + overflow: hidden; + border-right: 1px solid #ccc; + } + + @include min-screen(240px) { + width: 30px; + margin-left: -30px; + + &:before { + width: 14px; + } + } +} + + +.anchor { + @include hide-line-numbers; + + @include min-screen(320px) { + /* Show line numbers. */ + margin-left: -50px; + width: 44px; + height: auto; + padding: 2px; + text-align: center; + color: #ccc; + + &:before { + display: none; + } + } +} + +@include min-screen(320px) { + .always-hide-line-numbers { + /* Cancel showing line numbers. */ + .anchor { + @include hide-line-numbers; + } + } +} diff --git a/apps/wolnelektury_core/static/scss/book_text/other.scss b/apps/wolnelektury_core/static/scss/book_text/other.scss new file mode 100644 index 000000000..ca2aebb49 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/other.scss @@ -0,0 +1,35 @@ +nav #menu-other { + display: none; +} + + +#other-text { + display: none; +} + +#main-pane.with-other-text { + + #main-text { + display: table-cell; + padding-left: 40px; + @include min-screen(1px) { + width: 300px; + } + + @include min-screen(1000px) { + width: 400px; + } + } + + #other-text { + display: table-cell; + padding-left: 40px; + @include min-screen(1px) { + width: 300px; + } + + @include min-screen(1000px) { + width: 400px; + } + } +} diff --git a/apps/wolnelektury_core/static/scss/book_text/settings.scss b/apps/wolnelektury_core/static/scss/book_text/settings.scss new file mode 100644 index 000000000..b8ac6a6df --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/settings.scss @@ -0,0 +1,35 @@ +@mixin switch-on { + background: #aaa; +} +@mixin switch-off { + background: none; +} +.settings-switch { + display: block; + padding: .5em; + margin: .5em; + border: 1px solid #aaa; + border-radius: 1em; +} + +nav #menu-settings { + display: none; +} + +#settings-annotations {@include switch-on;} +.no-annotations { + #settings-annotations {@include switch-off;} + .annotation {display: none;} +} + +#settings-themes {@include switch-on;} +.always-hide-themes { + #settings-themes {@include switch-off;} +} + +#settings-line-numbers {@include switch-on;} +.always-hide-line-numbers { + #settings-line-numbers {@include switch-off;} +} + + diff --git a/apps/wolnelektury_core/static/scss/book_text/themes.scss b/apps/wolnelektury_core/static/scss/book_text/themes.scss new file mode 100644 index 000000000..899db5e1a --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/themes.scss @@ -0,0 +1,101 @@ +nav #menu-themes { + display: none; +} + +/* Add a missing header. */ +#themes:before { + content: "Motywy"; +} + + + + +@mixin theme-hidden { + width: 20px; + height: 20px; + overflow: hidden; + margin-right: -20px; + border: none; + padding: 0; + + &:before { + content: "▲"; + color: #ccc; + text-align: center; + display: block; + } + + @include min-screen(240px) { + width: 30px; + margin-right: -30px; + &:before { + font-size: 2em; + } + } + + @include min-screen(320px) { + width: 44px; + margin-right: -44px; + &:before { + font-size: 3em; + } + } + + &.showing { + @include theme-showing; + } + +} + +@mixin theme-showing { + @include size(width, 120px); + height: auto; + overflow: visible; + margin-left: 30px; + + border-left: 1px solid #DDDDDD; + color: #777; + padding: 0 0 0 8px; + + &:before { + display: none; + } +} + +.theme-begin { + @include theme-hidden; + + position: relative; + float: right; + margin-bottom: 8px; + clear: both; + line-height: 1.5em; + text-align: left; + z-index: 60000; + + font-size: 16px; + font-style: normal; + font-weight: normal; + font-variant: normal; + letter-spacing: 0; + text-transform: none; + text-decoration: none; + + @include min-screen(600px) { + @include theme-showing; + margin-right: -160px; + } + + &.showing { + @include theme-showing; + } +} + + +@include min-screen(600px) { + .always-hide-themes { + .theme-begin { + @include theme-hidden; + } + } +} diff --git a/apps/wolnelektury_core/static/scss/book_text/toc.scss b/apps/wolnelektury_core/static/scss/book_text/toc.scss new file mode 100644 index 000000000..18975c760 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/book_text/toc.scss @@ -0,0 +1,3 @@ +nav #menu-toc { + display: none; +} diff --git a/apps/wolnelektury_core/static/scss/funding/funding.scss b/apps/wolnelektury_core/static/scss/funding/funding.scss new file mode 100644 index 000000000..61a48d681 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/funding/funding.scss @@ -0,0 +1,174 @@ +.funding { + background: orange; + margin: auto; + @include size(padding, 5px 0); + position: relative; + .close { + @include size(font-size, 10px); + } + .call-area { + float:left; + @include size(padding-right, 6px); + } + a.call { + @include size(height, 18px); + + @include size(padding, 5.25px 7.5px); + @include size(margin, 7.5px); + display: inline-block; + vertical-align: top; + text-align: center; + + background: lighten(#018189, .05); + @include size(width, 135px); + } + .learn-more { + text-align: center; + margin: auto; + @include size(font-size, 10px); + padding: .5em; + @include min-screen(420px) { + padding: 0; + } + } + .description { + @include size(padding-left, 6px); + + a { + display: block; + color: black; + @include size(padding, 0 3px); + } + } + strong { + @include size(font-size, 15px); + @include size(padding, 3px 0 0); + } + .progress { + .piece { + @include size(font-size, 13px); + @include size(padding, 4px 6px); + } + @include size(margin, 3px 12px 4px 0); + @include size(border-radius, 20px); + background-image: url(/static/img/progress-pixel.png); + background-repeat: repeat-y; + background-color: mix(#ec6d00, orange, .5); + @include box-shadow(1px 1px 1px #888); + } + .with-button { + clear: left; + @include min-screen(420px) { + clear: none; + @include size(margin-left, 171px); + } + } + + .funding-title { + @include size(font-size, 11px); + } + .funding-title-strong { + @extend .funding-title; + font-weight: bold; + @include size(font-size, 15px); + } + .close { + position: absolute; + top: 0px; + @include size(right, 5px); + } +} + +.funding-top-header { + @extend .funding; + + @include min-screen(1000px) { + @include size(width, 975px); + } +} + + +.wlfund { + width: 100%; + border-spacing:0; + + td { + @include size(padding, 10px 5px 10px); + text-align: center; + @include size(border-top, 10px solid rgba(255, 255, 255, 0)); + @include size(border-bottom, 2px solid #DDDDDD); + + background-clip: padding-box; + -moz-background-clip: padding; + -webkit-background-clip: padding; + } + td.oneline { + white-space: nowrap; + } + + td:last-child { + text-align: right; + } + + .funding-plus td { + background-color: mix(#0D7E85, white, .2); + } + + .funding-minus td { + background-color: white; + } +} + + + +.honking { + background: #018189; + @include size(font-size, 15px); + @include size(padding, 7.5px); + color: white; + border: 0; + @include box-shadow(3px 3px 4.5px #888888); + position: relative; +} +.honking:hover { + @include box-shadow(none); + @include size(top, 1px); + @include size(left, 1px); +} + + + +.share { + a { + @include size(margin-right, 15px); + + img { + vertical-align: middle; + } + } +} + +.funding-handle { + position: absolute; + top: 0; + right: 0; + z-index: 2; + background: orange; + cursor: pointer; + @include size(padding, 2.6px 13px); + @include size(border-radius, 0 0 0 10px); + @include size(font-size, 13px); +} + +.funding-cover { + float: left; + @include size(margin-right, 10px); +} + +.funding-details-intro { + @include size(padding-top, 10px); + + h3:first-of-type { + margin-top: 0; + } +} diff --git a/apps/wolnelektury_core/static/scss/main.scss b/apps/wolnelektury_core/static/scss/main.scss new file mode 100644 index 000000000..8d6e0d326 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main.scss @@ -0,0 +1,23 @@ +@import "tools"; + +@import "main/auth"; +@import "main/base"; +@import "main/book_box"; +@import "main/book_list"; +@import "main/catalogue"; +@import "main/cite"; +@import "main/dialogs"; +@import "main/footer"; +@import "main/form"; +@import "main/fragment"; +@import "main/header"; +@import "main/hidden"; +@import "main/main_content"; +@import "main/main_page"; +@import "main/menu"; +@import "main/search"; +@import "main/tag"; + +@import "funding/funding"; + +@import "polls/polls"; diff --git a/apps/wolnelektury_core/static/scss/main/auth.scss b/apps/wolnelektury_core/static/scss/main/auth.scss new file mode 100755 index 000000000..03cf6150a --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/auth.scss @@ -0,0 +1,44 @@ +.email_list { + .verified { + display: inline-block; + margin-left: 2em; + font-style: italic; + } + .unverified { + display: inline-block; + margin-left: 2em; + color: #717171; + font-style: italic; + } + .primary { + display: inline-block; + margin-left: 2em; + font-weight: bold; + } +} + +.socialaccount_provider { + display: inline-block; + background-repeat: no-repeat; + color: transparent; + + @include size(height, 40px); + @include size(width, 40px); + vertical-align: middle; + + &.google { + background-image: url(/static/img/auth/google.png); + } +} + + +.socialaccount_providers { + @include size(margin, 10px 0); + padding: 0; + + li { + display: inline; + list-style: none; + @include size(margin-right, 10px); + } +} diff --git a/apps/wolnelektury_core/static/scss/main/base.scss b/apps/wolnelektury_core/static/scss/main/base.scss new file mode 100755 index 000000000..02f02a37e --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/base.scss @@ -0,0 +1,101 @@ +/* Basic layout */ +html, body { + margin: 0; + padding: 0; +} + + +.clearboth { + clear: both; +} + + + +/* Basic colors and fonts */ +body { + font-family: Georgia; + background: #f7f7f7; + color: black; + + @include size(font-size, 13px); +} + +a { + color: #0d7e85; + text-decoration: none; + + img { + border: 0; + } +} + +h1 { + @include size(font-size, 35px); + font-weight: normal; + @include size(margin-top, 14px); + + a { + color: inherit; + } +} + +h2 { + @include size(font-size, 20px); + font-weight: normal; +} + +h3 { + @include size(font-size, 15px); + font-weight: normal; +} + + +.normal-text { + line-height: 1.3em; +} + +.white-box { + @include size(padding, 10px); + @include white-box; +} + + +ul.plain { + list-style:none; + margin: 0; + padding: 0; +} + + +.theme-list-link { + @include mono; + @include size(font-size, 11px); + + &:after { + @include size(padding-left, 11px); + content: url("/static/img/arrow-teal.png"); + vertical-align: middle; + } +} + + +.left-column, .right-column { + @include size(max-width, 600px); +} +@media screen and (min-width: 62.5em) { + .left-column { + @include size(width, 470px); + float: left; + } + .right-column { + @include size(width, 470px); + float:right; + } +} + +.pagination { + display: block; + @include size(font-size, 12px); + @include size(padding, 6px); + text-align:center; +} diff --git a/apps/wolnelektury_core/static/scss/main/book_box.scss b/apps/wolnelektury_core/static/scss/main/book_box.scss new file mode 100755 index 000000000..0ee26be0f --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/book_box.scss @@ -0,0 +1,448 @@ +@mixin inner-box { + display: block; + color: black; + @include size(margin, 1px); + @include size(padding, 8px 10px); + @include white-box; +} + +.book-mini-box img.cover { + @include size(height, 193px); + @include size(width, 139px); +} + + +.cover-area { + float: left; + @include size(margin-right, 15px); + @include size(margin-bottom, 5px); + + @media screen and (min-width: 32em) { + position: absolute; + top: 0; + left: 0; + margin-right: 0; + } + + img.cover { + @include size(height, 193px / 2); + @include size(width, 139px / 2); + + @media screen and (min-width: 20em) { + @include size(height, 193px); + @include size(width, 139px); + } + } +} + +.book-mini-box { + @include size(width, 161.5px); + display: inline-block; + vertical-align: top; + + a { + @include inner-box; + @include size(height, 271px); + @include size(margin, 1px); + overflow: hidden; + } + img.cover { + @include size(margin-bottom, 18px); + } + .desc { + margin-left: 0; + } + .author { + @include size(font-size, 11px); + @include mono; + color: #6d7877; + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .title { + @include size(font-size, 14px); + color: #242424; + } +} + + + +.work-list { + margin: 0; + padding: 0; + list-style: none; + + .Book-item { + @media screen and (min-width: 32em) { + display: inline-block; + } + vertical-align: top; + } +} + + +.book-box { + margin: 0; + vertical-align: top; + + @media screen and (min-width: 32em) { + @include size(width, 487.5px); + } + + .book-box-inner { + position: relative; + @include inner-box; + @include size(min-height, 197.5px); + } +} + + +.book-wide-box { + margin: 0; + vertical-align: top; + + @media screen and (min-width: 62.5em) { + @include size(width, 975px); + } + + .book-box-inner { + position: relative; + @include size(min-height, 244px); + @include inner-box; + @include size(margin-left, 0); + @include size(margin-right, 0); + + .book-left-column { /* FIXME */ + @include size(max-width, 600px); + + @media screen and (min-width: 62.5em) { + float: left; + @include size(width, 536px); + } + } + + .license-icon { + display: block; + @include size(margin-top, 5px); + } + + @media screen and (min-width: 62.5em) { + .book-box-head, + .tags, + .book-box-tools { + @include size(width, 382px); + } + } + + #theme-list-wrapper { + @include size(margin-left, 154px); + margin-bottom: 0; + @include size(width, 300px); + + p { + @include size(margin-top, 10px); + @include size(margin-bottom, 10px); + } + } + + .right-column { + @include size(margin-top, 16px); + + @media screen and (min-width: 62.5em) { + @include size(width, 415px); + // Eat the padding + @include size(margin-top, -8px); + @include size(margin-right, -10px); + } + + .other-tools, + .other-download { + float: left; + @include size(width, 145px); + @include size(margin-top, 50px); + @include size(margin-bottom, 0); + @include size(margin-left, 5px); + @include size(margin-right, 0); + @include size(font-size, 11px); + + h2 { + margin: 0; + @include size(font-size, 11px); + @include mono; + } + } + .other-download { + @include size(margin-left, 15px); + @include size(width, 220px); + } + } + } +} + + +.book-box-body { + @include size(margin-bottom, 10px); + @media screen and (min-width: 32em) { + margin-bottom: 0; + @include size(height, 170px); + } + position: relative; + + .book-box-head { + @include size(padding-top, 14px); + @include size(margin-bottom, 10px); + + @media screen and (min-width: 32em) { + @include size(min-height, 70px); + @include size(width, 310px); + float: right; + } + + a { + color: black; + } + .author { + @include size(font-size, 11px); + @include mono; + @include size(line-height, 13.2px); + @include size(max-height, 26.4px); + overflow: hidden; + + @media screen and (min-width: 32em) { + @include size(max-width, 264px); + } + } + .title { + @include size(font-size, 24px); + line-height: 1.2em; + @include size(margin-top, 7.2px); + @include size(margin-bottom, 12px); + + @media screen and (min-width: 32em) { + margin-bottom: 0; + @include size(height, 57.6px); + overflow: hidden; + } + } + } + + .tags { + @include size(font-size, 11px); + line-height: 1.2em; + + @media screen and (min-width: 32em) { + @include size(width, 310px); + float: right; + clear: right; + @include size(max-height, 57.6px); + overflow: hidden; + } + + .category { + display: block; + @include size(margin-top, 6px); + @include size(margin-bottom, 6px); + + @media screen and (min-width: 32em) { + display: inline; + } + + .mono { + @include mono; + } + + .book-box-tag { + @include size(margin-left, 4.4px); + @include size(margin-right, 5.5px); + } + } + } + +} + + + +.book-box-tools { + @include size(font-size, 11px); + margin: 0; + padding: 0; + list-style: none; + + clear: left; + + @media screen and (min-width: 20em) { + clear: none; + @include size(margin-left, 139px + 15px); + } + + @media screen and (min-width: 32em) { + @include size(width, 310px); + float: right; + clear: right; + } + + li { + @include mono; + + @media screen and (min-width: 32em) { + display: inline-block; + } + } + + .book-box-read { + @media screen and (min-width: 32em) { + @include size(width, 126.5px); + } + + a { + @include mono; + } + + a:before { + content: url("/static/img/read.png"); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); + vertical-align: middle; + font-weight: normal; + } + } + + .book-box-download { + position: relative; + + @media screen and (min-width: 32em) { + @include size(width, 93.5px); + } + + a { + position: relative; + z-index: 101; + + &.downarrow { + color: black; + + @media screen and (min-width: 32em) { + color: #0D7E85; + } + + &:before { + content: url("/static/img/download.png"); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); + vertical-align: middle; + font-weight: normal; + } + } + } + + .book-box-formats { + @include size(padding-left, 25px); + + @media screen and (min-width: 32em) { + display: none; + position: absolute; + + @include size(width, 180px); + @include size(padding-top, 38px); + @include size(padding-bottom, 9px); + @include size(padding-left, 19px); + @include size(padding-right, 19px); + + @include white-box; + + z-index: 100; + + @include size(top, -16px); + @include size(left, -19px); + } + + span { + display: block; + @include size(margin-top, 16px); + + @media screen and (min-width: 32em) { + @include size(margin-top, 0); + + &:first-child { + @include size(margin-top, 16px); + } + } + } + } + + &:hover .book-box-formats, + &.hover .book-box-formats { + display: block; + } + } + + .book-box-audiobook { + @media screen and (min-width: 32em) { + @include size(width, 77px); + } + + a:before { + content: url("/static/img/listen.png"); + @include size(font-size, 25px); + @include size(margin-right, 3.71px); + vertical-align: middle; + font-weight: normal; + } + + } +} + + + + +.star { + @include size(font-size, 22.5px); + @include size(margin-right, 11.25px); + position: absolute; + right: 0; + + button::-moz-focus-inner { + padding: 0; + border: 0 + } + .if-unlike button { + font-size: 1em; + font-family: inherit; + border: 0; + background: none; + margin: 0; + padding: 0; + color: #757575; + } + .if-like a { + display:block; + text-align:right; + padding: 0; + } +} +.like .if-unlike { + display: none; +} +.unlike .if-like { + display: none; +} + + +#book-detail .see-also { + h1 { + @include size(height, 32px); + margin: 0; + @include size(padding-top, 19px); + @include size(padding-left, 10px); + + @include size(font-size, 11px); + @include mono; + font-weight: normal; + + @media screen and (min-width: 33em) { + @include size(padding-left, 19px); + } + } +} diff --git a/apps/wolnelektury_core/static/scss/main/book_list.scss b/apps/wolnelektury_core/static/scss/main/book_list.scss new file mode 100755 index 000000000..d4115dcbb --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/book_list.scss @@ -0,0 +1,92 @@ +/* listing of all books */ + +#book-a-list { + #book-list-nav { + @include size(border-width, 0); + @include size(border-bottom-width, 1px); + border-style: solid; + border-color: #CFCFCF; + @include size(padding, 9.75px); + line-height: 2em; + + @media screen and (min-width: 30em) { + @include size(border-bottom-width, 0px); + @include size(border-left-width, 1px); + float: right; + width: 50%; + } + + @media screen and (min-width: 62.5em) { + line-height: 1.3em; + } + + h2 { + cursor: pointer; + + &:after { + @include size(padding-left, 10px); + content: url("/static/img/arrow-gray.png"); + vertical-align: top; + } + + @media screen and (min-width: 30em) { + font-size: 1em; + margin: 0; + cursor: regular; + + &:after { + display: none; + } + } + } + + #book-list-nav-index { + display: none; + @media screen and (min-width: 30em) { + display: block !important; + } + } + + ul { + list-style-type: none; + @include size(margin, 5px); + padding: 0; + } + .book-list-show-index { + display: none; + } + } + + #book-list { + @include size(padding-left, 5px); + line-height: 2em; + + @media screen and (min-width: 62.5em) { + @include size(padding-left, 50px); + line-height: 1.3em; + } + + ol { + @include size(padding-left, 13px); + @include size(margin, 4px 0 15.6px 0); + list-style: none; + } + h2 { + @include size(font-size, 13px); + margin: 0; + a { + color: black; + } + } + } + + #book-list-up { + display: block; + position: fixed; + @include size(bottom, 50px); + @include size(right, 50px); + @include size(border-left, solid 1px #CFCFCF); + @include size(padding, 20px 10px); + background-color: white; + } +} diff --git a/apps/wolnelektury_core/static/scss/main/catalogue.scss b/apps/wolnelektury_core/static/scss/main/catalogue.scss new file mode 100755 index 000000000..ba30e8271 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/catalogue.scss @@ -0,0 +1,29 @@ +/* listing of all books */ + +.catalogue-catalogue { + ul { + column-width: 25em; + -moz-column-width: 25em; + -webkit-column-width: 25em; + + @include size(padding-left, 10px); + + @media screen and (min-width: 20em) { + @include size(padding-left, 40px); + } + + li { + margin-bottom: 1em; + + @media screen and (min-width: 62.5em) { + margin-bottom: .5em; + } + } + } + + h2 { + @include size(font-size, 26px); + margin: 0; + @include size(padding, 26px); + } +} diff --git a/apps/wolnelektury_core/static/scss/main/cite.scss b/apps/wolnelektury_core/static/scss/main/cite.scss new file mode 100755 index 000000000..b95628888 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/cite.scss @@ -0,0 +1,45 @@ +.cite { + display: block; + color: black; + background: white; + @include size(padding, 30px 20px 1px 80px); + + .vip { + margin: 0; + color: #575C63; + @include size(font-size, 11px); + } + + .cite-body { + @include size(font-size, 18px); + line-height: 1.3em; + } + + blockquote { + padding: 0; + margin: 0; + + p { + margin: 0; + } + } + + .source + { + color: #444; + @include mono; + @include size(font-size, 11px); + @include size(margin-top, 16px); + } +} + + + + +.book-wide-box .cite { + background-color: #f7f7f7; + vertical-align: middle; + @include size(width, 395px); + margin: 0; + @include size(padding, 10px); +} diff --git a/apps/wolnelektury_core/static/scss/main/dialogs.scss b/apps/wolnelektury_core/static/scss/main/dialogs.scss new file mode 100755 index 000000000..2902862fc --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/dialogs.scss @@ -0,0 +1,138 @@ +.dialog-window { + position: absolute; + display: none; + background-color: transparent; + @include size(margin-top, -5px); + @include size(margin-left, 10px); + @include size(width, 200px); + + @media screen and (max-width: 29.999999em) { + left: 0 !important; + right: 0; + @include size(margin-left, 0); + width: auto; + } + + div.header { + @include mono; + @include size(font-size, 11px); + width: 4em; + background-color: #FFF; + padding: 1em; + right: 0; + left: auto; + float: right; + text-align: center; + + @media screen and (min-width: 30em) { + padding-top: 0.5em; + padding-bottom: 0.5em; + border-right: 0.3em solid #DDD; + } + } + + div.target { + background-color: #FFF; + color: black; + border-bottom: 0.3em solid #DDD; + padding: 1em 10px; + clear: both; + + @media screen and (min-width: 30em) { + border-right: 0.3em solid #DDD; + padding-left: 1em; + padding-right: 1em; + } + } + + h1 { + @include size(font-size, 12px); + font-weight: normal; + margin-top: .4em; + } + + textarea, input { + width: 100%; + } +} + + + + + + + +.cuteform { + @include size(font-size, 11px); + + ol, ul { + padding: 0; + margin: 0; + list-style: none; + @include size(font-size, 11px); + + li { + margin-top: 0.7em; + } + } + + label { + display: block; + } + + span.help-text { + display: block; + font-size: 0.8em; + color: #999; + } + + .error { + color: #BF3024; + display: block; + } + + .errorlist { + color: #BF3024; + } +} + + +.jqmOverlay { background-color: #000; } + + + +.hidelabels label { + @include hidden-label; +} + + +@media screen and (min-width: 30em) { + #login-window { + @include size(width, 260px); + } + #register-window { + width: 26em; + } + #context-login-window { + width: 26em; + } + #suggest-window { + width: 26em; + } + #suggest-publishing-window { + width: 29em; + } + #custom-pdf-window { + width: 24em; + } +} + +#suggest-window textarea { + height: 6em; +} +#suggest-publishing-window textarea { + height: 3em; +} +#custom-pdf-window label { + display: inline; +} diff --git a/apps/wolnelektury_core/static/scss/main/footer.scss b/apps/wolnelektury_core/static/scss/main/footer.scss new file mode 100755 index 000000000..8969a5ad7 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/footer.scss @@ -0,0 +1,26 @@ +#footer-wrapper { + @include size(margin-top, 50px); + @include size(padding-top, 30px); + background: #fff; + color: #767676; + @include size(border-top, 1px solid #ddd); +} + +footer#main { + @include size(font-size, 10px); + @include size(margin-left, 5px); + @include size(margin-right, 5px); + + @media screen and (min-width: 62.5em) { + @include size(width, 975px); + margin: auto; + } + + p { + @include size(margin-top, 2.5px); + @include size(margin-bottom, 2.5px); + margin-left: 0; + margin-right: 0; + } +} + diff --git a/apps/wolnelektury_core/static/scss/main/form.scss b/apps/wolnelektury_core/static/scss/main/form.scss new file mode 100755 index 000000000..42e867595 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/form.scss @@ -0,0 +1,26 @@ +form table { + th { + vertical-align: top; + text-align: left; + font-weight: normal; + } + td { + padding-bottom: 1em; + } + + .required th:after { + content: " *"; + } + + .errorlist { + color: red; + margin: 0; + padding: 0; + list-style: none; + } + .helptext { + color: #888; + font-size: .9em; + font-style: italic; + } +} diff --git a/apps/wolnelektury_core/static/scss/main/fragment.scss b/apps/wolnelektury_core/static/scss/main/fragment.scss new file mode 100755 index 000000000..1eaf61ce9 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/fragment.scss @@ -0,0 +1,14 @@ +.Fragment-item { + @include size(margin-bottom, 20px); + @include white-box; + + .fragment { + color: black; + display: block; + } + .toggle { + @include size(font-size, 11px); + display: block; + @include size(padding, 5px 0); + } +} diff --git a/apps/wolnelektury_core/static/scss/main/header.scss b/apps/wolnelektury_core/static/scss/main/header.scss new file mode 100755 index 000000000..4edd53e18 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/header.scss @@ -0,0 +1,215 @@ +$header_bg: #191919; + + +#header-wrapper { + position: relative; + + /* Upper-half both sides dark background */ + &:before { + content: " "; + display: block; + z-index: -1; + position: absolute; + top: 0; + @include size(bottom, 45px); + left: 0; + width: 100%; + background-color: $header_bg; + } + + /* Left-side dark background */ + &:after { + content: " "; + display: block; + z-index: -1; + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 50%; + background-color: $header_bg; + } +} + + +header#main { + @include size(line-height, 20px); /* Make links easier to click when wrapped. */ + background-color: $header_bg; + color: #bbb; + + @media screen and (min-width: 62.5em) { + position: relative; + @include size(height, 94px); + @include size(width, 975px); + margin: auto; + } + + a { + color: #17CFDB; + } + + #logo { + display: block; + @include size(height, 94px); + @include size(width, 94px); + + @media screen and (min-width: 24em) { + float: left; + } + + img { + display: block; + } + } + + #tagline { + margin-top: 0; + @include size(margin-left, 5px); + @include size(margin-right, 5px); + padding-top: 0; + @include size(font-size, 11px); + + @media screen and (min-width: 24em) { + @include size(padding-top, 6px); + @include size(font-size, 13px); + text-align: right; + } + + @media screen and (min-width: 62.5em) { + position: absolute; + @include size(top, 10px); + @include size(left, 255px); + @include size(margin-left, 0px); + } + } + + #user-info { + margin-top: 0; + @include size(margin-left, 5px); + @include size(margin-right, 5px); + padding-top: 0; + @include mono; + @include size(font-size, 10px); + position: relative; + + @media screen and (min-width: 24em) { + @include size(padding-top, 15px); + text-align: right; + } + @media screen and (min-width: 62.5em) { + position: absolute; + top: 0; + right: 0; + @include size(margin-left, 0); + @include size(margin-right, 0); + } + + /* We want submenu on far left on small screens. */ + .hidden-box-wrapper { + position: static; + @media screen and (min-width: 24em) { + position: relative; + } + } + + #user-menu { + display: none; + + text-align: left; + line-height:1.6em; + left: 0; + right: 0; + top: 2em; + + @media screen and (min-width: 15em) { + right: auto; + width: 15em; + } + + a { + color: #0D7E85; + } + } + } + + form#search-area { + position: relative; + clear: both; + @include size(height, 45px); + background: #444444; + color: white; + + @media screen and (min-width: 62.5em) { + position: absolute; + @include size(top, 49px); + @include size(left, 240px); + @include size(right, 0); + } + + #search-field { + position: absolute; + @include size(top, 5px); + @include size(left, 5px); + @include size(right, 113px); + + label { + @include hidden-label; + } + input#search { + z-index: 200; + position: relative; + @include size(height, 33px); + width: 100%; + padding: 0; + @include size(padding-left, 13px); + @include size(line-height, 32.5px); + + border: none; + @include size(border-radius, 5px); + @include box-shadow(0 0 6.5px #444444 inset); + + font-family: Georgia; + @include size(font-size, 13px); + background-color: white; + color: black; + + /* styling search placeholder */ + &::placeholder + { + font-family: Georgia; + font-style: italic; + color: #767676; + } + &::-webkit-input-placeholder + { + font-family: Georgia; + font-style: italic; + color: #767676; + } + &::-moz-placeholder + { + font-family: Georgia; + font-style: italic; + color: #767676; + } + } + } + button { + display: inline-block; + position: absolute; + top: 0; + right: 0; + @include size(height, 45px); + @include size(width, 94px); + margin: 0; + padding: 0; + + border: none; + + @include mono; + @include size(font-size, 11px); + background: #018189; + color: white; + } + } +} diff --git a/apps/wolnelektury_core/static/scss/main/hidden.scss b/apps/wolnelektury_core/static/scss/main/hidden.scss new file mode 100755 index 000000000..718525be0 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/hidden.scss @@ -0,0 +1,53 @@ +.hidden-box-wrapper { + position: relative; + + .hidden-box { + position: absolute; + left: 0; + display: none; + @include size(padding, 10px 10px 5px 10px); + @include white-box; + + z-index: 500; + + ul { + list-style: none; + padding: 0; + margin: 0; + @include size(font-size, 11px); + + @include size(column-width, 132px); + @include size(-moz-column-width, 132px); + @include size(-webkit-column-width, 132px); + + @media screen and (min-width: 24em) { + @include size(width, 320px); + } + + @media screen and (min-width: 34em) { + @include size(width, 480px); + } + + @media screen and (min-width: 62.5em) { + @include size(width, 528px); + } + + + + li { + margin-bottom: 1em; + + @media screen and (min-width: 62.5em) { + margin-bottom: .5em; + } + } + } + } +} + +@media screen and (min-width: 24em) { + #menu-collections ul { + @include size(width, 180px); + } +} + diff --git a/apps/wolnelektury_core/static/scss/main/main_content.scss b/apps/wolnelektury_core/static/scss/main/main_content.scss new file mode 100755 index 000000000..87e140232 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/main_content.scss @@ -0,0 +1,8 @@ +#main-content { + position: relative; + + @media screen and (min-width: 62.5em) { + @include size(width, 975px); + margin: auto; + } +} diff --git a/apps/wolnelektury_core/static/scss/main/main_page.scss b/apps/wolnelektury_core/static/scss/main/main_page.scss new file mode 100755 index 000000000..ddce4fc21 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/main_page.scss @@ -0,0 +1,256 @@ +#big-cite { + background-color: #444; + color: white; + padding: 0; + margin: 0; + background-size: 100%; + background-position: 50% 68%; + background-repeat: repeat-y; + + background-image: url(/static/img/backdrop/book-drawer2.jpg); + + @media screen and (min-width: 62.5em) { + background-image: url(/static/img/backdrop/book-drawer2.jpg); + } + + .cite { + @include size(padding, 46px 10px 48px 0); + background: none; + color: white; + + @media screen and (min-width: 30em) { + @include size(padding-right, 40px); + } + + .vip { + @include size(margin-left, 10px); + @include size(margin-top, 2.5px); + @include size(margin-bottom, 5px); + @include size(font-size, 11px); + + @media screen and (min-width: 16em) { + padding-left: 10%; + @include size(margin-left, -18px); + } + + @media screen and (min-width: 62.5em) { + float: left; + padding-left: 0; + @include size(margin-left, 16px); + text-align: right; + @include size(width, 147px); + } + } + + .cite-body { + @include size(margin, .5px); + @include size(font-size, 20px); + line-height: 1.16em; + + @media screen and (min-width: 30em) { + @include size(font-size, 30px); + } + } + + .source { + @include size(margin-top, 16px); + @include size(margin-bottom, 16px); + @include size(margin-right, 2px); + @include size(font-size, 12px); + } + + /* Make cite body and source slide to the left. */ + .cite-body, .source { + @include size(margin-left, 10px); + + @media screen and (min-width: 16em) { + padding-left: 21.9%; + @include size(margin-left, -38px); + } + + @media screen and (min-width: 62.5em) { + padding-left: 0; + @include size(margin-left, 175px); + } + } + + /* Semi-transparent background. */ + .cite-body span, + .vip span, + .source span { + color: white; + background-color: rgb(0, 0, 0); + background-color: rgba(0, 0, 0, 0.6); + /* For IE 5.5 - 7*/ + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); + /* For IE 8*/ + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; + } + } + + /* a long cite displays smaller */ + .cite-small .cite-body { + @include size(font-size, 16px); + @media screen and (min-width: 30em) { + @include size(font-size, 20px); + } + } + + h2 { + margin: 0; + @include size(font-size, 11px); + color: #575c63; + } +} + + +#promo-box { + @include size(margin-top, 16px); + + @media screen and (min-width: 33em) { + float: right; + @include size(margin-top, -51px); + @include size(width, 320px); + } + + h1 { + @include size(padding, 20px 5px 0 10px); + @include size(height, 31px); + margin: 0; + background: #191919; + color: white; + @include mono; + @include size(font-size, 13px); + font-weight: normal; + + @media screen and (min-width: 33em) { + @include size(padding-left, 25px); + @include size(padding-right, 25px); + } + } + + #promo-box-body { + @include size(padding, 20px 5px); + @include size(border-bottom, 2px solid #efefef); + background: #efefef; + + @media screen and (min-width: 33em) { + @include size(padding-left, 28px); + @include size(padding-right, 28px); + } + + @media screen and (min-width: 62.5em) { + @include size(height, 300px); + } + + a { + display: block; + color: #6c6c6c; + } + p { + margin-top: 0; + @include size(font-size, 12px); + line-height: 1.55em; + color: #6c6c6c; + } + h2, h3 { + color: #0d777e; + @include size(font-size, 11px); + @include size(height, 27.5px); + margin: 0; + @include mono; + font-weight: normal; + + &:after { + content: " >"; + } + } + } +} + + +#main-last { + h1 { + @include size(height, 32px); + margin: 0; + @include size(padding-top, 19px); + @include size(padding-left, 10px); + + @include size(font-size, 11px); + @include mono; + font-weight: normal; + + @media screen and (min-width: 33em) { + @include size(padding-left, 19px); + } + + a { + color: black; + + &:after { + content: " >"; + } + } + } + .book-mini-box:nth-child(3) { + @media screen and (min-width: 30em) { + margin-right: 3em; + } + @media screen and (min-width: 33em) { + margin-right: 0; + } + } +} + + +.infopages-box { + margin: 0; + @include size(margin-top, 5px); + @include size(padding, 0 5px); + vertical-align: top; + color: #989898; + + @media screen and (min-width: 20em) { + display: inline-block; + @include size(width, 206px); + @include size(padding-left, 17px); + @include size(padding-right, 17px); + } + + h1 { + @include size(height, 28px); + margin: 0; + @include size(padding-top, 25px); + @include size(font-size, 11px); + color: #017e85; + font-weight: normal; + @include mono; + } + + a { + color: black; + } + + ol, ul { + @include size(font-size, 11px); + list-style: none; + padding: 0; + margin: 0; + line-height: 1.45em; + + li { + @include size(margin-bottom, 8px); + @media screen and (min-width: 62.5em) { + @include size(margin-bottom, 2.5px); + } + } + } + + .social-links { + @include size(margin-top, 10px); + + a { + @include size(margin-right, 6px); + } + } +} diff --git a/apps/wolnelektury_core/static/scss/main/menu.scss b/apps/wolnelektury_core/static/scss/main/menu.scss new file mode 100755 index 000000000..38a7d20bc --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/menu.scss @@ -0,0 +1,176 @@ +#nav-line { + background-color: #e2e2e2; + position: relative; + + @media screen and (min-width: 62.5em) { + @include size(width, 975px); + margin: auto; + } + + #show-menu { + display: block; + float: left; + @include size(line-height, 13px); + @include size(padding, 18px 13px); + color: #0c7076; + @include size(font-size, 11px); + @include mono; + + .long { + display: none; + + &:after { + @include size(padding-left, 10px); + content: url("/static/img/arrow-gray.png"); + vertical-align: top; + } + } + + @media screen and (min-width: 20em) { + .long { display: inline; } + .short { display: none; } + } + + @media screen and (min-width: 53em) { + display: none; + } + } + + ul#menu { + list-style: none; + padding: 0; + margin: 0; + + display: none; + position: absolute; + @include size(top, 49px); + left: 0; + @include size(right, 10px); + z-index: 400; + + @media screen and (min-width: 24em) { + right: auto; + } + + @media screen and (min-width: 53em) { + display: block !important; + position: static; + @include size(margin-left, 6px); + } + + li.menu { + background-color: #e2e2e2; + + @media screen and (min-width: 53em) { + float: left; + } + + a.menu { + display: block; + @include size(line-height, 13px); + @include size(padding, 18px 13px 15px); + @include size(border-bottom, 3px solid #e2e2e2); + color: #0c7076; + @include size(font-size, 11px); + @include mono; + } + + a.hidden-box-trigger:hover { + border-bottom-color: white; + } + } + } + + #lang-menu { + display: block; + float: right; + + @include size(padding-left, 25px); + @include size(padding-right, 20px); + background: #f7f7f7; + @include mono; + + @media screen and (min-width: 15em) { + position: relative; + } + + #lang-button { + display:block; + @include size(line-height, 17px); + @include size(padding-top, 16px); + @include size(padding-bottom, 16px); + + @include size(font-size, 10px); + color: #717171; + + .label { + display: none; + + @media screen and (min-width: 62.5em) { + display: inline; + } + + &:after { + @include size(padding-left, 10px); + content: url("/static/img/arrow-gray.png"); + vertical-align: top; + } + } + + .lang-flag { + @include size(font-size, 13px); + @include size(line-height, 15px); + } + } + + #lang-menu-items { + z-index: 9999; + + button { + @include mono; + display: none; + background: #f7f7f7; + color: #6f6f6f; + cursor: pointer; + width: 100%; + margin: 0; + @include size(padding, 10px 0); + + @media screen and (min-width: 62.5em) { + @include size(padding, 5px 0); + } + + border-width: 0; + @include size(border-bottom, 1px solid #ddd); + + @include size(font-size, 13px); + + &.active { + color: #000; + } + } + } + + &:hover, &.hover { + #lang-menu-items { + position: absolute; + padding: 0; + left: 0; + right: 0; + + @media screen and (min-width: 15em) { + left: auto; + @include size(width, 180px); + @include size(top, 49px); + } + @media screen and (min-width: 62.5em) { + width: 100%; + } + + button { + display: block; + } + } + } + } +} diff --git a/apps/wolnelektury_core/static/scss/main/search.scss b/apps/wolnelektury_core/static/scss/main/search.scss new file mode 100755 index 000000000..2dac56ab0 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/search.scss @@ -0,0 +1,84 @@ +/* jquery UI overrides us */ +.ui-menu .ui-menu-item a { + color: #0d7e85 !important; + line-height: 1.636em !important; +} + +.ui-widget { + font-family: Georgia !important; + @include size(font-size, 10px !important); +} + +.ui-widget-content { + background: #EEEEEE !important; /* #E2E2E2 ? */ + border-radius: 0px !important; +} + + + +.inline-tag-lists p span:first-child { + color: #281d1c; +} + +/* just on search page */ +.top-tag-list { + @include size(margin-top, 22px); + @include size(margin-bottom, 16px); +} + + +.search-result { + @include size(width, 975px); + + .book-box-body { + @include size(width, 310px); + } +} + + + +.book-list-header { + @include size(width, 975px); + padding: 0em; + @include size(margin-left, -1px); + + .book-box-inner { + min-height: 1em; + } + + p { + @include size(font-size, 24px); + @include size(margin, 5px); + } +} + +.snippets { + @include size(width, 440px); + float: right; + @include size(margin-top, -200px); + + .snippet-text { + @include size(font-size, 12px); + @include size(margin, 13px 0); + @include size(padding, 12px); + background: #f7f7f7; + } + + .anchor { + display: none; + } +} + + +.search-hint-label { + display: inline-block; + @include size(font-size, 11px); + @include size(width, 275px); + line-height: 1.636em; +} + +.search-hint-category { + @include size(font-size, 11px); + line-height: 1.636em; +} + diff --git a/apps/wolnelektury_core/static/scss/main/tag.scss b/apps/wolnelektury_core/static/scss/main/tag.scss new file mode 100755 index 000000000..844d3dac9 --- /dev/null +++ b/apps/wolnelektury_core/static/scss/main/tag.scss @@ -0,0 +1,102 @@ +.page-desc { + @include size(margin-left, 15px); +} + +#tagged-object-list { + @media screen and (min-width: 62.5em) { + .left-column, .right-column { + @include size(width, 480px); + } + } + + .see-also, .download { + float: left; + @include size(margin-top, 20px); + @include size(margin-bottom, 20px); + + h2 { + @include mono; + @include size(font-size, 11px); + margin: 0; + } + + ul { + @include size(font-size, 11px); + list-style: none; + padding: 0; + margin: 0; + } + } + + .see-also { + @include size(margin-left, 80px); + @include size(width, 143px); + } + .download { + @include size(margin-left, 20px); + } + + .left-column .see-also { + margin-left: 0; + } +} + +#description { + @include size(margin-bottom, 26px); + cursor: pointer; + + dl { + margin-top: 0; + } + dt { + display: inline; + font-weight: bold; + margin: 0; + } + dd { + display: inline; + margin: 0; + } + p { + margin-top: 0; + } + #description .meta { + list-style: none; + padding: 0; + margin: 0; + } + #description .meta li { + text-align: right; + color: #666; + @include size(font-size, 11.7px); + } +} + +.inline-tag-lists { + @include size(font-size, 11px); + + .inline-header { + @include mono; + display: inline-block; + vertical-align: top; + @include size(width, 77px); + } + + .inline-body { + display: inline-block; + vertical-align: top; + @include size(margin-bottom, 5.5px); + @include size(width, 385px); + + ul { + list-style: none; + padding: 0; + margin: 0; + + li { + display: inline-block; + @include size(margin-right, 11px); + } + } + } +} diff --git a/apps/wolnelektury_core/static/scss/polls/polls.scss b/apps/wolnelektury_core/static/scss/polls/polls.scss new file mode 100644 index 000000000..28cd5a5cf --- /dev/null +++ b/apps/wolnelektury_core/static/scss/polls/polls.scss @@ -0,0 +1,21 @@ +.poll { + width: 400px; + ul { + list-style-type: none; + } +} + +.poll-bar { + border: solid 1px #ddd; + height:6px; + margin-bottom: 10px; +} + +.poll-bar-inner { + background: orange; + height: 6px; +} + +.poll-msg { + font-weight: bold; +} \ No newline at end of file diff --git a/apps/wolnelektury_core/static/scss/tools.scss b/apps/wolnelektury_core/static/scss/tools.scss new file mode 100644 index 000000000..76869c40d --- /dev/null +++ b/apps/wolnelektury_core/static/scss/tools.scss @@ -0,0 +1,70 @@ +$default-em-size: 16px; + +@mixin size($name, $args) { + $rems: snowflake; + @each $val in $args { + $remval: $val; + @if type-of($val) == number { + @if unit($val) == "px" { + $remval: $val / $default-em-size * 1rem; + } + } + // Workaround for PySCSS issue with appending to empty lists. + @if $rems == snowflake { + $rems: $remval; + } + @else { + $rems: append($rems, $remval); + } + } + #{$name}: $args; + #{$name}: $rems; +} + +@mixin min-screen($size) { + @if unit($size) == "px" { + $size: $size / $default-em-size * 1em; + } + + @media screen and (min-width: $size) { + @content; + } +} + + +@mixin vendors($name, $args) { + @include size(-moz + $name, $args); + @include size(-webkit + $name, $args); + @include size(-moz + $name, $args); +} + +@mixin vendors($names, $args) { + @each $name in $names { + @include size($name, $args); + } +} + +@mixin box-shadow($args) { + @include vendors( + -moz-box-shadow + -webkit-box-shadow + box-shadow, + $args); +} + +@mixin mono { + font-family: "Andale Mono", "Lucida Sans Typewriter", "Courier New"; +} + +@mixin hidden-label { + display: block; + @include size(width, 1px); + @include size(height, 1px); + overflow: hidden; +} + +@mixin white-box { + @include size(border, 1px solid #ddd); + background: #fff; + @include box-shadow(2px 2px 2px #ddd); +} diff --git a/apps/wolnelektury_core/templates/main_page.html b/apps/wolnelektury_core/templates/main_page.html index a751022e1..fd51cf371 100755 --- a/apps/wolnelektury_core/templates/main_page.html +++ b/apps/wolnelektury_core/templates/main_page.html @@ -7,47 +7,47 @@ {% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %} {% block body %} -
{% render_cite cite %} -
+ {% spaceless %} -
-

- {% trans "What's new?" %} -

-
- {% chunk "promo" %} -
-
+
+

{% trans "What's new?" %}

+
+ {% chunk "promo" %} +
+
-

{% trans "Recent publications" %}

- {% cache 60 last-published-on-main %} +
+

{% trans "Recent publications" %}

+ {% cache 60 last-published-on-main LANGUAGE_CODE %} {% for book in last_published %} {% book_mini book %} {% endfor %} {% endcache %} +
-
-

{% trans "News" %}

+
+

{% trans "News" %}

{# 135 is the id of new publications category of our master blog. perhaps this URL should go to settings. #} {% cache 1800 latest-blog-posts %} {% latest_blog_posts "http://nowoczesnapolska.org.pl/feed/?cat=-135" %} {% endcache %} -
+ -
-

{% trans "Utilities" %}

+
+

{% trans "Utilities" %}

-
+ -
-

{% trans "Information" %}

+
+

{% trans "Information" %}

-
+ {% endspaceless %} diff --git a/apps/wolnelektury_core/templates/superbase.html b/apps/wolnelektury_core/templates/superbase.html index e97ede609..9ee206f57 100644 --- a/apps/wolnelektury_core/templates/superbase.html +++ b/apps/wolnelektury_core/templates/superbase.html @@ -5,6 +5,7 @@ {% load catalogue_tags funding_tags reporting_stats sponsor_tags %} + @@ -17,17 +18,10 @@ {% block title %}{% trans "Wolne Lektury" %} :: {% block titleextra %}{% endblock %}{% endblock %} - + - {% compressed_css "all" %} - - - {#% compressed_css "handheld" %#} - - + href="{% static 'opensearch.xml' %}" /> + {% compressed_css "main" %} {% block extrahead %} {% endblock %} @@ -35,45 +29,26 @@ {% block bodycontent %} {% funding link=1 closeable=1 add_class="funding-top-header" %} -
- -