From: Marcin Koziej Date: Thu, 29 Dec 2011 16:13:05 +0000 (+0100) Subject: detail page getting shape X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/27645bc61a8cb186116d6410217011dd755823f2?ds=inline;hp=-c detail page getting shape --- 27645bc61a8cb186116d6410217011dd755823f2 diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index b4a3ec51a..c5b904d40 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -15,6 +15,7 @@ from django.conf import settings from django.utils.translation import ugettext as _ from catalogue.forms import SearchForm +from catalogue.utils import split_tags register = template.Library() @@ -275,3 +276,19 @@ def inline_tag_list(tags, choices=None): @register.inclusion_tag('catalogue/book_info.html') def book_info(book): return locals() + + +@register.inclusion_tag('catalogue/book_wide.html') +def book_wide(book): + tags = book.tags.filter(category__in=('author', 'kind', 'genre', 'epoch')) + tags = split_tags(tags) + + formats = {} + # files generated during publication + for ebook_format in book.ebook_formats: + if book.has_media(ebook_format): + formats[ebook_format] = book.get_media(ebook_format) + + extra_info = book.get_extra_info_value() + + return locals() diff --git a/scripts/make-tags b/scripts/make-tags index 0afb8592a..754e63598 100755 --- a/scripts/make-tags +++ b/scripts/make-tags @@ -8,3 +8,6 @@ if [ -n "$VIRTUAL_ENV" ]; then else echo "No Virtual env enabled, will not add it to TAGS" fi + +find $ROOT/wolnelektury/static/css -name '*.css' |xargs etags -a -o ${ROOT}/TAGS +find $ROOT/wolnelektury/static/js -name '*.js' |xargs etags -a -o ${ROOT}/TAGS diff --git a/wolnelektury/static/css/base.css b/wolnelektury/static/css/base.css index dd686c792..922915ac6 100755 --- a/wolnelektury/static/css/base.css +++ b/wolnelektury/static/css/base.css @@ -69,9 +69,11 @@ h2 { .page-desc { margin-left: 1.5em; } + .inline-tag-lists { font-size: 1.1em; } + #themes-list-toggle:after { padding-left: 1em; content: "↓"; diff --git a/wolnelektury/static/css/book_box.css b/wolnelektury/static/css/book_box.css index b51750287..aa50e67f4 100755 --- a/wolnelektury/static/css/book_box.css +++ b/wolnelektury/static/css/book_box.css @@ -1,4 +1,4 @@ -.book-mini-box, .book-box { +.book-wide-box, .book-mini-box, .book-box { display: inline-block; margin: 0; vertical-align: top; @@ -13,6 +13,10 @@ width: 16.15em; } +.book-wide-box { + width: 98.5em; +} + .book-mini-box a, .book-box-inner { display: block; color: black; @@ -36,14 +40,14 @@ margin: .5em; } -.book-mini-box img, .book-box img { +.book-mini-box img, .book-box img, .book-wide-box img { width: 13.9em; height: 19.3em; } .book-mini-box img { margin-bottom: 1.8em; } -.book-box img { +.book-box img, .book-wide-box img { float: left; margin-right: 1.5em; } @@ -132,6 +136,16 @@ margin-right: .25em; vertical-align: middle; } + +ul.book-box-tools { + margin: 0; + padding: 0; +} + +.book-box-tools li { + display: inline-block; +} + .book-box-read { width: 11em; } @@ -141,3 +155,38 @@ .book-box-audiobook { width: 8em; } + +.book-wide-box .right-column { + float: right; + width: 41.5em; +} + +.book-wide-box blockquote.cite-body { + /* @ 18pt */ + width: 100%; /*23.055em;*/ + height: 7.222em; + background-color: #f7f7f7; + margin: 0; + position: relative; + top: -0.444em; + right: -0.555em; + vertical-align: center; +} + +.book-wide-box blockquote div { + padding: 0.888em; +} + +.book-wide-box #other-tools { + float: left; + width: 14.5em; + margin-left: 1.5em; + +} + + +.book-wide-box #other-download { + float: left; + width 22.5em; + margin: 0em 1.5em 0em 1.5em +} diff --git a/wolnelektury/static/css/header.css b/wolnelektury/static/css/header.css index 8615d8b59..04f2c8714 100755 --- a/wolnelektury/static/css/header.css +++ b/wolnelektury/static/css/header.css @@ -37,7 +37,7 @@ #logo { position: absolute; - top: 5.5em; + top: 1.9em; margin-left: 1.5em; } diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index 4b4ee2f18..0a8b2236c 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -9,206 +9,8 @@ {% block bodyid %}book-detail{% endblock %} {% block body %} -

{% book_title book %}

-
- +{% book_wide book %} - {% if extra_info.license %} -

{% trans "Work is licensed under " %} {{ extra_info.license_description }}.

- {% endif %} -

{% trans "Based on" %}: {{ extra_info.source_name }}

- {% if book.has_description %} -
-
{{ book.description|safe }}
-
{{ book.description|safe|truncatewords_html:30 }}
-
-

- {% endif %} -
-

{% trans "Put a book" %} {% trans "on the shelf!" %}

-
-
- {% if book.has_html_file %} - {% trans "Read online" %} - {% endif %} -
- {% if book.pdf_file %} - {% trans - {% endif %} - {% if book.epub_file %} - {% trans - {% endif %} - {% if book.mobi_file %} - {% trans - {% endif %} - {% if book.txt_file %} - {% trans - {% endif %} - - {% if book.pdf_file %} -
{% trans "Dowload customized PDF" %}. - {% endif %} - -
- {% if book.has_mp3_file or book.has_ogg_file or book.has_daisy_file %} -

- {% trans "Audiobooks" %}: - - {% if book.has_mp3_file %}MP3{% endif %} - {% if book.has_ogg_file %}Ogg Vorbis{% endif %} - {% if book.has_daisy_file %}DAISY{% endif %} - -

-
- Speaker icon - {% if book.has_mp3_file %} -
    - {% for media in book.get_mp3 %} -
  • - {{ media.name }}
    - {% trans "Artist" %}: {{ media.get_extra_info_value.artist_name }}
    - {% trans "Director"%}: {{ media.get_extra_info_value.director_name }}
    - - - - - - -
  • - {% endfor %} -
- {% endif %} - {% if book.has_ogg_file %} - - {% endif %} - {% if book.has_daisy_file %} - - {% endif %} -
- {% if projects|length > 1 %} -

{% trans "Audiobooks were prepared as a part of the projects:" %}

-
    - {% for cs, fb in projects %} -
  • - {% if fb %} - {% blocktrans %}{{ cs }}, funded by {{ fb }}{% endblocktrans %} - {% else %} - {{ cs }} - {% endif %} -
  • - {% endfor %} -
- {% else %} -

- {% with projects.0.0 as cs %} - {% with projects.0.1 as fb %} - {% if fb %} - {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project funded by {{ fb }}.{% endblocktrans %} - {% else %} - {% blocktrans %}Audiobooks were prepared as a part of the {{ cs }} project.{% endblocktrans %} - {% endif %} - {% endwith %} - {% endwith %} -

- {% endif %} - {% endif %} -
-
- - {% if book_children %} - {% autopaginate book_children 10 %} -
-
    - {% for book in book_children %} -
  1. {{ book.short_html }}
  2. - {% endfor %} -
-
- {% paginate %} - {% endif %} - -
- -
-
-

{% trans "Details" %}

-
    -
  • - {% trans "Author" %}: - {% for tag in categories.author %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
  • -
  • - {% trans "Epoch" %}: - {% for tag in categories.epoch %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
  • -
  • - {% trans "Kind" %}: - {% for tag in categories.kind %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
  • -
  • - {% trans "Genre" %}: - {% for tag in categories.genre %} - {{ tag }}{% if not forloop.last %}, {% endif %} - {% endfor %} -
  • -
-

{% trans "Other resources" %}

- -

{% trans "View XML source" %}

-

Miksuj ten utwór

-
-
-

{% trans "Work's themes " %}

- -
-
-
{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_short.html b/wolnelektury/templates/catalogue/book_short.html index 8ac23a3a6..5a9b17de9 100644 --- a/wolnelektury/templates/catalogue/book_short.html +++ b/wolnelektury/templates/catalogue/book_short.html @@ -1,6 +1,6 @@ {% load i18n %} {% load thumbnail %} -
+
{% if book.cover %} @@ -13,6 +13,8 @@ " alt="Cover" /> {% endif %} + {% block right-column %} + {% endblock %}
@@ -75,5 +77,7 @@ {% endif %} + {% block box-append %} + {% endblock %}
diff --git a/wolnelektury/templates/catalogue/book_wide.html b/wolnelektury/templates/catalogue/book_wide.html new file mode 100644 index 000000000..1cfde2e14 --- /dev/null +++ b/wolnelektury/templates/catalogue/book_wide.html @@ -0,0 +1,35 @@ +{% extends "catalogue/book_short.html" %} +{% load i18n %} + +{% block box-class %}book-wide-box{% endblock %} + +{% block right-column %} +
+
+
Ten, który walczy z potworami powinien zadbać, by sam nie stał się potworem. + Gdy długo spoglądamy w otchłań, otchłań spogląda również w nas.
+
+ +
+

{% trans "See" %}

+ +
+
+

{% trans "Download" %}

+

{% trans "Download all audiobooks for this book" %}

+
+
+{% endblock %}