Files
snikket-web-portal/snikket_web/templates/library.j2
Jonas Schäfer 1b6d340d49 Modify invitation layout
- Make URLs easily copyable
- Do not show XMPP URI
2021-01-17 20:13:05 +01:00

26 lines
1.2 KiB
Django/Jinja

{% macro box(type, title, slim=False, caller=None) %}
<aside class="box{% if slim %} slim{% endif %} {{ type }}"><header>{{ title }}</header> {{ caller() }}</aside>
{% endmacro %}
{% macro avatar(from_, hash, char=None, caller=None) -%}
{%- if hash -%}
<div class="avatar" style="background-image: url('{{ url_for_avatar(from_, hash) }}');"></div>
{%- else -%}
<div class="avatar shim" style="background-color: {{ text_to_css(from_) }}"><span data-avatar-char="{{ char or from_[0] }}"></span></div>
{%- endif -%}
{%- endmacro %}
{% macro clipboard_button(label=_("Copy link"), caller=None) -%}
{%- set text = caller() -%}
<a title="{% trans content=text %}Copy &quot;{{ content }}&quot; to clipboard{% endtrans %}" aria-label="{% trans content=text %}Copy &quot;{{ content }}&quot; to clipboard{% endtrans %}" class="copy-to-clipboard" onclick="copy_to_clipboard(this); return false;" data-cliptext="{{ text }}" href="#">{{ label }}</a>
{%- endmacro %}
{% macro showuri(uri, caller=None) %}
{%- if uri is none -%}
<em>—</em>
{%- else -%}
<div><input type="text" readonly="readonly" value="{{ uri }}"></div>
<div>{% call clipboard_button() %}{{ uri }}{% endcall %}</div>
{%- endif -%}
{% endmacro %}