From: Marek Stępniowski Date: Tue, 16 Sep 2008 17:16:45 +0000 (+0200) Subject: Added book_text view and template to repository. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/e90ee714cc724f21519efa3499dd71d03bb44db0 Added book_text view and template to repository. Added master.book.css to repository. --- diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py index f4779067c..6cecd87f6 100644 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@ -10,6 +10,7 @@ urlpatterns = patterns('catalogue.views', url(r'^lektura/(?P[a-zA-Z0-9-]+)/polki/', 'book_sets', name='book_shelves'), url(r'^fragment/(?P[0-9]+)/polki/', 'fragment_sets', name='fragment_shelves'), url(r'^polki/nowa/$', 'new_set', name='new_set'), + url(r'^lektura/(?P[a-zA-Z0-9-]+)\.html$', 'book_text', name='book_text'), url(r'^lektura/(?P[a-zA-Z0-9-]+)/$', 'book_detail', name='book_detail'), url(r'^tags/$', 'tags_starting_with', name='hint'), url(r'^szukaj/$', 'search', name='search'), diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index d8a61e35e..acf2ea244 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -136,6 +136,13 @@ def book_detail(request, slug): context_instance=RequestContext(request)) +def book_text(request, slug): + book = get_object_or_404(models.Book, slug=slug) + + return render_to_response('catalogue/book_text.html', locals(), + context_instance=RequestContext(request)) + + def logout_then_redirect(request): auth.logout(request) return HttpResponseRedirect(request.GET.get('next', '/')) diff --git a/wolnelektury/media/css/master.book.css b/wolnelektury/media/css/master.book.css new file mode 100644 index 000000000..98e142b9f --- /dev/null +++ b/wolnelektury/media/css/master.book.css @@ -0,0 +1,207 @@ +body { + font-size: 16px; + font: Georgia, "Times New Roman", serif; + line-height: 1.5em; + margin: 3em; + max-width: 36em; +} + +a { + color: blue; + text-decoration: none; +} + +/* =================================================== */ +/* = Common elements: headings, paragraphs and lines = */ +/* =================================================== */ +h1 { + font-size: 3em; + margin: 1.5em 0; + text-align: center; + line-height: 1.5em; + font-weight: bold; +} + +h2 { + font-size: 2em; + margin: 1.5em 0 0; + font-weight: bold; + line-height: 1.5em; +} + +h3 { + font-size: 1.5em; + margin: 1.5em 0 0; + font-weight: normal; + line-height: 1.5em; +} + +h4 { + font-size: 1em; + margin: 1.5em 0 0; + line-height: 1.5em; +} + +p { + margin: 0; +} + +/* ======================== */ +/* = Footnotes and themes = */ +/* ======================== */ +.theme-begin { + border-left: 0.1em solid #DDDDDD; + color: #777; + padding: 0 0.5em; + width: 7.5em; + font-style: normal; + font-weight: normal; + font-size: 16px; + position: absolute; + left: 40em; + line-height: 1.5em; + text-align: left; +} + +.annotation { + font-style: normal; + font-weight: normal; + font-size: 12px; +} + +#footnotes .annotation { + display: block; + float: left; + width: 2.5em; + clear: both; +} + +#footnotes div { + margin: 1.5em 0 0 0; +} + +#footnotes p { + margin-left: 2.5em; +} + + +/* ============= */ +/* = Numbering = */ +/* ============= */ +.anchor { + float: left; + margin: -0.2em -0.5em -0.2em -3.5em; + color: #777; + font-size: 12px; + width: 2em; + text-align: center; + padding: 0.2em 0.5em; +} + +.anchor:hover, .anchor:active { + color: #FFF; + background-color: #CCC; +} + + +/* =================== */ +/* = Custom elements = */ +/* =================== */ +span.author { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +span.collection { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-bottom: -0.25em; +} + +span.subtitle { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-top: -0.25em; +} + +div.didaskalia { + font-style: italic; + margin: 0.5em 0 0; +} + +div.kwestia { + margin: 0.5em 0 0; +} + +div.stanza { + margin: 1.5em 0 0; +} + +div.kwestia div.stanza { + margin: 0; +} + +p.paragraph { + text-align: justify; + margin: 1.5em 0 0; +} + +p.motto { + text-align: justify; + font-style: italic; + margin: 1.5em 0 0; +} + +p.motto_podpis { + font-size: 0.875em; +} + +div.fragment { + border-bottom: 0.1em solid #999; + padding-bottom: 1.5em; +} + +div.note p, div.dedication p, div.note p.paragraph, div.dedication p.paragraph { + text-align: right; + font-style: italic; +} + +hr.spacer { + height: 3em; + visibility: hidden; +} + +hr.spacer-line { + margin: 1.5em 0; + border: none; + border-bottom: 0.1em solid #000; +} + +p.spacer-asterisk { + padding: 0; + margin: 1.5em 0; + text-align: center; +} + +div.person-list ol { + list-style: none; + padding: 0 0 0 1.5em; +} + +p.place-and-time { + font-style: italic; +} + +em.math, em.foreign-word, em.book-title, em.didaskalia, em.author-emphasis { + font-style: italic; +} + +em.person { + font-style: normal; + font-variant: small-caps; +} + diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index 8fac3833a..3135bc244 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -91,6 +91,10 @@ COMPRESS_CSS = { 'all': { 'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css',), 'output_filename': 'css/all.min.css', + }, + 'book': { + 'source_filenames': ('css/master.book.css',), + 'output_filename': 'css/book.min.css', } } diff --git a/wolnelektury/templates/catalogue/book_text.html b/wolnelektury/templates/catalogue/book_text.html new file mode 100644 index 000000000..61ca7f3fb --- /dev/null +++ b/wolnelektury/templates/catalogue/book_text.html @@ -0,0 +1,15 @@ +{% load chunks compressed catalogue_tags %} + + + + + {% block title %}WolneLektury.pl{% endblock %} + + {% compressed_css "book" %} + {% compressed_js "all" %} + + + {% for chunk in book.html_file.chunks %}{{ chunk|safe }}{% endfor %} + +