2018-11-27 12:01:36 +01:00
|
|
|
{% macro angel() %}
|
2021-07-29 20:18:40 +02:00
|
|
|
<span class="icon-icon_angel"></span>
|
2018-11-27 12:01:36 +01:00
|
|
|
{% endmacro %}
|
|
|
|
|
2021-07-24 12:38:23 +02:00
|
|
|
{% macro icon(icon, color) %}
|
|
|
|
<span class="bi bi-{{ icon }} {% if color %} text-{{ color }} {% endif %}"></span>
|
2021-07-17 15:38:20 +02:00
|
|
|
{% endmacro %}
|
|
|
|
|
2023-02-26 11:27:41 +01:00
|
|
|
{% macro iconBool(value) %}
|
|
|
|
<span class="text-{% if value %}success{% else %}danger{% endif %}">
|
|
|
|
{{ _self.icon(value ? 'check-lg' : 'x-lg') }}
|
|
|
|
</span>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2022-05-17 18:32:06 +02:00
|
|
|
{% macro alert(message, type, raw) %}
|
2023-01-17 15:05:47 +01:00
|
|
|
<div class="alert alert-{{ type|default('info') }}" role="alert">
|
2022-05-17 18:32:06 +02:00
|
|
|
{%- if raw|default(false) -%}
|
|
|
|
{{ message|raw }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ message }}
|
|
|
|
{%- endif -%}
|
|
|
|
</div>
|
2018-11-27 12:01:36 +01:00
|
|
|
{% endmacro %}
|
2020-04-05 16:54:45 +02:00
|
|
|
|
2022-06-04 17:55:26 +02:00
|
|
|
{% macro user(user, opt) %}
|
2023-11-13 16:56:52 +01:00
|
|
|
<a href="{{ opt.url|default(url('/users', {'action': 'view', 'user_id': user.id})) }}"
|
2020-04-05 16:54:45 +02:00
|
|
|
{%- if not user.state.arrived %} class="text-muted"{% endif -%}
|
|
|
|
>
|
2022-07-10 21:12:10 +02:00
|
|
|
{{ _self.angel() }} {{ user.displayName }}
|
2022-06-06 13:00:37 +02:00
|
|
|
{%- if opt.pronoun|default(false) and config('enable_pronoun')
|
2022-06-04 17:55:26 +02:00
|
|
|
and user.personalData.pronoun %}
|
|
|
|
({{ user.personalData.pronoun }})
|
|
|
|
{% endif -%}
|
2020-04-05 16:54:45 +02:00
|
|
|
</a>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2024-05-21 19:05:33 +02:00
|
|
|
{% macro button(label, url, opt) %}
|
|
|
|
<a href="{{ url }}" class="btn btn-{{ opt.type|default('secondary') }}
|
|
|
|
{%- if opt.size is defined %} btn-{{ opt.size }}{% endif %}"
|
|
|
|
{%- if opt.title is defined %} title="{{ opt.title }}"{% endif -%}
|
2023-11-11 18:34:35 +01:00
|
|
|
>
|
2024-05-21 19:05:33 +02:00
|
|
|
{%- if opt.icon_left is defined %}{{ _self.icon(opt.icon_left) }}{% endif %}
|
2020-04-05 16:54:45 +02:00
|
|
|
{{ label }}
|
2024-05-21 19:05:33 +02:00
|
|
|
{%- if opt.icon_right is defined %}{{ _self.icon(opt.icon_right) }}{% endif %}
|
2020-04-05 16:54:45 +02:00
|
|
|
</a>
|
|
|
|
{% endmacro %}
|
2020-11-24 17:27:21 +01:00
|
|
|
|
2024-05-22 18:29:32 +02:00
|
|
|
{% macro edit(url) %}
|
|
|
|
{{ _self.button(_self.icon('pencil'), url, {'size': 'sm', 'title': __('form.edit')}) }}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro back(url) %}
|
|
|
|
{{ _self.button(_self.icon('chevron-left'), url, {'size': 'sm', 'title': __('general.back')}) }}
|
|
|
|
{% endmacro %}
|
|
|
|
|
2022-10-13 20:23:22 +02:00
|
|
|
{% macro info(text, raw) %}
|
|
|
|
<span class="help-block">
|
|
|
|
{{ _self.icon('info-circle') }}
|
|
|
|
{%- if raw|default(false) -%}
|
|
|
|
{{ text|raw }}
|
|
|
|
{%- else -%}
|
|
|
|
{{ text }}
|
|
|
|
{%- endif -%}
|
|
|
|
</span>
|
2020-11-24 17:27:21 +01:00
|
|
|
{%- endmacro %}
|
2021-07-24 12:38:23 +02:00
|
|
|
|
|
|
|
{% macro type_bg_class() -%}
|
|
|
|
{% if theme.type == 'light' %}bg-white{% else %}bg-dark{% endif %}
|
|
|
|
{%- endmacro %}
|
2021-08-05 01:00:12 +02:00
|
|
|
|
|
|
|
{% macro type_text_class() -%}
|
|
|
|
{% if theme.type == 'light' %}text-dark{% else %}text-light{% endif %}
|
|
|
|
{%- endmacro %}
|