From 47b79fd9d4329e73cef7929ed8f64d9eeb287ae5 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 15 Jan 2021 14:54:30 -0500 Subject: Proj: Massive design overhaul to simplify code Cut out Sass syntax, deleted old CSS rules, changed HTML to use fewer lists and more cascading instead of specific rules. Still requires compiling with sass to strip comments and compress, but would in theory work on its own. Reduced CSS file size by 2/3 --- app/books/templates/books/book_detail.html | 33 ++++---- app/books/templates/books/book_list.html | 54 ++++-------- .../templates/locations/location_detail.html | 92 ++++++++++++++++++++ app/lttr/templates/lttr/friends_detail.html | 82 ++++++++---------- app/lttr/templates/lttr/friends_list.html | 26 +++--- .../templates/lttr/newslettermailing_detail.html | 7 +- app/pages/templates/pages/luxagraf/homepage.html | 67 +++++++-------- .../templates/pages/luxagraf/page_detail.html | 2 +- app/posts/templates/posts/essay_detail.html | 10 ++- app/posts/templates/posts/essay_list.html | 36 ++++++-- .../posts/fieldnote_archive_list_date.html | 24 +++--- app/posts/templates/posts/fieldnote_detail.html | 39 ++------- app/posts/templates/posts/fieldnote_list.html | 26 +++--- app/posts/templates/posts/guide_base.html | 22 ++--- app/posts/templates/posts/guide_by_topic.html | 43 +++++----- app/posts/templates/posts/guide_detail.html | 8 +- app/posts/templates/posts/jrnl_detail.html | 99 +++++++++++----------- app/posts/templates/posts/jrnl_list.html | 12 +-- app/posts/templates/posts/post_detail.html | 10 +-- app/posts/templates/posts/src_detail.html | 86 ++++++++----------- app/posts/templates/posts/src_list.html | 25 +++--- app/sightings/templates/sightings/ap_detail.html | 57 +++++++++++++ .../templates/sightings/sighting_list.html | 33 ++++++++ 23 files changed, 508 insertions(+), 385 deletions(-) create mode 100644 app/locations/templates/locations/location_detail.html create mode 100644 app/sightings/templates/sightings/ap_detail.html create mode 100644 app/sightings/templates/sightings/sighting_list.html (limited to 'app') diff --git a/app/books/templates/books/book_detail.html b/app/books/templates/books/book_detail.html index 1dad0fc..6304562 100644 --- a/app/books/templates/books/book_detail.html +++ b/app/books/templates/books/book_detail.html @@ -1,21 +1,19 @@ {% extends 'base.html' %} {% load typogrify_tags %} -{%block bodyid%}class="detail"{%endblock%} +{%block bodyid%}class="detail center book-detail"{%endblock%} {% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} - {% block primary %}
-
-

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

- - - + {% block primary %}
+
+

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

+
+
{{object.title}} cover
{%if object.body_html%}
-
Notes
+
Notes
{{object.rating}} @@ -41,22 +39,21 @@
{%endif%} {% if object.bookhighlight_set.all %}
-

Highlights:

+

Highlights:

{% for object in object.bookhighlight_set.all %}{% if object.is_public %} -
- -
+
+ +
{{object.body_html|safe|amp|smartypants}} + – Page: {{object.page}} {% if object.location %}(Kindle location: {{object.location|cut:"["|cut:"]"}}){%endif%}
-

– Page: {{object.page}} {% if object.location %}(Kindle location: {{object.location|cut:"["|cut:"]"}}){%endif%}

{% endif %}{% endfor %}
{%endif%} +

When you buy a book using the link above, I may earn a small affiliate commission.

+
{% endblock %} {% block disclaimer %} -
-

When you buy a book using the link above, I may earn a small affiliate commission.

-
{% endblock %} diff --git a/app/books/templates/books/book_list.html b/app/books/templates/books/book_list.html index 96d4d1b..dbfa767 100644 --- a/app/books/templates/books/book_list.html +++ b/app/books/templates/books/book_list.html @@ -6,48 +6,24 @@ {% block metadescription %}Books I've read and thoughts on them. {% endblock %} {%block bodyid%}class="archive" id="books-archive"{%endblock%} {% block breadcrumbs %}{% include "lib/breadcrumbs.html" with breadcrumbs=breadcrumbs %}{% endblock %} -{% block primary %}
{% autopaginate object_list 24 %} -

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.

-

I've always taken notes while reading, usually with a pen and paper, but sometimes as highlights in the Kindle. And of course since I have all this stuff in text files I thought might as well put it online. So here you have it, books I've read and things I've thought about them.

-
- -
{% for object in object_list %} -
+{% block primary %}
{% autopaginate object_list 24 %} +
+

Book Notes

{% if page_obj.number == 1%} +

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.

+

I've always taken notes while reading, usually with a pen and paper, but sometimes as highlights in the Kindle. And of course since I have all this stuff in text files I thought might as well put it online. So here you have it, books I've read and things I've thought about them.

{%endif%} +
+
{% for object in object_list %} +
{% if object.image %}
cover art for {{object.title}} by {{object.author_name}}
{%endif%} -

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

- -
- {% if object.rating %}{% for i in object.ratings_range %}{% if i <= object.get_rating%}★{%else%}☆{%endif%}{%endfor%}{%endif%} +

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

+ +
+ {% if object.rating %}{% for i in object.ratings_range %}{% if i <= object.get_rating%}★{%else%}☆{%endif%}{%endfor%}{%endif%} - Read in: {{object.read_date|date:"F Y"}}
-
- {% endfor %}
+ Read in: {{object.read_date|date:"F Y"}}
+ {% 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/app/locations/templates/locations/location_detail.html b/app/locations/templates/locations/location_detail.html new file mode 100644 index 0000000..81aeb97 --- /dev/null +++ b/app/locations/templates/locations/location_detail.html @@ -0,0 +1,92 @@ +{% extends 'base.html' %} +{% load typogrify_tags %} +{% load get_image_by_size %} +{% load get_image_width %} +{% load pagination_tags %} + +{% block pagetitle %}{{object.name|title|smartypants|safe}} | Luxagraf, a travelogue | {% if object.country_name == "United States" %}{{object.location_name|smartypants|safe}}, {{object.state_name}}{%else%}{{object.location_name|smartypants|safe}}, {{object.country_name}}{%endif%}){% endblock %} + +{% block metadescription %}{{object.meta_description|striptags|safe}}{% endblock %} +{%block extrahead%} + +{%endblock%} +{%block bodyid%}id="location" class="archive"{%endblock%} +{% block primary %} +
+
+

{{object.name}}

+ {{object.description_html}} +
+
+

Journal entries from {{object.name}}

+
{% for object in entry_list %} +
+ +

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

+ + +

+ + {% if object.location.country_name == "United States" %}{{object.location.name|smartypants|safe}}, {{object.location.state_name}}, U.S.{%else%}{{object.location.name|smartypants|safe}}, {{object.location.country_name}}{%endif%} + – + + {{object.dek|safe}} + +

+
{% endfor %} +
+
+ {% if notes_list %}
+

Field Notes

+ +
{% endif %} + {% if sighting_list %} +
+

Birds and Mammals seen in {{object}}

{% for object in sighting_list %} + {% endfor %} +
{%endif%} + + {% comment %} + {% for entry in book_list %}{% if forloop.first %} + {%endif%}{% endfor %} + {% endcomment %} +
+{% endblock %} diff --git a/app/lttr/templates/lttr/friends_detail.html b/app/lttr/templates/lttr/friends_detail.html index 52a2a2a..11520a6 100644 --- a/app/lttr/templates/lttr/friends_detail.html +++ b/app/lttr/templates/lttr/friends_detail.html @@ -52,43 +52,41 @@ } {%endblock%} -{%block bodyid%}id="home" class="archive"{%endblock%} -{% block breadcrumbs %} - + + + Friends of a Long Year + + + + {{object.get_issue_str}} + + + {% endblock %} {% block primary %}
-
- {%with image=object.featured_image%} - {{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%} - {%endwith%} -
-
-
-

{{object.title|smartypants|safe}}

-
+
+ {%with image=object.featured_image%} + {{image.alt}} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}luxagraf{%endif%} + {%endwith%} +
+
+
+

{{object.title|smartypants|safe}}

+
-
+
{{object.body_html|safe|smartypants}}
{%if object.books.all %}