diff --git a/bookwyrm/static/css/fonts/icomoon.eot b/bookwyrm/static/css/fonts/icomoon.eot index 99a90268..e031e7d2 100644 Binary files a/bookwyrm/static/css/fonts/icomoon.eot and b/bookwyrm/static/css/fonts/icomoon.eot differ diff --git a/bookwyrm/static/css/fonts/icomoon.svg b/bookwyrm/static/css/fonts/icomoon.svg index 28612eee..0323df05 100644 --- a/bookwyrm/static/css/fonts/icomoon.svg +++ b/bookwyrm/static/css/fonts/icomoon.svg @@ -29,6 +29,7 @@ + diff --git a/bookwyrm/static/css/fonts/icomoon.ttf b/bookwyrm/static/css/fonts/icomoon.ttf index 0f78404f..d112fb65 100644 Binary files a/bookwyrm/static/css/fonts/icomoon.ttf and b/bookwyrm/static/css/fonts/icomoon.ttf differ diff --git a/bookwyrm/static/css/fonts/icomoon.woff b/bookwyrm/static/css/fonts/icomoon.woff index dcb8dc75..bbac704f 100644 Binary files a/bookwyrm/static/css/fonts/icomoon.woff and b/bookwyrm/static/css/fonts/icomoon.woff differ diff --git a/bookwyrm/static/css/format.css b/bookwyrm/static/css/format.css index bd13143b..51c931e6 100644 --- a/bookwyrm/static/css/format.css +++ b/bookwyrm/static/css/format.css @@ -62,13 +62,26 @@ input.toggle-control:checked ~ .toggle-content { .cover-container.is-medium { height: 150px; } +.cover-container.is-small { + height: 100px; +} +@media only screen and (max-width: 768px) { + .cover-container { + height: 200px; + width: max-content; + } + .cover-container.is-medium { + height: 100px; + } + .cover-container.is-small { + height: 70px; + } +} + .cover-container.is-medium .no-cover div { font-size: 0.9em; padding: 0.3em; } -.cover-container.is-small { - height: 100px; -} .cover-container.is-small .no-cover div { font-size: 0.7em; padding: 0.1em; diff --git a/bookwyrm/static/css/icons.css b/bookwyrm/static/css/icons.css index bf68b7d6..1f34f78c 100644 --- a/bookwyrm/static/css/icons.css +++ b/bookwyrm/static/css/icons.css @@ -1,10 +1,10 @@ @font-face { font-family: 'icomoon'; - src: url('fonts/icomoon.eot?7ifunb'); - src: url('fonts/icomoon.eot?7ifunb#iefix') format('embedded-opentype'), - url('fonts/icomoon.ttf?7ifunb') format('truetype'), - url('fonts/icomoon.woff?7ifunb') format('woff'), - url('fonts/icomoon.svg?7ifunb#icomoon') format('svg'); + src: url('fonts/icomoon.eot?ouoizu'); + src: url('fonts/icomoon.eot?ouoizu#iefix') format('embedded-opentype'), + url('fonts/icomoon.ttf?ouoizu') format('truetype'), + url('fonts/icomoon.woff?ouoizu') format('woff'), + url('fonts/icomoon.svg?ouoizu#icomoon') format('svg'); font-weight: normal; font-style: normal; font-display: block; @@ -25,6 +25,9 @@ -moz-osx-font-smoothing: grayscale; } +.icon-dots-three:before { + content: "\e916"; +} .icon-envelope:before { content: "\e900"; } diff --git a/bookwyrm/templates/snippets/book_preview.html b/bookwyrm/templates/snippets/book_preview.html index 65a9ae4b..ab41d41e 100644 --- a/bookwyrm/templates/snippets/book_preview.html +++ b/bookwyrm/templates/snippets/book_preview.html @@ -1,11 +1,11 @@ -
-
+
+
{% include 'snippets/book_cover.html' with book=book %} {% include 'snippets/shelve_button.html' with book=book %}
-
+

{% include 'snippets/book_titleby.html' with book=book %}

{% include 'snippets/book_description.html' with book=book %}
diff --git a/bookwyrm/templates/snippets/boost_button.html b/bookwyrm/templates/snippets/boost_button.html new file mode 100644 index 00000000..7133e818 --- /dev/null +++ b/bookwyrm/templates/snippets/boost_button.html @@ -0,0 +1,19 @@ +{% load fr_display %} +{% with activity.id|uuid as uuid %} +
+ {% csrf_token %} + +
+
+ {% csrf_token %} + +
+{% endwith %} diff --git a/bookwyrm/templates/snippets/fav_button.html b/bookwyrm/templates/snippets/fav_button.html new file mode 100644 index 00000000..de41064a --- /dev/null +++ b/bookwyrm/templates/snippets/fav_button.html @@ -0,0 +1,19 @@ +{% load fr_display %} +{% with activity.id|uuid as uuid %} +
+ {% csrf_token %} + +
+
+ {% csrf_token %} + +
+{% endwith %} diff --git a/bookwyrm/templates/snippets/interaction.html b/bookwyrm/templates/snippets/interaction.html deleted file mode 100644 index 97e7d068..00000000 --- a/bookwyrm/templates/snippets/interaction.html +++ /dev/null @@ -1,69 +0,0 @@ -{% load fr_display %} -{% with activity.id|uuid as uuid %} - -{% endwith %} diff --git a/bookwyrm/templates/snippets/reply_form.html b/bookwyrm/templates/snippets/reply_form.html new file mode 100644 index 00000000..48371f63 --- /dev/null +++ b/bookwyrm/templates/snippets/reply_form.html @@ -0,0 +1,33 @@ +{% load fr_display %} +{% with activity.id|uuid as uuid %} +
+
+ {% csrf_token %} + + +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+{% endwith %} diff --git a/bookwyrm/templates/snippets/status.html b/bookwyrm/templates/snippets/status.html index 23b45e90..9390d39c 100644 --- a/bookwyrm/templates/snippets/status.html +++ b/bookwyrm/templates/snippets/status.html @@ -17,7 +17,7 @@ {% include 'snippets/status_header.html' with status=status %} {% endif %}

-
+
@@ -28,43 +28,102 @@ {% endif %}
-
diff --git a/bookwyrm/templatetags/fr_display.py b/bookwyrm/templatetags/fr_display.py index 053058eb..73df1db8 100644 --- a/bookwyrm/templatetags/fr_display.py +++ b/bookwyrm/templatetags/fr_display.py @@ -1,6 +1,10 @@ ''' template filters ''' from uuid import uuid4 +from datetime import datetime + +from dateutil.relativedelta import relativedelta from django import template +from django.utils import timezone from bookwyrm import models @@ -117,7 +121,7 @@ def text_overflow(text): ''' dont' let book descriptions run for ages ''' if not text: return '' - char_max = 500 + char_max = 400 if text and len(text) < char_max: return text @@ -129,9 +133,30 @@ def text_overflow(text): @register.filter(name='uuid') def get_uuid(identifier): + ''' for avoiding clashing ids when there are many forms ''' return '%s%s' % (identifier, uuid4()) +@register.filter(name="post_date") +def time_since(date): + ''' concise time ago function ''' + if not isinstance(date, datetime): + return '' + now = timezone.now() + delta = now - date + + if date < (now - relativedelta(weeks=1)): + return date.strftime('%b %-d') + delta = relativedelta(now, date) + if delta.days: + return '%dd' % delta.days + if delta.hours: + return '%dh' % delta.hours + if delta.minutes: + return '%dm' % delta.minutes + return '%ds' % delta.seconds + + @register.simple_tag(takes_context=True) def shelve_button_identifier(context, book): ''' check what shelf a user has a book on, if any '''