Added book_text view and template to repository.
authorMarek Stępniowski <marek@stepniowski.com>
Tue, 16 Sep 2008 17:16:45 +0000 (19:16 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Tue, 16 Sep 2008 17:16:45 +0000 (19:16 +0200)
Added master.book.css to repository.

apps/catalogue/urls.py
apps/catalogue/views.py
wolnelektury/media/css/master.book.css [new file with mode: 0644]
wolnelektury/settings.py
wolnelektury/templates/catalogue/book_text.html [new file with mode: 0644]

index f477906..6cecd87 100644 (file)
@@ -10,6 +10,7 @@ urlpatterns = patterns('catalogue.views',
     url(r'^lektura/(?P<slug>[a-zA-Z0-9-]+)/polki/', 'book_sets', name='book_shelves'),
     url(r'^fragment/(?P<id>[0-9]+)/polki/', 'fragment_sets', name='fragment_shelves'),
     url(r'^polki/nowa/$', 'new_set', name='new_set'),
+    url(r'^lektura/(?P<slug>[a-zA-Z0-9-]+)\.html$', 'book_text', name='book_text'),
     url(r'^lektura/(?P<slug>[a-zA-Z0-9-]+)/$', 'book_detail', name='book_detail'),
     url(r'^tags/$', 'tags_starting_with', name='hint'),
     url(r'^szukaj/$', 'search', name='search'),
index d8a61e3..acf2ea2 100644 (file)
@@ -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 (file)
index 0000000..98e142b
--- /dev/null
@@ -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;
+}
+
index 8fac383..3135bc2 100644 (file)
@@ -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 (file)
index 0000000..61ca7f3
--- /dev/null
@@ -0,0 +1,15 @@
+{% load chunks compressed catalogue_tags %}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+        <title>{% block title %}WolneLektury.pl{% endblock %}</title>
+        <link rel="icon" href="/media/img/favicon.png" type="image/x-icon" />
+        {% compressed_css "book" %}
+        {% compressed_js "all" %}
+    </head>
+    <body>
+        {% for chunk in book.html_file.chunks %}{{ chunk|safe }}{% endfor %}
+    </body>
+</html>