add: report button on profiles and communities

This commit is contained in:
trisua 2025-06-03 17:42:29 -04:00
parent 75459080c3
commit a091adc9d9
6 changed files with 34 additions and 6 deletions

View file

@ -162,6 +162,13 @@ p {
margin-bottom: 0; margin-bottom: 0;
} }
.post_content pre,
.post_content h1,
.post_content h2,
.post_content h3 {
max-width: calc(100% - 39px - 0.5rem);
}
.post_right:not(.repost) { .post_right:not(.repost) {
max-width: calc(100% - 52px); max-width: calc(100% - 52px);
} }

View file

@ -280,7 +280,17 @@
("hook" "check_reactions") ("hook" "check_reactions")
("hook-arg:id" "{{ community.id }}") ("hook-arg:id" "{{ community.id }}")
(text "{{ components::likes(id=community.id, asset_type=\"Community\", likes=community.likes, dislikes=community.dislikes) }}")) (text "{{ components::likes(id=community.id, asset_type=\"Community\", likes=community.likes, dislikes=community.dislikes) }}"))
(text "{%- endif %}")))))) (text "{%- endif %}")))
(text "{% if user and user.id != community.owner -%}")
(hr)
(div
("class" "flex flex-wrap gap-2 w-full fade")
(a
("class" "red")
("href" "javascript:trigger('me::report', ['{{ community.id }}', 'community'])")
(text "({{ lang[\"general:action.report\"]|lower }})")))
(text "{%- endif %}"))))
(div (div
("class" "rhs w-full") ("class" "rhs w-full")
(text "{% if can_read -%} {% block content %}{% endblock %} {% else %}") (text "{% if can_read -%} {% block content %}{% endblock %} {% else %}")

View file

@ -191,7 +191,7 @@
(text "{% if not post.context.content_warning -%}") (text "{% if not post.context.content_warning -%}")
(span (span
("id" "post-content:{{ post.id }}") ("id" "post-content:{{ post.id }}")
("class" "no_p_margin") ("class" "no_p_margin post_content")
("hook" "long") ("hook" "long")
(text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}") (text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(div (div
@ -204,15 +204,14 @@
(details (details
("class" "card tiny tertiary w-full") ("class" "card tiny tertiary w-full")
(summary (summary
("class" "flex gap-2 flex-wrap items-center red w-full") ("class" "red w-full")
(text "{{ icon \"triangle-alert\" }}")
(b (b
(text "{{ post.context.content_warning }}"))) (text "{{ post.context.content_warning }}")))
(div (div
("class" "flex flex-col gap-2") ("class" "flex flex-col gap-2")
(span (span
("id" "post-content:{{ post.id }}") ("id" "post-content:{{ post.id }}")
("class" "no_p_margin") ("class" "no_p_margin post_content")
("hook" "long") ("hook" "long")
(text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}") (text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(div (div

View file

@ -137,7 +137,7 @@
(a (a
("href" "/popular") ("href" "/popular")
("class" "{% if selected == 'popular' -%}active{%- endif %}") ("class" "{% if selected == 'popular' -%}active{%- endif %}")
(icon (text "layers")) (icon (text "trending-up"))
(str (text "general:link.popular")))) (str (text "general:link.popular"))))
(div (div

View file

@ -53,6 +53,8 @@
window.open(`/post/${asset}`); window.open(`/post/${asset}`);
} else if (asset_type === \"Community\") { } else if (asset_type === \"Community\") {
window.open(`/community/${asset}`); window.open(`/community/${asset}`);
} else if (asset_type === \"User\") {
window.open(`/api/v1/auth/user/find/${asset}`);
} }
} }

View file

@ -172,6 +172,16 @@
(span (span
("class" "date") ("class" "date")
(text "{{ profile.last_seen }}")))) (text "{{ profile.last_seen }}"))))
(text "{%- endif %}")
(text "{% if user and user.id != profile.id -%}")
(hr)
(div
("class" "flex flex-wrap gap-2 w-full fade")
(a
("class" "red")
("href" "javascript:trigger('me::report', ['{{ profile.id }}', 'user'])")
(text "({{ lang[\"general:action.report\"]|lower }})")))
(text "{%- endif %}"))) (text "{%- endif %}")))
(text "{% if not is_self and user -%}") (text "{% if not is_self and user -%}")
(div (div