From: Marcin Koziej Date: Thu, 5 Dec 2013 16:15:38 +0000 (+0100) Subject: tags/infos/fixed viewer X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/892198abd0775399c80104d6ee16aa0f1092045d?ds=inline tags/infos/fixed viewer --- diff --git a/apps/picture/models.py b/apps/picture/models.py index fa602e66c..65002aeb1 100644 --- a/apps/picture/models.py +++ b/apps/picture/models.py @@ -41,6 +41,9 @@ class Picture(models.Model): image_file = ImageField(_('image_file'), upload_to="images", storage=picture_storage) html_file = models.FileField('html_file', upload_to="html", storage=picture_storage) areas = jsonfield.JSONField(_('picture areas'), default={}, editable=False) + extra_info = jsonfield.JSONField(_('extra information'), default={}) + culturepl_link = models.CharField(blank=True, max_length=240) + wiki_link = models.CharField(blank=True, max_length=240) objects = models.Manager() tagged = managers.ModelTaggedItemManager(catalogue.models.Tag) @@ -108,6 +111,7 @@ class Picture(models.Model): raise Picture.AlreadyExists('Picture %s already exists' % picture_xml.slug) picture.title = picture_xml.picture_info.title + picture.extra_info = picture_xml.picture_info.to_dict() motif_tags = set() thing_tags = set() diff --git a/apps/picture/templates/picture/picture_short.html b/apps/picture/templates/picture/picture_short.html index edc59b84f..e7bbdd881 100644 --- a/apps/picture/templates/picture/picture_short.html +++ b/apps/picture/templates/picture/picture_short.html @@ -42,6 +42,13 @@ {% endfor %} + {% trans "Genre" %}:  + + {% for tag in tags.genre %} + {{ tag.name }} {% if not forloop.last %},{% endif %} + {% endfor %} + + {% endspaceless %} @@ -61,6 +68,11 @@ --> + {% block book-box-extra-info %}{% endblock %} + {% block box-append %} + {% endblock %} + {% block right-column %} + {% endblock %}
diff --git a/apps/picture/templates/picture/picture_viewer.html b/apps/picture/templates/picture/picture_viewer.html index fbf361030..d190af8a2 100644 --- a/apps/picture/templates/picture/picture_viewer.html +++ b/apps/picture/templates/picture/picture_viewer.html @@ -18,20 +18,20 @@ - {% else %} @@ -34,37 +45,38 @@ {% block right-column %}
- INFO - {% comment %}
+

{% trans "See" %}

+ + {% comment %}

{% trans "Download" %}

  • {% if related.media.mp3 or related.media.ogg or related.media.daisy %} {% trans "Download all audiobooks for this book" %}: - {% download_audio book %}. + {% download_audio book %}. {% endif %}
  • {% custom_pdf_link_li book %}
-
{% endcomment %} +
+ {% endcomment %}
{% endblock %} diff --git a/apps/picture/templatetags/picture_tags.py b/apps/picture/templatetags/picture_tags.py index 3fe5b360c..ef297c9eb 100644 --- a/apps/picture/templatetags/picture_tags.py +++ b/apps/picture/templatetags/picture_tags.py @@ -6,21 +6,23 @@ register = template.Library() @register.inclusion_tag('picture/picture_short.html', takes_context=True) def picture_short(context, picture): - return { + context.update({ 'picture': picture, 'main_link': picture.get_absolute_url(), # 'related': picture.related_info(), 'request': context.get('request'), 'tags': split_tags(picture.tags), - } + }) + return context @register.inclusion_tag('picture/picture_wide.html', takes_context=True) def picture_wide(context, picture): - return { + context.update({ 'picture': picture, 'main_link': picture.get_absolute_url(), # 'related': picture.related_info(), 'request': context.get('request'), 'tags': split_tags(picture.tags), - } + }) + return context diff --git a/apps/picture/views.py b/apps/picture/views.py index 65e5fa4b5..c39969aca 100644 --- a/apps/picture/views.py +++ b/apps/picture/views.py @@ -38,7 +38,10 @@ def picture_detail(request, slug): for tag in picture.tags.iterator(): categories.setdefault(tag.category, []).append(tag) - picture_themes = [] + themes = categories.get('theme', []) + things = categories.get('thing', []) + + extra_info = picture.extra_info return render_to_response("picture/picture_detail.html", locals(), context_instance=RequestContext(request)) diff --git a/apps/wolnelektury_core/static/css/book_box.css b/apps/wolnelektury_core/static/css/book_box.css index 8a7cff20c..21299f911 100755 --- a/apps/wolnelektury_core/static/css/book_box.css +++ b/apps/wolnelektury_core/static/css/book_box.css @@ -215,6 +215,10 @@ width: 30em; } +.picture.book-wide-box #theme-list-wrapper { + margin-left: 55em; +} + .book-box-read a:before { @@ -273,7 +277,10 @@ ul.inline-items li { float: left; width: 14.5em; margin: 5em 0 0 1.5em; - +} + +.picture.book-wide-box .other-tools { + margin: 5em 0 0 0; } .book-wide-box .other-download { diff --git a/apps/wolnelektury_core/static/css/master.picture.css b/apps/wolnelektury_core/static/css/master.picture.css index c4e952cf0..d731bd04e 100644 --- a/apps/wolnelektury_core/static/css/master.picture.css +++ b/apps/wolnelektury_core/static/css/master.picture.css @@ -4,12 +4,16 @@ position:absolute; top: 0; bottom: 0; + z-index: 10; } #picture-view .picture-wrap { margin: 3rem auto 1rem auto; display: block; -// position: absolute; + z-index: 10; +} +#picture-view .picture-wrap img { + z-index: 10; } #picture-view .picture-wrap { @@ -46,13 +50,17 @@ .toolbar { position: fixed; - top: 1.5rem; + //top: 1.5rem; left: 0rem; color: #FFF; z-index: 99; list-style: none; padding: 0; margin: 0; + + background: #333; + opacity: 0.9; + width: 8rem; } .toolbar ul { @@ -64,14 +72,14 @@ } .toolbar .button a { - background: #333; - opacity: 0.9; + //background: #333; + //opacity: 0.9; display: block; height:1.5rem; text-align: center; color: #FFF; - padding: 0.2rem; + padding: 0.2rem 0; text-decoration: none; } @@ -80,7 +88,7 @@ } #picture-view .toolbar .button.square a { - width:1.5rem; + width: 4rem; //1.5rem; } li.button { @@ -98,4 +106,25 @@ li.button.square { #picture-view .toolbar.button a:active { color: yellow; +} + +.moveright { + margin-left: 8rem !important; +} + +#sponsors { + position: absolute; + display: block; + top: 3.5rem; + right: 2rem; + z-index:1; + width: 9rem; +} +#sponsors div { + z-index: -10; +} + +#sponsors img { + width: 100%; + z-index: -10; } \ No newline at end of file diff --git a/apps/wolnelektury_core/static/css/screen.css b/apps/wolnelektury_core/static/css/screen.css index 8522996dc..9059f556a 100644 --- a/apps/wolnelektury_core/static/css/screen.css +++ b/apps/wolnelektury_core/static/css/screen.css @@ -86,6 +86,15 @@ margin-top: -23em; } +.picture.book-wide-box .right-column { + float: none; + width: 41.5em; + top: 0; + margin-left: 55em; + margin-top: 0em; +} + + .book-wide-box #theme-list-wrapper { margin-bottom: 0; } diff --git a/apps/wolnelektury_core/static/img/logo_nck.jpg b/apps/wolnelektury_core/static/img/logo_nck.jpg new file mode 100644 index 000000000..c030f6a9a Binary files /dev/null and b/apps/wolnelektury_core/static/img/logo_nck.jpg differ