From: Radek Czajka <radekczajka@nowoczesnapolska.org.pl> Date: Fri, 24 Jan 2014 09:10:55 +0000 (+0100) Subject: Fix cover display issues. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/4e17ee1bbde80e43ae80fb6f28946e9364423ec8?ds=inline;hp=-c Fix cover display issues. --- 4e17ee1bbde80e43ae80fb6f28946e9364423ec8 diff --git a/apps/catalogue/templates/catalogue/book_text.html b/apps/catalogue/templates/catalogue/book_text.html index 37a8a1ed2..8dd154646 100644 --- a/apps/catalogue/templates/catalogue/book_text.html +++ b/apps/catalogue/templates/catalogue/book_text.html @@ -9,7 +9,7 @@ {% block menu %} <li><a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short"> - <img src="{% thumbnail book.cover_thumb '80x111' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}" + <img src="{% if book.cover_thumb %}{% thumbnail book.cover_thumb '80x111' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}{% endif %}" width="80" height="111" alt="{{ book.pretty_title }}" title="{{ book.pretty_title }}"> diff --git a/apps/catalogue/templates/catalogue/player.html b/apps/catalogue/templates/catalogue/player.html index b5d6d1259..507e5d51a 100755 --- a/apps/catalogue/templates/catalogue/player.html +++ b/apps/catalogue/templates/catalogue/player.html @@ -17,12 +17,12 @@ </head> <body id="{% block bodyid %}player{% endblock %}"> - {% if book.cover %} + {% if book.cover_thumb %} <img src=" {% thumbnail book.cover_thumb "101x140" as thumb %} {{ thumb.url }} {% empty %} - {{ book.cover.url }} + {{ book.cover_thumb.url }} {% endthumbnail %} " alt="Cover" style="float: left; margin: .5em 1em 1em 1em;" /> {% endif %} diff --git a/apps/social/locale/pl/LC_MESSAGES/django.mo b/apps/social/locale/pl/LC_MESSAGES/django.mo index e540b21fb..8b72b7b4c 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 954a48908..a3053f7fe 100644 --- a/apps/social/locale/pl/LC_MESSAGES/django.po +++ b/apps/social/locale/pl/LC_MESSAGES/django.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-16 09:20+0100\n" -"PO-Revision-Date: 2012-09-06 17:10+0100\n" +"POT-Creation-Date: 2014-01-24 10:06+0100\n" +"PO-Revision-Date: 2014-01-24 10:06+0100\n" "Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n" "Language-Team: LANGUAGE <LL@li.org>\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" +"|| n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 1.5.4\n" #: admin.py:16 msgid "Background" @@ -54,7 +54,7 @@ msgstr "Sprawia, że cytat wyÅwietla siÄ mniejszym fontem." msgid "VIP" msgstr "VIP" -#: models.py:18 models.py:30 +#: models.py:18 models.py:31 msgid "link" msgstr "odnoÅnik" @@ -67,37 +67,41 @@ msgid "Sticky cites will take precedense." msgstr "Przyklejone cytaty majÄ pierwszeÅstwo." #: models.py:24 +msgid "Best image is exactly 975px wide and weights under 100kB." +msgstr "Najlepszy obraz ma szerokoÅÄ 975px i waży poniżej 100kB." + +#: models.py:25 msgid "shift" msgstr "przesuniÄcie" -#: models.py:25 +#: models.py:26 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 +#: models.py:27 msgid "title" msgstr "tytuÅ" -#: models.py:28 +#: models.py:29 msgid "author" msgstr "autor" -#: models.py:31 +#: models.py:32 msgid "license name" msgstr "nazwa licencji" -#: models.py:33 +#: models.py:34 msgid "license link" msgstr "adres licencji" -#: models.py:37 +#: models.py:38 msgid "cite" msgstr "cytat" -#: models.py:38 +#: models.py:39 msgid "cites" msgstr "cytaty" diff --git a/apps/social/models.py b/apps/social/models.py index 835773de1..df1b17599 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -20,7 +20,8 @@ class Cite(models.Model): help_text=_('Sticky cites will take precedense.')) image = models.ImageField(_('image'), upload_to='social/cite', - null=True, blank=True) + null=True, blank=True, + help_text=_('Best image is exactly 975px wide and weights under 100kB.')) 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, diff --git a/apps/wolnelektury_core/views.py b/apps/wolnelektury_core/views.py index 77cd01681..f2a774b60 100644 --- a/apps/wolnelektury_core/views.py +++ b/apps/wolnelektury_core/views.py @@ -20,7 +20,7 @@ from social.templatetags.social_tags import choose_cite def main_page(request): - last_published = Book.objects.filter(parent=None).order_by('-created_at')[:4] + last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:4] cite = choose_cite(RequestContext(request)) return render_to_response("main_page.html", locals(),