{% extends 'base.html' %} {% block body %} {% include('remove-exclusive-edit-mode-modal.html') %} {% embed 'view-edit.html' %} {% block createnew %}
{# CUSTOM ID #} {# TITLE #}

{% if Entity.entityData.custom_id %} {{ Entity.entityData.custom_id }} {% endif %} {{ Entity.entityData.title }}

{% include 'create-new.html' %}
{% endblock %} {% block createmodal %} {% include 'show-view-edit.html' %} {% endblock %} {% endembed %} {# Exclusive edit mode notification #}
{% if Entity.ExclusiveEditMode.isActive %} {% if Entity.ExclusiveEditMode.dataArr.locked_by != Entity.Users.userData.userid %} {% set writeLockNotice = 'This entry is opened by %s in exclusive edit mode since %s. You cannot edit it before %s. %sRequest exclusive edit mode removal%s'|trans|format( Entity.ExclusiveEditMode.dataArr.fullname, Entity.ExclusiveEditMode.dataArr.locked_at, Entity.ExclusiveEditMode.dataArr.locked_until, '' )|msg('warning', false) %} {% endif %} {% if Entity.ExclusiveEditMode.dataArr.locked_by == Entity.Users.userData.userid %} {% set writeLockNotice = 'You opened this entry in exclusive edit mode at %s and it will stay active until %s, unless deactivated manually in view mode.'|trans|format( Entity.ExclusiveEditMode.dataArr.locked_at, Entity.ExclusiveEditMode.dataArr.locked_until, )|msg('warning', false) %} {% endif %} {{ writeLockNotice|raw }} {% endif %}
{% include('view-edit-toolbar.html') %}
{% if Entity.entityData.timestamped %} {{ 'Entry was timestamped by %s on %s at %s'|trans|format(timestamperFullname, Entity.entityData.timestamped_at|date('Y-m-d'), Entity.entityData.timestamped_at|date('H:i:s'))|msg('ok', false) }} {% endif %}
{% if Entity.entityData.locked %} {{ 'Locked by %s on %s at %s'|trans|format(lockerFullname, Entity.entityData.locked_at|date('Y-m-d'), Entity.entityData.locked_at|date('H:i:s'))|msg('ok', false) }} {% endif %}
{# DATE and RATING #}
{# DATE #} {% if Entity.entityType.value != 'experiments_templates' %}
{{ 'Started on'|trans }} {{ Entity.entityData.date|date('Y-m-d') }}
{% endif %} {# RATING #}
{% if Entity.entityData.rating > 0 %} {{ Entity.entityData.rating }} {% endif %}
{% include('catstat-view.html') %} {# TAGS #}
{% if Entity.entityData.tags|length > 0 %}
{{ 'Tags'|trans }}
{% for tag in Entity.Tags.readAll() %} {{ tag.tag }} {% endfor %} {% endif %}
{# ID #}
{{ 'ID'|trans }}
{{ Entity.entityData.id }}

{% include('edit-permissions.html') %} {# SHOW EVENTS #} {% if Entity.entityData.events_start %}
{% set splitItemids = Entity.entityData.events_start_itemid|split('|') %} {% for event in Entity.entityData.events_start|split('|') %} {% endfor %}

{% endif %} {# SHOW NEXT STEP #} {% set next_step = Entity.entityData.next_step %} {% if next_step|length > 0 %} {% set nextStepsArr = next_step|split('|') %} {% set next = nextStepsArr|first %}

{{ 'Next step'|trans }}: {{ next }}

{% endif %} {# BODY (show only if not empty) #} {% set body = Entity.entityData.body_html %} {% if body != '' %} {# do not display body if set in metadata, done via css to avoid delayed disappearance after JS is executed #} {# body in view mode is text-dark for more lisibility see github issue #52 #}

{{ 'Main text'|trans }}

{{ body|raw }}

{% endif %}
{# SHOW OWNER #}
{{ 'Owner:'|trans }} {{ Entity.entityData.fullname }}
{# SHOW LAST MOD #}
{{ 'Last modified on %s'|trans|format(Entity.entityData.modified_at) }}
{# eLabID: add an if because templates don't have one #} {% if Entity.entityData.elabid %}
{{ 'Unique eLabID:'|trans }} {{ Entity.entityData.elabid }}
{% endif %}

{# METADATA view #} {% if Entity.entityData.metadata %}

{{ 'Extra fields'|trans }}

{{ Entity.entityData.metadata|formatMetadata }}

{% endif %} {% include 'steps-links-view.html' %} {% include 'uploads.html' %} {% if App.Session.get('is_auth') and not App.Session.has('is_anon') %}

{{ 'Comments'|trans }} ({{ Entity.entityData.comments|length }})

{% for comment in Entity.entityData.comments %}
{{ comment.fullname }} {{ 'commented'|trans }} {% if comment.created_at != comment.modified_at %} ({{ 'edited'|trans }} ) {% endif %} {% if comment.userid == Entity.Users.userData.userid and comment.immutable == 0 %} {% endif %}
{# the comment itself is only editable by the owner #}

{{ comment.comment|nl2br }}

{% endfor %} {# CREATE COMMENT INPUT #}
{% endif %}
{% endblock body %}