add: forums ui
This commit is contained in:
parent
2be87c397d
commit
9ec52abfe4
24 changed files with 770 additions and 64 deletions
|
@ -543,8 +543,14 @@
|
|||
(text "{{ self::avatar(username=owner.username, size=\"24px\", selector_type=\"username\") }}"))
|
||||
(span
|
||||
("class" "name")
|
||||
(text "{{ self::full_username(user=owner) }}")))
|
||||
(text "{{ self::post_info(post=post, community=community) }}"))
|
||||
(text "{{ self::full_username(user=owner) }}"))
|
||||
(a
|
||||
("href" "/community/{{ community.title }}/topic/{{ post.topic }}")
|
||||
("class" "flush flex gap_1 items_center smaller_avatar")
|
||||
(text "{{ self::community_avatar(id=post.community, community=community, size=\"18px\") }}")))
|
||||
(div
|
||||
("class" "flex gap_2")
|
||||
(text "{{ self::post_info(post=post, community=community) }}")))
|
||||
(div
|
||||
("class" "card_nest_horizontal")
|
||||
; author info
|
||||
|
@ -2066,6 +2072,7 @@
|
|||
(text "{{ icon \"message-circle\" }}")
|
||||
(span
|
||||
(text "{{ text \"communities:label.chats\" }}")))
|
||||
(text "{% if not community.is_forum -%}")
|
||||
(a
|
||||
("href" "/communities/intents/post?community={{ community.id }}")
|
||||
("class" "button lowered")
|
||||
|
@ -2073,6 +2080,7 @@
|
|||
(text "{{ icon \"plus\" }}")
|
||||
(span
|
||||
(text "{{ text \"general:action.post\" }}")))
|
||||
(text "{%- endif %}")
|
||||
(text "{%- endif %} {% if can_manage_community or is_manager -%}")
|
||||
(a
|
||||
("href" "/community/{{ community.id }}/manage")
|
||||
|
@ -2606,3 +2614,39 @@
|
|||
(icon (text "trash")))
|
||||
(text "{%- endif %}"))))
|
||||
(text "{%- endmacro %}")
|
||||
|
||||
(text "{% macro topic_display(id, topic, community, show_description=true) -%}")
|
||||
(div
|
||||
("class" "flex items_center gap_2")
|
||||
(svg
|
||||
("width" "12")
|
||||
("height" "12")
|
||||
("viewBox" "0 0 12 12")
|
||||
("style" "fill: {% if topic.color == \"#000000\" -%} var(--color-primary) {%- else -%} {{ topic.color }} {%- endif %}; margin-top: 3.5px")
|
||||
(circle
|
||||
("cx" "6")
|
||||
("cy" "6")
|
||||
("r" "6")))
|
||||
(a
|
||||
("href" "/community/{{ community.title }}/topic/{{ id }}")
|
||||
("class" "flush")
|
||||
(b (text "{{ topic.title }}"))))
|
||||
(text "{% if show_description -%}")
|
||||
(span ("class" "no_p_margin") (text "{{ topic.description|markdown|safe }}"))
|
||||
(text "{%- endif %}")
|
||||
(text "{%- endmacro %}")
|
||||
|
||||
(text "{% macro topic_post_display(post, owner, is_pinned=false) -%}")
|
||||
(tr
|
||||
(td
|
||||
("class" "flex gap_1")
|
||||
(a
|
||||
("href" "/post/{{ post.id }}")
|
||||
(text "{% if is_pinned -%}Sticky: {% endif %}")
|
||||
(text "{{ post.title }}"))
|
||||
(span ("class" "fade") (text "by"))
|
||||
(text "{{ self::full_username(user=owner) }}"))
|
||||
(td (text "{{ post.comment_count }}"))
|
||||
(td (text "{{ ((post.likes + 1) / (post.dislikes + 1))|round(method=\"ceil\", precision=2) }}"))
|
||||
(td (span ("class" "date") (text "{{ post.created }}"))))
|
||||
(text "{%- endmacro %}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue