add: outbox tab on profile

tab is only visible to profile owner and mods
This commit is contained in:
trisua 2025-06-01 19:26:55 -04:00
parent 5dec98d698
commit 7bda718082
12 changed files with 264 additions and 9 deletions

View file

@ -0,0 +1,44 @@
(text "{% extends \"profile/base.html\" %} {% block content %} {% if profile.settings.enable_questions and (user or profile.settings.allow_anonymous_questions) %}")
(div
("style" "display: contents")
(text "{{ components::create_question_form(receiver=profile.id, header=profile.settings.motivational_header) }}"))
(text "{%- endif %} {{ macros::profile_nav(selected=\"outbox\") }}")
(div
("class" "card-nest")
(div
("class" "card small flex gap-2 justify-between items-center")
(div
("class" "flex gap-2 items-center")
(text "{{ icon \"send\" }}")
(span
(text "{{ text \"auth:label.outbox\" }}"))))
(div
("class" "card tertiary flex flex-col gap-4")
(text "{% for question in questions %}")
(div
("class" "card-nest")
; show the actual question
(text "{{ components::question(question=question[0], owner=question[1], profile=user, secondary=true) }}")
; options
(div
("class" "card small flex justify-between items-center gap-2")
; show the avatar of the person we sent the question to
(a
("class" "flex items-center gap-2 flush")
("href" "/api/v1/auth/user/find/{{ question[0].receiver }}")
(icon (text "send"))
(text "{{ components::avatar(username=question[0].receiver, selector_type='id') }}"))
; show button to delete question
(button
("class" "quaternary small red")
("onclick" "trigger('me::remove_question', ['{{ question[0].id }}'])")
(icon (text "trash"))
(str (text "general:action.delete")))))
(text "{% endfor %}")
(text "{{ components::pagination(page=page, items=questions|length) }}")))
(text "{% endblock %}")