summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/activities/_boost.html35
-rw-r--r--templates/activities/_like.html9
-rw-r--r--templates/activities/_post.html7
-rw-r--r--templates/activities/post.html17
-rw-r--r--templates/base.html3
5 files changed, 43 insertions, 28 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 %}
diff --git a/templates/base.html b/templates/base.html
index d50fdcf..e465f05 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -9,9 +9,10 @@
<link rel="stylesheet" href="{% static "fonts/raleway/raleway.css" %}" type="text/css" />
<link rel="stylesheet" href="{% static "fonts/font_awesome/all.min.css" %}" type="text/css" />
<script src="{% static "js/hyperscript.min.js" %}"></script>
+ <script src="{% static "js/htmx.min.js" %}"></script>
{% block extra_head %}{% endblock %}
</head>
-<body class="{% block body_class %}{% endblock %}">
+<body class="{% block body_class %}{% endblock %}" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
<main>
<header>