diff options
Diffstat (limited to 'templates/activities')
-rw-r--r-- | templates/activities/_boost.html | 35 | ||||
-rw-r--r-- | templates/activities/_like.html | 9 | ||||
-rw-r--r-- | templates/activities/_post.html | 7 | ||||
-rw-r--r-- | templates/activities/post.html | 17 |
4 files changed, 41 insertions, 27 deletions
diff --git a/templates/activities/_boost.html b/templates/activities/_boost.html index 601466e..8e90045 100644 --- a/templates/activities/_boost.html +++ b/templates/activities/_boost.html @@ -1,28 +1,9 @@ -{% load static %} -{% load activity_tags %} -<div class="post"> - - {% if post.author.icon_uri %} - <img src="{{post.author.icon_uri}}" class="icon"> - {% else %} - <img src="{% static "img/unknown-icon-128.png" %}" class="icon"> - {% endif %} - - <time> - <a href="{{ post.url }}"> - {% if post.published %} - {{ post.published | timedeltashort }} - {% else %} - {{ post.created | timedeltashort }} - {% endif %} - </a> - </time> - - <a href="{{ post.author.urls.view }}" class="handle"> - {{ post.author.name_or_handle }} <small>@{{ post.author.handle }}</small> +{% if post.pk in interactions.boost %} + <a title="Unboost" class="active" hx-post="{{ post.urls.action_unboost }}" hx-swap="outerHTML"> + <i class="fa-solid fa-retweet"></i> </a> - - <div class="content"> - {{ post.safe_content }} - </div> -</div> +{% else %} + <a title="Boost" hx-post="{{ post.urls.action_boost }}" hx-swap="outerHTML"> + <i class="fa-solid fa-retweet"></i> + </a> +{% endif %} diff --git a/templates/activities/_like.html b/templates/activities/_like.html new file mode 100644 index 0000000..8eec8cd --- /dev/null +++ b/templates/activities/_like.html @@ -0,0 +1,9 @@ +{% if post.pk in interactions.like %} + <a title="Unlike" class="active" hx-post="{{ post.urls.action_unlike }}" hx-swap="outerHTML"> + <i class="fa-solid fa-star"></i> + </a> +{% else %} + <a title="Like" hx-post="{{ post.urls.action_like }}" hx-swap="outerHTML"> + <i class="fa-solid fa-star"></i> + </a> +{% endif %} diff --git a/templates/activities/_post.html b/templates/activities/_post.html index bf4b189..ac21c42 100644 --- a/templates/activities/_post.html +++ b/templates/activities/_post.html @@ -25,4 +25,11 @@ <div class="content"> {{ post.safe_content }} </div> + + {% if request.identity %} + <div class="actions"> + {% include "activities/_like.html" %} + {% include "activities/_boost.html" %} + </div> + {% endif %} </div> diff --git a/templates/activities/post.html b/templates/activities/post.html new file mode 100644 index 0000000..b44df40 --- /dev/null +++ b/templates/activities/post.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block title %}Post by {{ post.author.name_or_handle }}{% endblock %} + +{% block content %} + <nav> + <a href="." class="selected">Post</a> + </nav> + + <section class="columns"> + + <div class="left-column"> + {% include "activities/_post.html" %} + </div> + + </section> +{% endblock %} |