Fix cover display issues.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 24 Jan 2014 09:10:55 +0000 (10:10 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Fri, 24 Jan 2014 09:36:39 +0000 (10:36 +0100)
apps/catalogue/templates/catalogue/book_text.html
apps/catalogue/templates/catalogue/player.html
apps/social/locale/pl/LC_MESSAGES/django.mo
apps/social/locale/pl/LC_MESSAGES/django.po
apps/social/models.py
apps/wolnelektury_core/views.py

index 37a8a1e..8dd1546 100644 (file)
@@ -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 }}">
index b5d6d12..507e5d5 100755 (executable)
     </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 %}
index e540b21..8b72b7b 100644 (file)
Binary files a/apps/social/locale/pl/LC_MESSAGES/django.mo and b/apps/social/locale/pl/LC_MESSAGES/django.mo differ
index 954a489..a3053f7 100644 (file)
@@ -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"
 
index 835773d..df1b175 100644 (file)
@@ -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,
index 77cd016..f2a774b 100644 (file)
@@ -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(),