add: dedicated responses tab for profiles
This commit is contained in:
parent
9ba6320d46
commit
07a23f505b
24 changed files with 332 additions and 55 deletions
|
@ -800,7 +800,7 @@
|
|||
}"))
|
||||
(text "{%- endif %}"))
|
||||
|
||||
(text "{% if not is_global and allow_anonymous -%}")
|
||||
(text "{% if not is_global and allow_anonymous and not user -%}")
|
||||
(div
|
||||
("class" "flex gap-2 items-center")
|
||||
(input
|
||||
|
@ -1155,10 +1155,8 @@
|
|||
(icon (text "code"))
|
||||
(str (text "general:link.source_code")))
|
||||
|
||||
(a
|
||||
("href" "/reference/tetratto/index.html")
|
||||
("class" "button")
|
||||
("data-turbo" "false")
|
||||
(button
|
||||
("onclick" "trigger('me::achievement_link', ['OpenReference', '/reference/tetratto/index.html'])")
|
||||
(icon (text "rabbit"))
|
||||
(str (text "general:link.reference")))
|
||||
|
||||
|
|
|
@ -252,10 +252,17 @@
|
|||
("class" "pillmenu")
|
||||
(text "{% if is_self or is_helper or not profile.settings.hide_extra_post_tabs -%}")
|
||||
(a
|
||||
("href" "/@{{ profile.username }}")
|
||||
("href" "/@{{ profile.username }}?f=true")
|
||||
("class" "{% if selected == 'posts' -%}active{%- endif %}")
|
||||
(str (text "auth:label.posts")))
|
||||
|
||||
(text "{% if profile.settings.enable_questions -%}")
|
||||
(a
|
||||
("href" "/@{{ profile.username }}?r=true")
|
||||
("class" "{% if selected == 'responses' -%}active{%- endif %}")
|
||||
(str (text "auth:label.responses")))
|
||||
(text "{%- endif %}")
|
||||
|
||||
(a
|
||||
("href" "/@{{ profile.username }}/replies")
|
||||
("class" "{% if selected == 'replies' -%}active{%- endif %}")
|
||||
|
@ -311,8 +318,9 @@
|
|||
(span
|
||||
(text "{{ text \"settings:tab.theme\" }}")))
|
||||
(a
|
||||
("href" "#")
|
||||
("data-tab-button" "sessions")
|
||||
("href" "#/sessions")
|
||||
("onclick" "trigger('me::achievement_link', ['OpenSessionSettings', '#/sessions'])")
|
||||
(text "{{ icon \"cookie\" }}")
|
||||
(span
|
||||
(text "{{ text \"settings:tab.sessions\" }}")))
|
||||
|
|
55
crates/app/src/public/html/profile/responses.lisp
Normal file
55
crates/app/src/public/html/profile/responses.lisp
Normal file
|
@ -0,0 +1,55 @@
|
|||
(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, drawing_enabled=profile.settings.enable_drawings, allow_anonymous=profile.settings.allow_anonymous_questions) }}"))
|
||||
|
||||
(text "{%- endif %} {% if not tag and pinned|length != 0 -%}")
|
||||
(div
|
||||
("class" "card-nest")
|
||||
(div
|
||||
("class" "card small flex gap-2 items-center")
|
||||
(text "{{ icon \"pin\" }}")
|
||||
(span
|
||||
(text "{{ text \"communities:label.pinned\" }}")))
|
||||
(div
|
||||
("class" "card flex flex-col gap-4")
|
||||
(text "{% for post in pinned %} {% if post[2].read_access == \"Everybody\" -%} {% if post[0].context.repost and post[0].context.repost.reposting -%} {{ components::repost(repost=post[3], post=post[0], owner=post[1], secondary=true, community=post[2], show_community=true, can_manage_post=is_self) }} {% else %} {{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2], can_manage_post=is_self, poll=post[5]) }} {%- endif %} {%- endif %} {% endfor %}")))
|
||||
|
||||
(text "{%- endif %} {{ macros::profile_nav(selected=\"responses\") }}")
|
||||
(div
|
||||
("class" "card-nest")
|
||||
(div
|
||||
("class" "card small flex gap-2 justify-between items-center")
|
||||
(div
|
||||
("class" "flex gap-2 items-center")
|
||||
(text "{% if not tag -%} {{ icon \"clock\" }}")
|
||||
(span
|
||||
(text "{{ text \"auth:label.recent_posts\" }}"))
|
||||
(text "{% else %} {{ icon \"tag\" }}")
|
||||
(span
|
||||
(text "{{ text \"auth:label.recent_with_tag\" }}: ")
|
||||
(b
|
||||
(text "{{ tag }}")))
|
||||
(text "{%- endif %}"))
|
||||
(text "{% if user -%}")
|
||||
(a
|
||||
("href" "/search?profile={{ profile.id }}")
|
||||
("class" "button lowered small")
|
||||
(text "{{ icon \"search\" }}")
|
||||
(span
|
||||
(text "{{ text \"general:link.search\" }}")))
|
||||
(text "{%- endif %}"))
|
||||
(div
|
||||
("class" "card w-full flex flex-col gap-2")
|
||||
("ui_ident" "io_data_load")
|
||||
(div ("ui_ident" "io_data_marker"))))
|
||||
|
||||
(text "{% set paged = user and user.settings.paged_timelines %}")
|
||||
(script
|
||||
(text "setTimeout(async () => {
|
||||
await trigger(\"ui::io_data_load\", [\"/_swiss_army_timeline?user_id={{ profile.id }}&tag={{ tag }}&responses_only=true&page=\", Number.parseInt(\"{{ page }}\") - 1, \"{{ paged }}\" === \"true\"]);
|
||||
(await ns(\"ui\")).IO_DATA_DISABLE_RELOAD = true;
|
||||
console.log(\"created profile timeline\");
|
||||
}, 1000);"))
|
||||
|
||||
(text "{% endblock %}")
|
|
@ -757,7 +757,29 @@
|
|||
(text "{{ icon \"check\" }}")))
|
||||
(span
|
||||
("class" "fade")
|
||||
(text "Use an image of 1100x350px for the best results.")))))
|
||||
(text "Use an image of 1100x350px for the best results."))))
|
||||
(div
|
||||
("class" "card-nest")
|
||||
("ui_ident" "default_profile_page")
|
||||
(div
|
||||
("class" "card small")
|
||||
(b
|
||||
(text "Default profile tab")))
|
||||
(div
|
||||
("class" "card")
|
||||
(select
|
||||
("onchange" "window.SETTING_SET_FUNCTIONS[0]('default_profile_tab', event.target.selectedOptions[0].value)")
|
||||
(option
|
||||
("value" "Posts")
|
||||
("selected" "{% if profile.settings.default_profile_tab == 'Posts' -%}true{% else %}false{%- endif %}")
|
||||
(text "Posts"))
|
||||
(option
|
||||
("value" "Responses")
|
||||
("selected" "{% if profile.settings.default_profile_tab == 'Responses' -%}true{% else %}false{%- endif %}")
|
||||
(text "Responses")))
|
||||
(span
|
||||
("class" "fade")
|
||||
(text "This represents the timeline that is shown on your profile by default.")))))
|
||||
(button
|
||||
("onclick" "save_settings()")
|
||||
("id" "save_button")
|
||||
|
@ -1387,6 +1409,7 @@
|
|||
\"supporter_ad\",
|
||||
\"change_avatar\",
|
||||
\"change_banner\",
|
||||
\"default_profile_page\",
|
||||
]);
|
||||
ui.refresh_container(theme_settings, [
|
||||
\"supporter_ad\",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue