feat: follow-by-handle form on following and users pages

This commit is contained in:
2026-05-13 01:35:54 +02:00
parent 20e70325c6
commit bc6c767c29
4 changed files with 26 additions and 2 deletions

View File

@@ -4,6 +4,12 @@
{% if let Some(err) = error %}
<p class="error">{{ err }}</p>
{% endif %}
<form method="POST" action="/users/{{ user_id }}/follow" class="follow-form">
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
<input type="hidden" name="redirect_after" value="/social/following">
<input type="text" name="handle" placeholder="@user@instance.tld" required>
<button type="submit">Follow</button>
</form>
{% if actors.is_empty() %}
<p>Not following anyone yet. Follow remote users from your <a href="/users/{{ user_id }}">profile page</a>.</p>
{% else %}

View File

@@ -2,6 +2,14 @@
{% block content %}
<div class="users-list">
<h2 class="page-title">Members</h2>
{% if let Some(viewer_id) = ctx.user_id %}
<form method="POST" action="/users/{{ viewer_id }}/follow" class="follow-form">
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
<input type="hidden" name="redirect_after" value="/users">
<input type="text" name="handle" placeholder="@user@instance.tld" required>
<button type="submit">Follow</button>
</form>
{% endif %}
{% for user in users %}
<div class="user-row">
<div class="user-avatar">{{ user.initial }}</div>