diff --git a/fedireads/static/format.css b/fedireads/static/format.css index 43ad9969..1d83af33 100644 --- a/fedireads/static/format.css +++ b/fedireads/static/format.css @@ -364,10 +364,39 @@ blockquote { .interaction { background-color: #B2DBBF; border-radius: 0 0 0.5em 0.5em; + display: flex; + flex-direction: row; + padding: 0.5em; +} +.interaction > * { + margin-right: 0.5em; +} +.interaction button:hover { + box-shadow: #247BA0 0em 0em 1em 0em; + color: #247BA0; +} +.interaction button.active:hover .icon { + color: #888; +} +.interaction button { + background: white; + height: 2em; + min-width: 3em; + padding: 0; + color: #888; +} +.interaction button.active .icon { + color: #FF1654; } - .interaction textarea { height: 2em; + width: 23em; + float: left; + padding: 0.25em; + margin-right: 0.5em; +} +.interaction textarea:valid, .interaction textarea:focus { + height: 4em; } table { @@ -408,6 +437,10 @@ th, td { position: relative; right: 2em; } +.post .time-ago { + position: relative; + left: 2em; +} .post .user-pic, .compose-suggestion .user-pic { right: 0.25em; } diff --git a/fedireads/templates/snippets/interaction.html b/fedireads/templates/snippets/interaction.html index 2c44068d..8d530109 100644 --- a/fedireads/templates/snippets/interaction.html +++ b/fedireads/templates/snippets/interaction.html @@ -1,26 +1,33 @@ {% load fr_display %}
- {% if activity.favorites.all %} - - {{ activity.favorites.count }} like{{activity.favorites.count|pluralize }} - - {% endif %} - {% if activity|reply_count %} - - - {{ activity|reply_count }} repl{{ activity|reply_count|pluralize:'y,ies' }} - - - {% endif %} -
- {% csrf_token %} - -
+
{% csrf_token %} - - + + +
+ +
+ {% csrf_token %} + +
+ +
+ {% csrf_token %} +
diff --git a/fedireads/templatetags/fr_display.py b/fedireads/templatetags/fr_display.py index b8b39010..b34fc9f6 100644 --- a/fedireads/templatetags/fr_display.py +++ b/fedireads/templatetags/fr_display.py @@ -70,6 +70,15 @@ def get_parent(status): return models.Status.objects.filter(id=status.reply_parent_id).select_subclasses().get() +@register.filter(name='liked') +def get_user_liked(user, status): + try: + models.Favorite.objects.get(user=user, status=status) + return True + except models.Favorite.DoesNotExist: + return False + + @register.simple_tag(takes_context=True) def shelve_button_identifier(context, book): ''' check what shelf a user has a book on, if any '''