add: reclaims, tetratto_handler_account_username, entry owners

This commit is contained in:
trisua 2025-08-16 00:20:46 -04:00
parent 105d01b45d
commit f215d038b3
7 changed files with 177 additions and 6 deletions

View file

@ -0,0 +1,39 @@
(text "{% extends \"root.lisp\" %} {% block head %}")
(title
(text "Create reclaim for \"{{ entry.slug }}\" - {{ name }}"))
(link ("rel" "icon") ("href" "/public/favicon.svg"))
(text "{% endblock %} {% block body %}")
(div
("class" "card container")
(h1 (text "{{ entry.slug }}"))
(p (text "Custom slug reclaims are handled through ") (b (text "{{ tetratto }}")) (text ". You'll need to have an account there to submit a claim request."))
(p (text "Please note that you are unlikely to receive a response unless your claim is accepted. Please do not submit additional requests for the same slug."))
(text "{% if metadata.tetratto_owner_username -%}")
; contact owner text
(p (text "Since this entry is connected to a user, it is encouraged that you directly contact the owner of the entry instead. If that doesn't work, you can create a regular request."))
(text "{%- endif %}")
(p (text "Once you're ready, you can submit a claim using the button below."))
(hr)
(ul
(li (b (text "Requsted slug: ")) (text "{{ entry.slug }}"))
(li (b (text "Last updated: ")) (text "{{ entry.edited / 1000|int|date(format=\"%Y-%m-%d %H:%M\", timezone=\"Etc/UTC\") }} UTC")))
(hr)
(text "{% if claimable -%}")
(text "{% if metadata.tetratto_owner_username -%}")
; contact owner button
(a
("href" "{{ tetratto }}/mail/compose?receivers={{ tetratto_owner_username }}&subject=Reclaim%20for%20%22{{ entry.slug }}%22")
("class" "button surface no_fill")
(text "{{ icon \"external-link\" }} Contact owner"))
(text "{%- endif %}")
(a
("href" "{{ tetratto }}/mail/compose?receivers={{ tetratto_handler_account_username }}&subject=Reclaim%20for%20%22{{ entry.slug }}%22")
("class" "button surface no_fill")
(text "{{ icon \"external-link\" }} Submit request"))
(text "{% else %}")
(span (text "This slug is currently not claimable as it was edited too recently. ") (a ("href" "/{{ entry.slug }}") ("class" "red") (text "Go back")))
(text "{%- endif %}"))
(text "{% endblock %}")

View file

@ -45,7 +45,8 @@
(a
("class" "button")
("href" "https://trisua.com/t/fluffle")
(text "source"))))
(text "source"))
(text "{% block dropdown %}{% endblock %}")))
(a
("class" "button camo fade")

View file

@ -12,7 +12,6 @@
(text "{% if metadata.page_icon|length == 0 -%}")
(link ("rel" "icon") ("href" "/public/favicon.svg"))
(text "{%- endif %}")
(text "{% endblock %} {% block body %}")
(div
("class" "flex flex_col gap_2")
@ -40,6 +39,20 @@
(script ("defer" "true") (text "setTimeout(() => { temporary_set_theme('{{ metadata.access_recommended_theme }}') }, 150);"))
(text "{%- endif %}")
; owner
(text "{% if metadata.tetratto_owner_username|length > 0 -%}")
(span
("class" "flex items_center gap_2")
(text "Owner:")
(a
("class" "flex items_center gap_2")
("href" "{{ tetratto }}/@{{ metadata.tetratto_owner_username }}")
(img
("class" "avatar")
("src" "{{ tetratto }}/api/v1/auth/user/{{ metadata.tetratto_owner_username }}/avatar?selector_type=username"))
(text "{{ metadata.tetratto_owner_username }}")))
(text "{%- endif %}")
; views
(text "{% if not metadata.option_disable_views -%}")
(span (text "Views: {{ views }}"))
@ -55,7 +68,6 @@
(link ("rel" "stylesheet") ("href" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css"))
(script ("src" "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"))
(script (text "hljs.highlightAll();"))
(text "{% endblock %}")
(text "{% block nav_extras %}")
(button
@ -72,3 +84,11 @@
}, 150);"))
(text "{%- endif %}")
(text "{% endblock %}")
(text "{% block dropdown %}")
(hr)
(a
("class" "button")
("href" "/{{ entry.slug }}/claim")
(text "claim"))
(text "{%- endblock %}")