Show the creating or last editing user in part or structure info.

This commit is contained in:
Jan Böhmer 2020-02-06 19:22:01 +01:00
parent 8a7b90d0ea
commit 73c2aa232d
7 changed files with 152 additions and 8 deletions

View file

@ -88,4 +88,27 @@
{% else %}
<i class="fas fa-times-circle fa-fw" title="{% trans %}No{% endtrans %}"></i>
{% endif %}
{% endmacro %}
{% macro date_user_combination(entity, lastModified, datetime_format = "short") %}
{% if lastModified == true %}
{{ entity.lastModified | format_datetime(datetime_format) }}
{% else %}
{{ entity.addedDate | format_datetime(datetime_format) }}
{% endif %}
{% if is_granted('show_users', entity) %}
{% if lastModified == true %}
{% set user = getLastEditingUser(entity) %}
{% else %}
{% set user = getCreatingUser(entity) %}
{% endif %}
{% if user is not null %}
{% if user.fullName is not empty %}
<a href="{{ url('user_info', {"id": user.id}) }}" title="@{{ user.name }}"><i>({{ user.fullName }})</i></a>
{% else %}
<a href="{{ url('user_info', {"id": user.id}) }}" title="@{{ user.name }}"><i>(@{{ user.name }})</i></a>
{% endif %}
{% endif %}
{% endif %}
{% endmacro %}