implement event settings

This commit is contained in:
ghost 2023-10-11 22:34:47 +03:00
parent d4fbb4b592
commit 7aa2c03abc
14 changed files with 657 additions and 171 deletions

View file

@ -33,12 +33,33 @@
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">{{ 'Common'|trans }}</td>
</tr>
{% if user.address %}
<tr>
<td class="padding-t-16-px">{{ 'Address' | trans }}</td>
<td class="padding-t-16-px">
{{ user.address }}
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M11 1a2 2 0 0 0-2 2v4a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h5V3a3 3 0 0 1 6 0v4a.5.5 0 0 1-1 0V3a2 2 0 0 0-2-2zM3 8a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1H3z"/>
</svg>
<span class="opacity-0 parent-hover-opacity-09" title="{{ 'Address hidden for others'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
</svg>
</span>
</td>
</tr>
<tr>
<td>{{ 'Joined' | trans }}</td>
<td>{{ user.added | format_ago }}</td>
</tr>
{% else %}
<tr>
<td class="padding-t-16-px">{{ 'Joined' | trans }}</td>
<td class="padding-t-16-px">{{ user.added | format_ago }}</td>
</tr>
{% endif %}
<tr>
<td class="padding-t-16-px">{{ 'Joined'|trans }}</td>
<td class="padding-t-16-px">{{ user.added | format_ago }}</td>
</tr>
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">{{ 'Access'|trans }}</td>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">{{ 'Access' | trans }}</td>
</tr>
<tr>
<td class="padding-t-16-px">
@ -121,7 +142,7 @@
<tr>
<td class="padding-y-8-px border-bottom-default text-right" colspan="2">
{% if user.owner %}
<a class="margin-r-4-px{#opacity-0 parent-hover-opacity-09#}" href="{{ path('user_profile', { userId : user.id }) }}" title="{{'Edit'|trans }}">
<a class="margin-r-4-px{#opacity-0 parent-hover-opacity-09#}" href="{{ path('user_settings', { userId : user.id }) }}" title="{{'Edit'|trans }}">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" fill="currentColor" viewBox="0 0 16 16">
<path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"/>
</svg>
@ -132,37 +153,66 @@
</tr>
<tr>
<td class="padding-t-16-px">
{{ 'Interface' | trans }}
{{ 'Theme' | trans }}
</td>
<td class="padding-t-16-px">
{{ user.theme | u.title }}
</td>
</tr>
<tr>
<td>
{{ 'Interface' | trans }}
</td>
<td>
{{ user.locale | locale_name(user.locale) | u.title }}
</td>
</tr>
<tr>
<td class="width-20">{{ 'Content'|trans }}</td>
<td class="width-20">
{{ 'Languages' | trans }}
</td>
<td class="width-80 line-height-20-px">
{% for i, locale in user.locales %}{% if i > 0 %},{% endif %} {{ locale|locale_name(locale)|u.title }}{% endfor %}
{#
{% for locale in user.locales %}
<div class="padding-y-4-px">
{{ locale|locale_name(locale)|u.title }}
</div>
{% endfor %}
#}
</td>
</tr>
<tr>
<td>{{ 'Theme'|trans }}</td>
<td>{{ user.theme | u.title }}</td>
<td>
{{ 'Sensitive' | trans }}
</td>
<td>
{% if user.sensitive %}
{{ 'Yes' | trans }}
{% else %}
{{ 'No' | trans }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Sensitive'|trans }}</td>
<td>
{% if user.sensitive %}
{{ 'Yes'|trans }}
{% else %}
{{ 'No'|trans }}
{% endif %}
{{ 'Events subscribed' | trans }}
</td>
<td>
{% for group, event in events %}
<div class="margin-b-4-px">
<span class="text-color-night">
{{ group }}:
</span>
{% set i = 0 %}
{% for key, value in event %}{% if value in user.events %}{% if i > 0 %}, {% endif %}{{ key | lower }}{% set i = i + 1 %}{% endif %}{% endfor %}
</div>
{% endfor %}
</td>
</tr>
<tr>
<td>
{{ 'Yggdrasil filter' | trans }}
</td>
<td>
{% if user.yggdrasil %}
{{ 'Yes'|trans }}
{% else %}
{{ 'No'|trans }}
{% endif %}
</td>
</tr>
</tbody>