calendar-social/calsocial/templates/_macros.html

31 lines
1015 B
HTML
Raw Permalink Normal View History

{% macro field(field, inline=false) %}
2018-07-13 08:19:37 +00:00
<div class="{% if inline %}inline {% endif %}field">
{% if field.errors %}
{% for error in field.errors %}
2018-07-13 08:19:37 +00:00
{{ error }}
{% endfor %}
2018-07-13 08:19:37 +00:00
<br>
{% endif %}
{% if field.widget.input_type != 'checkbox' %}
2018-07-13 08:19:37 +00:00
{{ field.label }}
{% endif %}
2018-07-13 08:19:37 +00:00
{{ field }}
{% if field.widget.input_type == 'checkbox' %}
2018-07-13 08:19:37 +00:00
{{ field.label }}<br>
{% endif %}
{% if field.description %}
2018-07-13 08:19:37 +00:00
{{ field.description }}
{% endif %}
2018-07-13 08:19:37 +00:00
</div>
{% endmacro %}
{% macro profile_link(profile) %}
<a href="{% if profile %}{{ url_for('display_profile', username=profile.user.username) }}{% else %}#{% endif %}" class="ui profile">
{% if profile and profile.builtin_avatar %}
<img src="{{ url_for('static', filename='avatars/' + profile.builtin_avatar + '.svg') }}" alt="" class="ui circular avatar image">
{% endif %}
<div class="display name">{{ profile.display_name }}</div>
<div class="handle">{{ profile or '' }}</div>
</a>
{% endmacro %}