add: anonymous username and anonymous avatar
This commit is contained in:
parent
a78ee0f8d2
commit
434f2ba00d
3 changed files with 53 additions and 3 deletions
|
@ -598,16 +598,49 @@ and user %}
|
|||
{% endif %} {%- endmacro %} {% macro question(question, owner,
|
||||
show_community=true, secondary=false) -%}
|
||||
<div class="card{% if secondary %} secondary{% endif %} flex gap-2">
|
||||
{% if owner.id == 0 %}
|
||||
<span>
|
||||
{% if profile and profile.settings.anonymous_avatar_url %}
|
||||
<img
|
||||
src="/api/v1/util/proxy?url={{ profile.settings.anonymous_avatar_url }}"
|
||||
alt="anonymous' avatar"
|
||||
class="avatar shadow"
|
||||
loading="lazy"
|
||||
style="--size: 52px"
|
||||
/>
|
||||
{% else %} {{ components::avatar(username=owner.username,
|
||||
selector_type="username", size="52px") }} {% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<a href="/@{{ owner.username }}">
|
||||
{{ components::avatar(username=owner.username, selector_type="username",
|
||||
size="52px") }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2 flex-wrap">
|
||||
<span class="name"
|
||||
>{{ components::full_username(user=owner) }}</span
|
||||
>
|
||||
<!-- prettier-ignore -->
|
||||
<span class="name">
|
||||
{% if owner.id == 0 %}
|
||||
{% if profile and profile.settings.anonymous_username %}
|
||||
<span class="flex items-center gap-2">
|
||||
<b>{{ profile.settings.anonymous_username }}</b>
|
||||
<span
|
||||
title="Anonymous user"
|
||||
class="flex items-center"
|
||||
style="color: var(--color-primary)"
|
||||
>
|
||||
{{ icon "drama" }}
|
||||
</span>
|
||||
</span>
|
||||
{% else %}
|
||||
<b>anonymous</b>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ components::full_username(user=owner) }}
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<span class="date">{{ question.created }}</span>
|
||||
|
||||
|
|
|
@ -799,6 +799,17 @@
|
|||
settings.motivational_header,
|
||||
"input",
|
||||
],
|
||||
[[], "Anonymous", "title"],
|
||||
[
|
||||
["anonymous_username", "Anonymous username"],
|
||||
settings.anonymous_username,
|
||||
"input",
|
||||
],
|
||||
[
|
||||
["anonymous_avatar_url", "Anonymous avatar URL"],
|
||||
settings.anonymous_avatar_url,
|
||||
"input",
|
||||
],
|
||||
],
|
||||
settings,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue