mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 02:59:29 +00:00
Show the creating or last editing user in part or structure info.
This commit is contained in:
parent
8a7b90d0ea
commit
73c2aa232d
7 changed files with 152 additions and 8 deletions
|
|
@ -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 %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue