From c41b53bdbeb537246c62c1a8989cda6b1d4508fe Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 16 Mar 2020 16:10:59 -0700 Subject: [PATCH] User page --- fedireads/static/format.css | 73 ++++++++++++++-- fedireads/templates/feed.html | 20 +---- fedireads/templates/snippets/avatar.html | 2 +- .../templates/snippets/covers_shelf.html | 20 ++++- .../snippets/follow_request_buttons.html | 8 +- fedireads/templates/user.html | 83 +++++++++---------- fedireads/views.py | 82 +++++++++++------- 7 files changed, 180 insertions(+), 108 deletions(-) diff --git a/fedireads/static/format.css b/fedireads/static/format.css index 417edd69..86c94b4d 100644 --- a/fedireads/static/format.css +++ b/fedireads/static/format.css @@ -39,6 +39,7 @@ h2 { font-size: 1rem; padding: 0.5rem 0.2rem; margin-bottom: 1rem; + border-bottom: 3px solid #B2DBBF; } #top-bar { @@ -69,6 +70,9 @@ h2 { #actions > * { display: inline-block; } +#actions > *:last-child { + margin-left: 0.5em; +} #notifications .icon { font-size: 1.1rem; @@ -165,6 +169,21 @@ ul.menu a { .row > * { flex-grow: 1; width: min-content; + margin-right: 1em; +} +.row > *:last-child { + margin-right: 0; +} +.row.shrink > * { + flex-grow: 0; + width: max-content; +} + +.follow-requests .row { + margin-bottom: 0.5em; +} +.follow-requests .row > *:first-child { + width: 15em; } .login form { @@ -196,9 +215,8 @@ button.secondary { border: 2px solid #247BA0; color: #247BA0; } - -.login h2 { - border-bottom: 3px solid #B2DBBF; +button.warning { + background-color: #FF1654; } .tabs { @@ -235,6 +253,25 @@ button.secondary { position: relative; bottom: 0.35em; } +.user-pic.large { + width: 5em; + height: 5em; +} + +.user-profile h2 a { + text-decoration: none; + font-size: 0.9em; + float: right; +} +.user-profile h2 .icon { + font-size: 1.2em; +} +.user-profile .row > * { + flex-grow: 0; +} +.user-profile .row > *:last-child { + flex-grow: 1; +} .review-form label { display: block; @@ -285,8 +322,19 @@ button.secondary { .all-shelves > div:first-child > * { padding-left: 1em; } -.all-shelves h2 { - border-bottom: 3px solid #B2DBBF; + +.user-shelves .covers-shelf { + flex-wrap: wrap; +} +.user-shelves > div { + margin: 1em 0; + padding: 0; +} +.user-shelves > div > * { + padding-left: 1em; +} +.user-shelves .covers-shelf .book-cover { + height: 9em; } .covers-shelf { @@ -378,7 +426,14 @@ button.secondary { } blockquote { - white-space: pre-wrap; + white-space: pre-line; + margin-left: 2em; +} +blockquote .icon-quote-open { + float: left; + font-size: 2rem; + margin-right: 0.5rem; + color: #888; } .interaction { @@ -456,6 +511,7 @@ th, td { .post h2, .compose-suggestion h2 { position: relative; right: 2em; + border: none; } .post .time-ago { position: relative; @@ -487,6 +543,11 @@ th, td { background-color: #DDD; } +a .icon { + color: black; + text-decoration: none; +} + .hidden-text { height: 0; width: 0; diff --git a/fedireads/templates/feed.html b/fedireads/templates/feed.html index 71d18425..87e7fc2a 100644 --- a/fedireads/templates/feed.html +++ b/fedireads/templates/feed.html @@ -3,25 +3,7 @@ {% block content %}
- {% for shelf in shelves %} - {% if shelf.books %} -
-

{{ shelf.name }} - {% if shelf.size > shelf.books|length %} - (See all {{ shelf.size }}) - {% endif %} -

-
- {% for book in shelf.books %} -
- {% include 'snippets/book_cover.html' with book=book %} - {% include 'snippets/shelve_button.html' with book=book %} -
- {% endfor %} -
-
- {% endif %} - {% endfor %} + {% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %}
{% for shelf in shelves %} diff --git a/fedireads/templates/snippets/avatar.html b/fedireads/templates/snippets/avatar.html index 6e9218a0..22cc3fc7 100644 --- a/fedireads/templates/snippets/avatar.html +++ b/fedireads/templates/snippets/avatar.html @@ -1,2 +1,2 @@ - + diff --git a/fedireads/templates/snippets/covers_shelf.html b/fedireads/templates/snippets/covers_shelf.html index 853e0b05..74c59341 100644 --- a/fedireads/templates/snippets/covers_shelf.html +++ b/fedireads/templates/snippets/covers_shelf.html @@ -1,6 +1,20 @@ {% load fr_display %} -{% for book in books %} -
- {% include 'snippets/book.html' with rating=rating %} +{% for shelf in shelves %} +{% if shelf.books %} +
+

{{ shelf.name }} + {% if shelf.size > shelf.books|length %} + (See all {{ shelf.size }}) + {% endif %} +

+
+ {% for book in shelf.books %} +
+ {% include 'snippets/book_cover.html' with book=book %} + {% include 'snippets/shelve_button.html' with book=book %} +
+ {% endfor %}
+
+{% endif %} {% endfor %} diff --git a/fedireads/templates/snippets/follow_request_buttons.html b/fedireads/templates/snippets/follow_request_buttons.html index 97aeb745..856fac51 100644 --- a/fedireads/templates/snippets/follow_request_buttons.html +++ b/fedireads/templates/snippets/follow_request_buttons.html @@ -1,10 +1,10 @@
{% csrf_token %} - - + +
{% csrf_token %} - - + +
diff --git a/fedireads/templates/user.html b/fedireads/templates/user.html index df772d3f..8a6d64bd 100644 --- a/fedireads/templates/user.html +++ b/fedireads/templates/user.html @@ -1,64 +1,61 @@ {% extends 'layout.html' %} +{% load humanize %} {% block content %} -