From: Marcin Koziej Date: Mon, 10 Sep 2012 13:03:33 +0000 (+0200) Subject: Merge branch 'master' into sunburnt X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/ac6111b68183ba7da48252eb0f7389b24ede20a9?hp=d6c2be651d0cc889b1dbc5b73c7659a8a2ff7704 Merge branch 'master' into sunburnt --- diff --git a/apps/oai/handlers.py b/apps/oai/handlers.py index 30669ac95..59e599c98 100644 --- a/apps/oai/handlers.py +++ b/apps/oai/handlers.py @@ -3,6 +3,7 @@ from catalogue.models import Book, Tag from api.models import Deleted from api.handlers import WL_BASE from librarian.dcparser import BookInfo +from librarian import WLURI from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from datetime import datetime @@ -80,7 +81,10 @@ class Catalogue(common.ResumptionOAIPMH): finally: book.xml_file.close() md = wl_dc_reader(xml) - return md.getMap() + m = md.getMap() + if book.parent: + m['isPartOf'] = [str(WLURI.from_slug(book.parent.slug))] + return m def record_for_book(self, book, headers_only=False): meta = None diff --git a/apps/oai/urls.py b/apps/oai/urls.py index 38703ab91..406209f7f 100644 --- a/apps/oai/urls.py +++ b/apps/oai/urls.py @@ -2,4 +2,4 @@ from django.conf.urls.defaults import * urlpatterns = patterns('oai.views', - url(r'^$', 'oaipmh')) + url(r'^$', 'oaipmh', name='oaipmh')) diff --git a/apps/social/admin.py b/apps/social/admin.py index f32f42612..01b4c6578 100755 --- a/apps/social/admin.py +++ b/apps/social/admin.py @@ -3,12 +3,27 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.contrib import admin +from django.utils.translation import ugettext_lazy as _ from social.models import Cite class CiteAdmin(admin.ModelAdmin): - list_display = ['text', 'vip', 'small'] + list_display = ['text', 'sticky', 'vip', 'small', 'has_image'] + fieldsets = ( + (None, {'fields': ('book', 'text', 'small', 'vip', 'link', 'sticky')}), + ( + _('Background'), + {'fields': ('image', 'image_shift', 'image_title', 'image_author', + 'image_link', 'image_license', 'image_license_link') + } + ) + ) + + def has_image(self, cite): + return bool(cite.image) + has_image.description = _('image') + has_image.boolean = True admin.site.register(Cite, CiteAdmin) diff --git a/apps/social/locale/pl/LC_MESSAGES/django.mo b/apps/social/locale/pl/LC_MESSAGES/django.mo index 6a9092134..7ce37b67f 100644 Binary files a/apps/social/locale/pl/LC_MESSAGES/django.mo and b/apps/social/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/social/locale/pl/LC_MESSAGES/django.po b/apps/social/locale/pl/LC_MESSAGES/django.po index 2ebcd09a6..da3bf79d8 100644 --- a/apps/social/locale/pl/LC_MESSAGES/django.po +++ b/apps/social/locale/pl/LC_MESSAGES/django.po @@ -7,16 +7,24 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-07-19 11:40+0200\n" -"PO-Revision-Date: 2012-07-16 15:13+0100\n" -"Last-Translator: Marcin Koziej \n" +"POT-Creation-Date: 2012-09-06 17:09+0200\n" +"PO-Revision-Date: 2012-09-06 17:10+0100\n" +"Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2)\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" + +#: admin.py:16 +msgid "Background" +msgstr "Obraz tła" + +#: admin.py:25 +#: models.py:22 +msgid "image" +msgstr "obraz" #: forms.py:23 msgid "Tags (comma-separated)" @@ -24,7 +32,11 @@ msgstr "Tagi (rozdzielone przecinkami)" #: forms.py:47 msgid "Name of the new shelf" -msgstr "" +msgstr "Nazwa nowej półki" + +#: models.py:13 +msgid "book" +msgstr "książka" #: models.py:14 msgid "text" @@ -34,35 +46,73 @@ msgstr "tekst" msgid "small" msgstr "mały" -#: models.py:15 +#: models.py:16 msgid "Make this cite display smaller." msgstr "Sprawia, że cytat wyświetla się mniejszym fontem." -#: models.py:16 +#: models.py:17 msgid "VIP" -msgstr "" +msgstr "VIP" -#: models.py:17 +#: models.py:18 +#: models.py:30 msgid "link" -msgstr "" +msgstr "odnośnik" + +#: models.py:19 +msgid "sticky" +msgstr "przyklejony" + +#: models.py:20 +msgid "Sticky cites will take precedense." +msgstr "Przyklejone cytaty mają pierwszeństwo." + +#: models.py:24 +msgid "shift" +msgstr "przesunięcie" + +#: models.py:25 +msgid "Vertical shift, in percents. 0 means top, 100 is bottom. Default is 50%." +msgstr "Przesunięcie w pionie, w procentach. 0 to wyrównanie do górnej krawędzi, 100 do dolnej. Domyślne jest 50%." + +#: models.py:26 +msgid "title" +msgstr "tytuł" + +#: models.py:28 +msgid "author" +msgstr "autor" + +#: models.py:31 +msgid "license name" +msgstr "nazwa licencji" + +#: models.py:33 +msgid "license link" +msgstr "adres licencji" + +#: models.py:37 +msgid "cite" +msgstr "cytat" + +#: models.py:38 +msgid "cites" +msgstr "cytaty" #: templates/social/cite_promo.html:6 msgid "recommends" msgstr "poleca" -#: templates/social/my_shelf.html:5 templates/social/my_shelf.html.py:11 +#: templates/social/my_shelf.html:5 +#: templates/social/my_shelf.html.py:11 msgid "My shelf" msgstr "Moja półka" #: templates/social/my_shelf.html:16 -msgid "" -"Add works to your shelf by clicking on the star on the page of the work. The " -"work will then show up on My shelf page." -msgstr "" -"Aby dodać pozycję do swojej półki, należy zaznaczyć gwiazdkę znajdującą się " -"na stronie utworu. Po jej zaznaczeniu publikacja pojawi się w zakładce Moja " -"półka." +msgid "Add works to your shelf by clicking on the star on the page of the work. The work will then show up on My shelf page." +msgstr "Aby dodać pozycję do swojej półki, należy zaznaczyć gwiazdkę znajdującą się na stronie utworu. Po jej zaznaczeniu publikacja pojawi się w zakładce Moja półka." #: templates/social/sets_form.html:7 msgid "Remove from my shelf" msgstr "Usuń z mojej półki" + diff --git a/apps/social/migrations/0002_auto__add_field_cite_sticky__add_field_cite_image__add_field_cite_imag.py b/apps/social/migrations/0002_auto__add_field_cite_sticky__add_field_cite_image__add_field_cite_imag.py new file mode 100644 index 000000000..32e8c4357 --- /dev/null +++ b/apps/social/migrations/0002_auto__add_field_cite_sticky__add_field_cite_image__add_field_cite_imag.py @@ -0,0 +1,115 @@ +# -*- 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 'Cite.sticky' + db.add_column('social_cite', 'sticky', + self.gf('django.db.models.fields.BooleanField')(default=False), + keep_default=False) + + # Adding field 'Cite.image' + db.add_column('social_cite', 'image', + self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True), + keep_default=False) + + # Adding field 'Cite.image_title' + db.add_column('social_cite', 'image_title', + self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), + keep_default=False) + + # Adding field 'Cite.image_author' + db.add_column('social_cite', 'image_author', + self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), + keep_default=False) + + # Adding field 'Cite.image_link' + db.add_column('social_cite', 'image_link', + self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True), + keep_default=False) + + # Adding field 'Cite.image_license' + db.add_column('social_cite', 'image_license', + self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), + keep_default=False) + + # Adding field 'Cite.image_license_link' + db.add_column('social_cite', 'image_license_link', + self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Cite.sticky' + db.delete_column('social_cite', 'sticky') + + # Deleting field 'Cite.image' + db.delete_column('social_cite', 'image') + + # Deleting field 'Cite.image_title' + db.delete_column('social_cite', 'image_title') + + # Deleting field 'Cite.image_author' + db.delete_column('social_cite', 'image_author') + + # Deleting field 'Cite.image_link' + db.delete_column('social_cite', 'image_link') + + # Deleting field 'Cite.image_license' + db.delete_column('social_cite', 'image_license') + + # Deleting field 'Cite.image_license_link' + db.delete_column('social_cite', 'image_license_link') + + + models = { + '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'}), + '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'}) + }, + 'social.cite': { + 'Meta': {'ordering': "('vip', 'text')", 'object_name': 'Cite'}, + 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'image_author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'image_license': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'image_license_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'image_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'image_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'small': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'text': ('django.db.models.fields.TextField', [], {}), + 'vip': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['social'] \ No newline at end of file diff --git a/apps/social/migrations/0003_auto__add_field_cite_image_shift__chg_field_cite_book.py b/apps/social/migrations/0003_auto__add_field_cite_image_shift__chg_field_cite_book.py new file mode 100644 index 000000000..3c04611c6 --- /dev/null +++ b/apps/social/migrations/0003_auto__add_field_cite_image_shift__chg_field_cite_book.py @@ -0,0 +1,80 @@ +# -*- 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 'Cite.image_shift' + db.add_column('social_cite', 'image_shift', + self.gf('django.db.models.fields.IntegerField')(null=True, blank=True), + keep_default=False) + + # Adding index on 'Cite', fields ['sticky'] + db.create_index('social_cite', ['sticky']) + + + # Changing field 'Cite.book' + db.alter_column('social_cite', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['catalogue.Book'], null=True)) + + def backwards(self, orm): + # Removing index on 'Cite', fields ['sticky'] + db.delete_index('social_cite', ['sticky']) + + # Deleting field 'Cite.image_shift' + db.delete_column('social_cite', 'image_shift') + + + # Changing field 'Cite.book' + db.alter_column('social_cite', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['catalogue.Book'])) + + models = { + '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'}), + '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'}) + }, + 'social.cite': { + 'Meta': {'ordering': "('vip', 'text')", 'object_name': 'Cite'}, + 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'image_author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'image_license': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'image_license_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'image_link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'image_shift': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'image_title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'small': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'sticky': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), + 'text': ('django.db.models.fields.TextField', [], {}), + 'vip': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['social'] \ No newline at end of file diff --git a/apps/social/models.py b/apps/social/models.py index 753980577..835773de1 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -10,14 +10,32 @@ from catalogue.models import Book class Cite(models.Model): - book = models.ForeignKey(Book) + book = models.ForeignKey(Book, verbose_name=_('book'), null=True, blank=True) text = models.TextField(_('text')) - small = models.BooleanField(_('small'), default=False, help_text=_('Make this cite display smaller.')) + small = models.BooleanField(_('small'), default=False, + help_text=_('Make this cite display smaller.')) vip = models.CharField(_('VIP'), max_length=128, null=True, blank=True) link = models.URLField(_('link')) + sticky = models.BooleanField(_('sticky'), default=False, db_index=True, + help_text=_('Sticky cites will take precedense.')) + + image = models.ImageField(_('image'), upload_to='social/cite', + null=True, blank=True) + image_shift = models.IntegerField(_('shift'), null=True, blank=True, + help_text=_(u'Vertical shift, in percents. 0 means top, 100 is bottom. Default is 50%.')) + image_title = models.CharField(_('title'), max_length=255, + null=True, blank=True) + image_author = models.CharField(_('author'), + max_length=255, blank=True, null=True) + image_link = models.URLField(_('link'), blank=True, null=True) + image_license = models.CharField(_('license name'), + max_length=255, blank=True, null=True) + image_license_link = models.URLField(_('license link'), blank=True, null=True) class Meta: ordering = ('vip', 'text') + verbose_name = _('cite') + verbose_name_plural = _('cites') def __unicode__(self): return u"%s: %s…" % (self.vip, self.text[:60]) diff --git a/apps/social/templates/social/cite_promo.html b/apps/social/templates/social/cite_promo.html index 0554d23af..c3a73e89a 100755 --- a/apps/social/templates/social/cite_promo.html +++ b/apps/social/templates/social/cite_promo.html @@ -8,7 +8,9 @@
{{ cite.text|linebreaksbr|safe }}
+ {% if cite.book %}

{{ cite.book.pretty_title }}

+ {% endif %} {% else %} {% if fallback %} diff --git a/apps/social/templatetags/social_tags.py b/apps/social/templatetags/social_tags.py index 29a43098b..889160200 100755 --- a/apps/social/templatetags/social_tags.py +++ b/apps/social/templatetags/social_tags.py @@ -12,9 +12,9 @@ register = template.Library() register.filter('likes', likes) -@register.inclusion_tag('social/cite_promo.html', takes_context=True) -def cite_promo(context, ctx=None, fallback=False): - """Choose""" +@register.assignment_tag(takes_context=True) +def choose_cite(context, ctx=None): + """Choose a cite for main page, for book or for set of tags.""" try: request = context['request'] assert request.user.is_staff @@ -29,10 +29,21 @@ def cite_promo(context, ctx=None, fallback=False): cites = cites_for_tags([ctx.book_tag()]) else: cites = cites_for_tags(ctx) - cite = cites.order_by('?')[0] if cites.exists() else None + cite = cites.order_by('-sticky', '?')[0] if cites.exists() else None + return cite + +@register.inclusion_tag('social/cite_promo.html') +def render_cite(cite): return { 'cite': cite, + } + + +@register.inclusion_tag('social/cite_promo.html', takes_context=True) +def cite_promo(context, ctx=None, fallback=False): + return { + 'cite': choose_cite(context, ctx), 'fallback': fallback, 'ctx': ctx, } diff --git a/apps/wolnelektury_core/static/img/logo-fbc.png b/apps/wolnelektury_core/static/img/logo-fbc.png new file mode 100644 index 000000000..c7802d3d3 Binary files /dev/null and b/apps/wolnelektury_core/static/img/logo-fbc.png differ diff --git a/apps/wolnelektury_core/templates/main_page.html b/apps/wolnelektury_core/templates/main_page.html index f9ff45ec4..6b7c46aac 100755 --- a/apps/wolnelektury_core/templates/main_page.html +++ b/apps/wolnelektury_core/templates/main_page.html @@ -7,9 +7,12 @@ {% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %} {% block body %} - -
- {% cite_promo %} +
+ {% render_cite cite %}
{% spaceless %} @@ -56,6 +59,7 @@
  • {% trans "Missing a book?" %}
  • {% trans "Publishing plan" %}
  • API
  • +
  • OAI-PMH
  • Leśmianator
  • Materiały do nauki j. polskiego
  • @@ -89,8 +93,19 @@ {% block add_footer %}

    {% trans "Image used:" %} -books about architecture, -saikofish@Flickr, -CC BY NC SA. +{% if cite.image %} + {% if cite.image_link %}{% endif %} + {% if cite.image_title %} + {{ cite.image_title }}{% else %} + untitled{% endif %}{% if cite.image_link %}{% endif %}, + {% if cite.image_author %}{{ cite.image_author }},{% endif %} + {% if cite.image_license_link %}{% endif %} + {{ cite.image_license }} + {% if cite.image_license_link %}{% endif %} +{% else %} + books about architecture, + saikofish@Flickr, + CC BY NC SA. +{% endif %}

    {% endblock %} diff --git a/apps/wolnelektury_core/views.py b/apps/wolnelektury_core/views.py index f8de19efd..f62a1426a 100644 --- a/apps/wolnelektury_core/views.py +++ b/apps/wolnelektury_core/views.py @@ -16,11 +16,13 @@ from django.conf import settings from ajaxable.utils import AjaxableFormView from catalogue.models import Book from ajaxable.utils import placeholdized +from social.templatetags.social_tags import choose_cite @never_cache def main_page(request): last_published = Book.objects.filter(parent=None).order_by('-created_at')[:4] + cite = choose_cite(RequestContext(request)) return render_to_response("main_page.html", locals(), context_instance=RequestContext(request)) diff --git a/lib/librarian b/lib/librarian index 8059679ab..1ffcf32a8 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit 8059679abd4a0a2e554457dd6266941a31356f73 +Subproject commit 1ffcf32a8d795681f54bd125ca45e908da5ed3fb