summaryrefslogtreecommitdiffstats
path: root/templates/activities
diff options
context:
space:
mode:
Diffstat (limited to 'templates/activities')
-rw-r--r--templates/activities/_event.html48
-rw-r--r--templates/activities/_identity.html15
-rw-r--r--templates/activities/_menu.html (renamed from templates/activities/_home_menu.html)1
-rw-r--r--templates/activities/_post.html5
-rw-r--r--templates/activities/post.html12
-rw-r--r--templates/activities/search.html21
6 files changed, 64 insertions, 38 deletions
diff --git a/templates/activities/_event.html b/templates/activities/_event.html
index 375e475..81e9dd2 100644
--- a/templates/activities/_event.html
+++ b/templates/activities/_event.html
@@ -1,24 +1,28 @@
-{% load static %}
{% load activity_tags %}
-<div class="post">
- <time>
- {% if event.published %}
- {{ event.published | timedeltashort }}
- {% else %}
- {{ event.created | timedeltashort }}
- {% endif %}
- </time>
-
- {% if event.type == "follow" %}
- {{ event.subject_identity.name_or_handle }} followed you
- {% elif event.type == "like" %}
- {{ event.subject_identity.name_or_handle }} liked {{ event.subject_post }}
- {% elif event.type == "mentioned" %}
- {{ event.subject_post.author.name_or_handle }} mentioned you in {{ event.subject_post }}
- {% elif event.type == "boosted" %}
- {{ event.subject_identity.name_or_handle }} boosted your post {{ event.subject_post }}
- {% else %}
- Unknown event type {{event.type}}
- {% endif %}
-</div>
+{% if event.type == "followed" %}
+ <div class="follow-banner">
+ <a href="{{ event.subject_identity.urls.view }}">
+ {{ event.subject_identity.name_or_handle }}
+ </a> followed you
+ </div>
+ {% include "activities/_identity.html" with identity=event.subject_identity created=event.created %}
+{% elif event.type == "liked" %}
+ <div class="like-banner">
+ <a href="{{ event.subject_identity.urls.view }}">
+ {{ event.subject_identity.name_or_handle }}
+ </a> liked your post
+ </div>
+ {% include "activities/_post.html" with post=event.subject_post %}
+{% elif event.type == "mentioned" %}
+ <div class="mention-banner">
+ <a href="{{ event.subject_identity.urls.view }}">
+ {{ event.subject_identity.name_or_handle }}
+ </a> mentioned you
+ </div>
+ {% include "activities/_post.html" with post=event.subject_post %}
+{% elif event.type == "boosted" %}
+ {{ event.subject_identity.name_or_handle }} boosted your post {{ event.subject_post }}
+{% else %}
+ Unknown event type {{event.type}}
+{% endif %}
diff --git a/templates/activities/_identity.html b/templates/activities/_identity.html
new file mode 100644
index 0000000..36d14a9
--- /dev/null
+++ b/templates/activities/_identity.html
@@ -0,0 +1,15 @@
+{% load activity_tags %}
+<div class="post user">
+
+ <img src="{{ identity.local_icon_url }}" class="icon">
+
+ {% if created %}
+ <time>
+ {{ event.created | timedeltashort }}
+ </time>
+ {% endif %}
+
+ <a href="{{ identity.urls.view }}" class="handle">
+ {{ identity.name_or_handle }} <small>@{{ identity.handle }}</small>
+ </a>
+</div>
diff --git a/templates/activities/_home_menu.html b/templates/activities/_menu.html
index db441a2..6bb18c2 100644
--- a/templates/activities/_home_menu.html
+++ b/templates/activities/_menu.html
@@ -19,6 +19,7 @@
{% csrf_token %}
{{ form.text }}
{{ form.content_warning }}
+ <input type="hidden" name="visibility" value="0">
<div class="buttons">
<span class="button toggle" _="on click toggle .enabled then toggle .hidden on #id_content_warning">CW</span>
<button>{% if config_identity.toot_mode %}Toot!{% else %}Post{% endif %}</button>
diff --git a/templates/activities/_post.html b/templates/activities/_post.html
index 14b1cbf..5de8bc7 100644
--- a/templates/activities/_post.html
+++ b/templates/activities/_post.html
@@ -51,11 +51,6 @@
<div class="actions">
{% include "activities/_like.html" %}
{% include "activities/_boost.html" %}
- {% if request.user.admin %}
- <a title="Admin" href="/djadmin/activities/post/{{ post.pk }}/change/">
- <i class="fa-solid fa-file-code"></i>
- </a>
- {% endif %}
</div>
{% endif %}
</div>
diff --git a/templates/activities/post.html b/templates/activities/post.html
index b44df40..eee254f 100644
--- a/templates/activities/post.html
+++ b/templates/activities/post.html
@@ -3,15 +3,5 @@
{% 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>
+ {% include "activities/_post.html" %}
{% endblock %}
diff --git a/templates/activities/search.html b/templates/activities/search.html
new file mode 100644
index 0000000..3cff2a2
--- /dev/null
+++ b/templates/activities/search.html
@@ -0,0 +1,21 @@
+{% extends "base.html" %}
+
+{% block title %}Search{% endblock %}
+
+{% block content %}
+ <form action="." method="POST">
+ {% csrf_token %}
+ <fieldset>
+ {% include "forms/_field.html" with field=form.query %}
+ </fieldset>
+ <div class="buttons">
+ <button>Search</button>
+ </div>
+ </form>
+ {% if results.identities %}
+ <h2>People</h2>
+ {% for identity in results.identities %}
+ {% include "activities/_identity.html" %}
+ {% endfor %}
+ {% endif %}
+{% endblock %}