From e0de7a6c08bbbd31fae2e7b796457a982cb3e895 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 1 Oct 2015 22:10:21 -0400 Subject: did a lot of work on the books section --- design/sass/_books.scss | 57 ++++++++++++++++++++++++++++++++++++ design/sass/_queries.scss | 4 +++ design/templates/admin/buttons.html | 5 ++-- design/templates/archives/books.html | 55 ++++++++++++++++++++++++++++++++++ design/templates/details/book.html | 47 +++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 design/sass/_books.scss create mode 100644 design/templates/archives/books.html create mode 100644 design/templates/details/book.html (limited to 'design') diff --git a/design/sass/_books.scss b/design/sass/_books.scss new file mode 100644 index 0000000..3ed8e2e --- /dev/null +++ b/design/sass/_books.scss @@ -0,0 +1,57 @@ +.book { + margin-top: 2em; + @include breakpoint(gamma) { + margin-top: 3em; + } +} +.book:after { + @include constrain_narrow; + color: white; + @include faded_line_after; + margin-top: 2em; + @include breakpoint(gamma) { + margin-top: 3em; + } +} +.book-metadata { + @extend %clearfix; + text-align: left; + dd { + display: inline; + margin: 0; + } + dd:after{ + display: block; + content: ''; + } + dt{ + display: inline-block; + } + dt:after { + content: ":"; + } +} +.book-title { + @include constrain_narrow; + line-height: 1.3; +} +.book-cover { +} +.thoughts, .highlights, .meta-cover { + @include constrain_narrow; + text-align: left; + p { + max-width: 100%; + } +} +.thoughts h5, .highlights h4, .meta-cover h5 { + font-weight: 500; + letter-spacing: 1px; + margin: 3em 0 .5em 0; + @include generic_sans; + @include smcaps; + @include fontsize(14); +} +.highlights .foot { + @include fontsize(14); +} diff --git a/design/sass/_queries.scss b/design/sass/_queries.scss index cbfc3c3..1d7f3ef 100644 --- a/design/sass/_queries.scss +++ b/design/sass/_queries.scss @@ -1,5 +1,6 @@ $breakpoint-alpha: 38em; $breakpoint-beta: 49em; +$breakpoint-book-beta: 620px; $breakpoint-gamma: 56em; $breakpoint-delta: 73.125em; $breakpoint-epsilon: 79.625em; @@ -11,6 +12,9 @@ $breakpoint-epsilon: 79.625em; @else if $point == "beta" { @media screen and (min-width: $breakpoint-beta) { @content; } } + @else if $point == "book-beta" { + @media screen and (min-width: $breakpoint-book-beta) { @content; } + } @else if $point == "gamma" { @media screen and (min-width: $breakpoint-gamma) { @content; } } diff --git a/design/templates/admin/buttons.html b/design/templates/admin/buttons.html index 5046695..9e36e03 100644 --- a/design/templates/admin/buttons.html +++ b/design/templates/admin/buttons.html @@ -32,7 +32,7 @@
-

Publish Site

+

Publish Site

, BuildBooks {% if message %}
diff --git a/design/templates/archives/books.html b/design/templates/archives/books.html new file mode 100644 index 0000000..f462a3a --- /dev/null +++ b/design/templates/archives/books.html @@ -0,0 +1,55 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{% load html5_datetime %} +{% load pagination_tags %} +{% block pagetitle %} Books | luxagraf {% endblock %} +{% block metadescription %}Books and thoughts on them. {% endblock %} +{%block bodyid%}class="books" id="books-archive"{%endblock%} + +{% block primary %} + +
+

Books

+

I wear glasses because as a child I would stay up late, covers pulled over my head, reading by the dim light of a dying flashlight. At least that's what an eye doctor told me when I was younger. Probably a load of crap, but I still love reading and I still often do it by poor light far later in the night than is reasonable.

+

A few years ago, I realized I was forgetting the things I'd read. Forgetting the things they had made me think of, things I'd learned, bits I wanted to remember. So I started taking notes while reading, usually with a pen and paper, but sometimes just photographing a page and using OCR to save it to a text file. I wanted to remember, to recall.

+

And of course since I have all this stuff in text files I thought might as well put it online. Thanks to some APIs out there it isn't hard to get all the info you need about a book. And well, here you have it, books I've read and things I've thought about them.

+ {% autopaginate object_list 24 %}{% for object in object_list %} +
+ {% if object.image %}cover art: red horse, city in background{%endif%} +

{{object.title|safe|amp|smartypants}}

+ + {{object.isbn}} +
+ {% if object.rating %}{{object.rating}}stars{%endif%} + + Read in: {{object.read_date|date:"F Y"}} +
{{object.body_html|safe|amp|smartypants|urlizetrunc:45 }}
+
+{% endfor %} +
+{% endblock %} + + + title = models.CharField(max_length=200) + author_name = models.CharField(max_length=200) + slug = models.CharField(max_length=50) + year_pub = models.CharField(max_length=4, blank=True, null=True) + read_date = models.DateTimeField() + isbn = models.CharField(max_length=100, blank=True, null=True) + body_html = models.TextField(null=True, blank=True) + url = models.CharField(max_length=200, blank=True, null=True) + tags = TaggableManager() + RATINGS = ( + ('1', "1 Star"), + ('2', "2 Stars"), + ('3', "3 Stars"), + ('4', "4 Stars"), + ('5', "5 Stars"), + ) + rating = models.CharField(max_length=1, choices=RATINGS, null=True) + enable_comments = models.BooleanField(default=False) + image = models.FileField(upload_to='book-covers/', null=True, blank=True) + diff --git a/design/templates/details/book.html b/design/templates/details/book.html new file mode 100644 index 0000000..46ac10b --- /dev/null +++ b/design/templates/details/book.html @@ -0,0 +1,47 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{%block bodyid%}id="book-page"{%endblock%} +{% block primary %} +
+

{{object.title|smartypants|widont|safe}}

+
+ {{object.title}} cover +
Meta
+ +
{%if object.body_html%} +
+
Notes
+ {{object.rating}} + + +
{{object.body_html|safe|smartypants|widont}}
+ +
{%endif%} + {% if object.bookhighlight_set.all %} +
+

Highlights:

+ {% for object in object.bookhighlight_set.all reversed %} +
+ {{object.body_html|safe|amp|smartypants}} +

page: {{object.page}} kindle location: {{object.location|cut:"["|cut:"]"}}

+
+ {% endfor %} +
+ {%endif%} +
+{% endblock %} + -- cgit v1.2.3