add: profile and full search
This commit is contained in:
parent
b8b0ef7f21
commit
3e4ee8126a
52 changed files with 897 additions and 484 deletions
|
@ -51,13 +51,13 @@
|
|||
class="title name shorter flex gap-2"
|
||||
>
|
||||
<!-- prettier-ignore -->
|
||||
{% if community.context.display_name %}
|
||||
{% if community.context.display_name -%}
|
||||
{{ community.context.display_name }}
|
||||
{% else %}
|
||||
{{ community.title }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
{% if community.context.is_nsfw %}
|
||||
{% if community.context.is_nsfw -%}
|
||||
<span
|
||||
title="NSFW community"
|
||||
class="flex items-center"
|
||||
|
@ -65,10 +65,10 @@
|
|||
>
|
||||
{{ icon "square-asterisk" }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</h3>
|
||||
|
||||
{% if user %} {% if user.id != community.owner
|
||||
{% if user -%} {% if user.id != community.owner
|
||||
%}
|
||||
<div class="dropdown">
|
||||
<button
|
||||
|
@ -92,16 +92,16 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %} {% endif %}
|
||||
{%- endif %} {%- endif %}
|
||||
</div>
|
||||
|
||||
<span class="fade">{{ community.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if user %}
|
||||
{% if user -%}
|
||||
<div class="card flex gap-2 flex-wrap" id="join_or_leave">
|
||||
{% if not is_owner %} {% if not is_joined %} {% if not
|
||||
{% if not is_owner -%} {% if not is_joined -%} {% if not
|
||||
is_pending %}
|
||||
<button class="primary" onclick="join_community()">
|
||||
{{ icon "circle-plus" }}
|
||||
|
@ -170,7 +170,7 @@
|
|||
});
|
||||
};
|
||||
</script>
|
||||
{% endif %} {% else %}
|
||||
{%- endif %} {% else %}
|
||||
<button
|
||||
class="quaternary red"
|
||||
onclick="leave_community()"
|
||||
|
@ -187,7 +187,7 @@
|
|||
<span>{{ text "communities:label.chats" }}</span>
|
||||
</a>
|
||||
|
||||
{% if user and can_post %}
|
||||
{% if user and can_post -%}
|
||||
<a
|
||||
href="/communities/intents/post?community={{ community.id }}"
|
||||
class="button quaternary"
|
||||
|
@ -196,7 +196,7 @@
|
|||
{{ icon "plus" }}
|
||||
<span>{{ text "general:action.post" }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<script>
|
||||
globalThis.leave_community = async () => {
|
||||
|
@ -227,7 +227,7 @@
|
|||
});
|
||||
};
|
||||
</script>
|
||||
{% endif %} {% else %}
|
||||
{%- endif %} {% else %}
|
||||
<a
|
||||
href="/chats/{{ community.id }}/0"
|
||||
class="button quaternary"
|
||||
|
@ -244,7 +244,8 @@
|
|||
{{ icon "plus" }}
|
||||
<span>{{ text "general:action.post" }}</span>
|
||||
</a>
|
||||
{% endif %} {% if can_manage_community or is_manager %}
|
||||
{%- endif %} {% if can_manage_community or is_manager
|
||||
-%}
|
||||
<a
|
||||
href="/community/{{ community.id }}/manage"
|
||||
class="button primary"
|
||||
|
@ -254,10 +255,10 @@
|
|||
>{{ text "communities:action.configure" }}</span
|
||||
>
|
||||
</a>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-nest flex flex-col">
|
||||
|
@ -296,7 +297,7 @@
|
|||
>{{ community.likes - community.dislikes
|
||||
}}</b
|
||||
>
|
||||
{% if user %}
|
||||
{% if user -%}
|
||||
<div
|
||||
class="flex gap-1 reactions_box"
|
||||
hook="check_reactions"
|
||||
|
@ -307,7 +308,7 @@
|
|||
likes=community.likes,
|
||||
dislikes=community.dislikes) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -315,7 +316,7 @@
|
|||
</div>
|
||||
|
||||
<div class="rhs w-full">
|
||||
{% if can_read %} {% block content %}{% endblock %} {% else %}
|
||||
{% if can_read -%} {% block content %}{% endblock %} {% else %}
|
||||
<div class="card-nest">
|
||||
<div class="card small flex items-center gap-2">
|
||||
{{ icon "frown" }}
|
||||
|
@ -331,7 +332,7 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<title>Create post - {{ config.name }}</title>
|
||||
{% endblock %} {% block body %} {{ macros::nav() }}
|
||||
<main class="flex flex-col gap-2">
|
||||
{% if drafts|length > 0 %}
|
||||
{% if drafts|length > 0 -%}
|
||||
<div class="pillmenu">
|
||||
<a href="#/create" data-tab-button="create" class="active">
|
||||
{{ icon "plus" }}
|
||||
|
@ -14,7 +14,7 @@
|
|||
<span>{{ text "communities:label.drafts" }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="card-nest" data-tab="create">
|
||||
<div class="card small flex items-center justify-between gap-2">
|
||||
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
|
||||
<div class="card tertiary flex flex-col gap-2">
|
||||
{% if draft %}
|
||||
{% if draft -%}
|
||||
<div
|
||||
class="card secondary w-full flex items-center justify-between gap-2 small"
|
||||
>
|
||||
|
@ -54,7 +54,7 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="card-nest">
|
||||
<div class="card small flex flex-row gap-2 items-center">
|
||||
|
@ -67,7 +67,7 @@
|
|||
>
|
||||
<option
|
||||
value="{{ config.town_square }}"
|
||||
selected="{% if not selected_community %}true{% else %}false{% endif %}"
|
||||
selected="{% if not selected_community -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
{{ text "auth:link.my_profile" }}
|
||||
</option>
|
||||
|
@ -75,14 +75,14 @@
|
|||
{% for community in communities %}
|
||||
<option
|
||||
value="{{ community.id }}"
|
||||
selected="{% if selected_community == community.id %}true{% else %}false{% endif %}"
|
||||
selected="{% if selected_community == community.id -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
<!-- prettier-ignore -->
|
||||
{% if community.context.display_name %}
|
||||
{% if community.context.display_name -%}
|
||||
{{ community.context.display_name }}
|
||||
{% else %}
|
||||
{{ community.title }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
@ -105,7 +105,7 @@
|
|||
minlength="2"
|
||||
maxlength="4096"
|
||||
>
|
||||
{% if draft %}{{ draft.content }}{% endif %}</textarea
|
||||
{% if draft -%}{{ draft.content }}{%- endif %}</textarea
|
||||
>
|
||||
</div>
|
||||
|
||||
|
@ -114,9 +114,9 @@
|
|||
<div class="flex justify-between gap-2">
|
||||
<div class="flex gap-2">
|
||||
{{ components::emoji_picker(element_id="content",
|
||||
render_dialog=true) }} {% if is_supporter %} {{
|
||||
render_dialog=true) }} {% if is_supporter -%} {{
|
||||
components::file_picker(files_list_id="files_list")
|
||||
}} {% endif %}
|
||||
}} {%- endif %}
|
||||
|
||||
<button
|
||||
class="small square quaternary"
|
||||
|
@ -129,7 +129,7 @@
|
|||
</div>
|
||||
|
||||
<div class="flex gap-2">
|
||||
{% if draft %}
|
||||
{% if draft -%}
|
||||
<button
|
||||
class="secondary small square"
|
||||
title="Save as Draft"
|
||||
|
@ -147,7 +147,7 @@
|
|||
>
|
||||
{{ icon "notepad-text-dashed" }}
|
||||
</button>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<button class="primary">
|
||||
{{ text "communities:action.create" }}
|
||||
|
@ -221,7 +221,7 @@
|
|||
}
|
||||
|
||||
// remove draft
|
||||
// {% if draft %}
|
||||
// {% if draft -%}
|
||||
if ("{{ draft.id }}") {
|
||||
fetch("/api/v1/drafts/{{ draft.id }}", {
|
||||
method: "DELETE",
|
||||
|
@ -234,7 +234,7 @@
|
|||
]);
|
||||
});
|
||||
}
|
||||
// {% endif %}
|
||||
// {%- endif %}
|
||||
|
||||
// ...
|
||||
setTimeout(() => {
|
||||
|
@ -325,7 +325,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{% if drafts|length > 0 %}
|
||||
{% if drafts|length > 0 -%}
|
||||
<div class="card-nest tertiary hidden" data-tab="drafts">
|
||||
<div class="card small flex items-center gap-2">
|
||||
{{ icon "notepad-text-dashed" }}
|
||||
|
@ -384,7 +384,7 @@
|
|||
});
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
<div class="card flex flex-col gap-4">
|
||||
<!-- prettier-ignore -->
|
||||
{% for post in pinned %}
|
||||
{% if post[0].context.repost and post[0].context.repost.reposting %}
|
||||
{% if post[0].context.repost and post[0].context.repost.reposting -%}
|
||||
{{ components::repost(repost=post[2], post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
|
||||
{% else %}
|
||||
{{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="card-nest">
|
||||
<div class="card small flex gap-2 items-center">
|
||||
|
@ -31,11 +31,11 @@
|
|||
<div class="card flex flex-col gap-4">
|
||||
<!-- prettier-ignore -->
|
||||
{% for post in feed %}
|
||||
{% if post[0].context.repost and post[0].context.repost.reposting %}
|
||||
{% if post[0].context.repost and post[0].context.repost.reposting -%}
|
||||
{{ components::repost(repost=post[2], post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
|
||||
{% else %}
|
||||
{{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
{% endfor %}
|
||||
|
||||
{{ components::pagination(page=page, items=feed|length) }}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<title>My communities - {{ config.name }}</title>
|
||||
{% endblock %} {% block body %} {{ macros::nav(selected="communities") }}
|
||||
<main class="flex flex-col gap-2">
|
||||
{% if user %}
|
||||
{% if user -%}
|
||||
<div class="card-nest">
|
||||
<div class="card small">
|
||||
<b>{{ text "communities:label.create_new" }}</b>
|
||||
|
@ -31,8 +31,8 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
{% if list|length >= 4 %} {{ components::supporter_ad(body="Become a
|
||||
supporter to create up to 10 communities!") }} {% endif %} {% endif %}
|
||||
{% if list|length >= 4 -%} {{ components::supporter_ad(body="Become a
|
||||
supporter to create up to 10 communities!") }} {%- endif %} {%- endif %}
|
||||
|
||||
<div class="card-nest w-full">
|
||||
<div class="card small flex items-center justify-between gap-2">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</div>
|
||||
|
||||
<div class="card flex flex-col gap-4">
|
||||
{% if page == 0 %}
|
||||
{% if page == 0 -%}
|
||||
<div class="card-nest">
|
||||
<div class="card small flex items-center gap-2">
|
||||
{{ icon "crown" }}
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
{{ components::user_card(user=owner) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
{% for item in list %}
|
||||
|
@ -28,7 +28,7 @@
|
|||
<span class="date">{{ item[0].created }}</span>
|
||||
</span>
|
||||
|
||||
{% if can_manage_roles %}
|
||||
{% if can_manage_roles -%}
|
||||
<a
|
||||
href="/community/{{ community.id }}/manage?uid={{ item[1].id }}#/members"
|
||||
class="button small quaternary"
|
||||
|
@ -36,7 +36,7 @@
|
|||
{{ icon "pencil" }}
|
||||
<span>{{ text "general:action.manage" }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
{{ components::user_card(user=item[1]) }}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<div class="flex gap-2">
|
||||
{{ components::emoji_picker(element_id="content",
|
||||
render_dialog=true) }} {% if is_supporter %} {{
|
||||
render_dialog=true) }} {% if is_supporter -%} {{
|
||||
components::file_picker(files_list_id="files_list") }} {% endif
|
||||
%}
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="card-nest w-full" data-tab="replies">
|
||||
<div class="card small flex items-center gap-2">
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
{{ macros::community_nav(community=community, selected="questions") }}
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
{% if user and can_post %}
|
||||
{% if user and can_post -%}
|
||||
<div style="display: contents">
|
||||
{{ components::create_question_form(community=community.id,
|
||||
is_global=true) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
<div class="card-nest">
|
||||
<div class="card small flex gap-2 items-center">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="card-nest">
|
||||
<div class="card small flex items-center gap-2">
|
||||
{{ icon "search" }}
|
||||
<span>{{ text "communities:label.search" }}</span>
|
||||
<span>{{ text "general:link.search" }}</span>
|
||||
</div>
|
||||
|
||||
<form class="card flex flex-col gap-4">
|
||||
|
|
|
@ -18,17 +18,17 @@
|
|||
<span>{{ text "communities:tab.members" }}</span>
|
||||
</a>
|
||||
|
||||
{% if can_manage_channels %}
|
||||
{% if can_manage_channels -%}
|
||||
<a href="#/channels" data-tab-button="channels">
|
||||
{{ icon "rss" }}
|
||||
<span>{{ text "communities:tab.channels" }}</span>
|
||||
</a>
|
||||
{% endif %} {% if can_manage_emojis %}
|
||||
{%- endif %} {% if can_manage_emojis -%}
|
||||
<a href="#/emojis" data-tab-button="emojis">
|
||||
{{ icon "smile" }}
|
||||
<span>{{ text "communities:tab.emojis" }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
<div class="w-full flex flex-col gap-2" data-tab="general">
|
||||
|
@ -42,13 +42,13 @@
|
|||
<select onchange="save_access(event, 'read')">
|
||||
<option
|
||||
value="Everybody"
|
||||
selected="{% if community.read_access == 'Everybody' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.read_access == 'Everybody' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Everybody
|
||||
</option>
|
||||
<option
|
||||
value="Joined"
|
||||
selected="{% if community.read_access == 'Joined' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.read_access == 'Joined' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Joined
|
||||
</option>
|
||||
|
@ -65,19 +65,19 @@
|
|||
<select onchange="save_access(event, 'join')">
|
||||
<option
|
||||
value="Everybody"
|
||||
selected="{% if community.join_access == 'Everybody' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.join_access == 'Everybody' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Everybody
|
||||
</option>
|
||||
<option
|
||||
value="Request"
|
||||
selected="{% if community.join_access == 'Request' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.join_access == 'Request' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Request
|
||||
</option>
|
||||
<option
|
||||
value="Nobody"
|
||||
selected="{% if community.join_access == 'Nobody' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.join_access == 'Nobody' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Nobody
|
||||
</option>
|
||||
|
@ -94,19 +94,19 @@
|
|||
<select onchange="save_access(event, 'write')">
|
||||
<option
|
||||
value="Everybody"
|
||||
selected="{% if community.write_access == 'Everybody' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.write_access == 'Everybody' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Everybody
|
||||
</option>
|
||||
<option
|
||||
value="Joined"
|
||||
selected="{% if community.write_access == 'Joined' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.write_access == 'Joined' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Joined
|
||||
</option>
|
||||
<option
|
||||
value="Owner"
|
||||
selected="{% if community.write_access == 'Owner' %}true{% else %}false{% endif %}"
|
||||
selected="{% if community.write_access == 'Owner' -%}true{% else %}false{%- endif %}"
|
||||
>
|
||||
Owner only
|
||||
</option>
|
||||
|
@ -267,7 +267,7 @@
|
|||
<div class="card flex flex-col gap-2 w-full" id="membership_info"></div>
|
||||
</div>
|
||||
|
||||
{% if can_manage_channels %}
|
||||
{% if can_manage_channels -%}
|
||||
<div
|
||||
class="card tertiary w-full hidden flex flex-col gap-2"
|
||||
data-tab="channels"
|
||||
|
@ -441,7 +441,7 @@
|
|||
});
|
||||
}
|
||||
</script>
|
||||
{% endif %} {% if can_manage_emojis %}
|
||||
{%- endif %} {% if can_manage_emojis -%}
|
||||
<div
|
||||
class="card tertiary w-full hidden flex flex-col gap-2"
|
||||
data-tab="emojis"
|
||||
|
@ -602,7 +602,7 @@
|
|||
});
|
||||
};
|
||||
</script>
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue