add: user settings following page

add: comments to be seen by owner of the post they're on (even if the owner is private)
This commit is contained in:
trisua 2025-05-18 14:47:24 -04:00
parent fa1a609bf5
commit b8b0ef7f21
4 changed files with 154 additions and 7 deletions

View file

@ -44,12 +44,23 @@
<span>{{ text "settings:tab.security" }}</span>
</a>
<a
data-tab-button="account/following"
href="#/account/following"
>
{{ icon "rss" }}
<span>{{ text "auth:label.following" }}</span>
</a>
<a data-tab-button="account/blocks" href="#/account/blocks">
{{ icon "shield" }}
<span>{{ text "settings:tab.blocks" }}</span>
</a>
<a data-tab-button="account/uploads" href="#/account/uploads">
<a
data-tab-button="account/uploads"
href="?page=0#/account/uploads"
>
{{ icon "image-up" }}
<span>{{ text "settings:tab.uploads" }}</span>
</a>
@ -357,6 +368,74 @@
</div>
</div>
<div class="w-full flex flex-col gap-2 hidden" data-tab="account/following">
<div class="card tertiary flex flex-col gap-2">
<a href="#/account" class="button secondary">
{{ icon "arrow-left" }}
<span>{{ text "general:action.back" }}</span>
</a>
<div class="card-nest">
<div class="card flex items-center gap-2 small">
{{ icon "rss" }}
<span>{{ text "auth:label.following" }}</span>
</div>
<div class="card flex flex-col gap-2">
{% for userfollow in following %} {% set user =
userfollow[1] %}
<div
class="card secondary flex flex-wrap gap-2 items-center justify-between"
>
<div class="flex gap-2">
{{ components::avatar(username=user.username) }} {{
components::full_username(user=user) }}
</div>
<div class="flex gap-2">
<button
class="quaternary red small"
onclick="toggle_follow_user('{{ user.id }}')"
>
{{ icon "user-minus" }}
<span>{{ text "auth:action.unfollow" }}</span>
</button>
<a
href="/@{{ user.username }}"
class="button quaternary small"
>
{{ icon "external-link" }}
<span
>{{ text "requests:action.view_profile"
}}</span
>
</a>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<script>
globalThis.toggle_follow_user = async (uid) => {
await trigger("atto::debounce", ["users::follow"]);
fetch(`/api/v1/auth/user/${uid}/follow`, {
method: "POST",
})
.then((res) => res.json())
.then((res) => {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
});
};
</script>
</div>
<div class="w-full flex flex-col gap-2 hidden" data-tab="account/blocks">
<div class="card tertiary flex flex-col gap-2">
<a href="#/account" class="button secondary">