summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMichael Manfre2022-11-27 13:09:46 -0500
committerGitHub2022-11-27 11:09:46 -0700
commit6c7ddedd342553b53dd98c8de9cbe9e8e2e8cd7c (patch)
treee34059bca5e13a8a614687face1153d63e7f5654 /templates
parent263af996d8ed05e37ef5a62c6ed240216a6eb67b (diff)
downloadtakahe-6c7ddedd342553b53dd98c8de9cbe9e8e2e8cd7c.tar.gz
takahe-6c7ddedd342553b53dd98c8de9cbe9e8e2e8cd7c.tar.bz2
takahe-6c7ddedd342553b53dd98c8de9cbe9e8e2e8cd7c.zip
Post editing
Diffstat (limited to 'templates')
-rw-r--r--templates/activities/_post.html23
-rw-r--r--templates/activities/compose.html3
2 files changed, 18 insertions, 8 deletions
diff --git a/templates/activities/_post.html b/templates/activities/_post.html
index ebe5696..e294698 100644
--- a/templates/activities/_post.html
+++ b/templates/activities/_post.html
@@ -18,13 +18,11 @@
{% elif post.visibility == 4 %}
<i class="visibility fa-solid fa-link-slash" title="Local Only"></i>
{% endif %}
- <a href="{{ post.url }}">
- {% if post.published %}
- {{ post.published | timedeltashort }}
- {% else %}
- {{ post.created | timedeltashort }}
- {% endif %}
- </a>
+ {% if post.published %}
+ <a href="{{ post.url }}" title="{{ post.published }}">{{ post.published | timedeltashort }}</a>
+ {% else %}
+ <a href="{{ post.url }}" title="{{ post.created }}">{{ post.created | timedeltashort }}</a>
+ {% endif %}
</time>
{% if request.identity %}
@@ -32,14 +30,19 @@
{% include "activities/_reply.html" %}
{% include "activities/_like.html" %}
{% include "activities/_boost.html" %}
+ {% if post.author == request.identity %}
<a title="Menu" class="menu" _="on click toggle .enabled on the next <menu/>">
<i class="fa-solid fa-caret-down"></i>
</a>
<menu>
+ <a href="{{ post.urls.action_edit }}">
+ <i class="fa-solid fa-pen-to-square"></i> Edit
+ </a>
<a href="{{ post.urls.action_delete }}">
<i class="fa-solid fa-trash"></i> Delete
</a>
</menu>
+ {% endif %}
</div>
{% endif %}
@@ -57,6 +60,12 @@
{{ post.safe_content_local }}
</div>
+ {% if post.edited %}
+ <div class="edited" title="{{ post.edited }}">
+ <small>Edited {{ post.edited | timedeltashort }} ago</small>
+ </div>
+ {% endif %}
+
{% if post.attachments.exists %}
<div class="attachments">
{% for attachment in post.attachments.all %}
diff --git a/templates/activities/compose.html b/templates/activities/compose.html
index 1a02227..e705f97 100644
--- a/templates/activities/compose.html
+++ b/templates/activities/compose.html
@@ -12,12 +12,13 @@
{% include "activities/_mini_post.html" with post=reply_to %}
{% endif %}
{{ form.reply_to }}
+ {{ form.id }}
{% include "forms/_field.html" with field=form.text %}
{% include "forms/_field.html" with field=form.content_warning %}
{% include "forms/_field.html" with field=form.visibility %}
</fieldset>
<div class="buttons">
- <button>{% if config_identity.toot_mode %}Toot!{% else %}Post{% endif %}</button>
+ <button>{% if form.id %}Edit{% elif config_identity.toot_mode %}Toot!{% else %}Post{% endif %}</button>
</div>
</form>
{% endblock %}