{% extends "base.html" %} {% block title %}{{ _('Instrument') }} #{{ instrument.id }}: {{ single_instrument_translation.name }} — {{ service_name }}{% endblock %} {% block content %}

{{ _('Instrument') }} #{{ instrument.id }}: {{ single_instrument_translation.name }}

{% if instrument.is_hidden %}

{{ _('This instrument has been hidden from instrument lists.')}}

{% endif %} {% if single_instrument_translation.description %}
{% if instrument.description_is_markdown %}{{ single_instrument_translation.description | markdown_to_safe_html(anchor_prefix='instrument-description') | safe }}{% else %}

{{ single_instrument_translation.description }}

{% endif %}
{% endif %} {% include "instruments/instrument_scientists.html" %} {% if not current_user.is_readonly %} {% if current_user.is_admin or current_user in instrument.responsible_users %} {{ _('Edit Instrument') }} {% endif %} {% endif %} {% if instrument.actions %}

{{ _('Actions') }}

{% for action in instrument.actions %} {% if not action.is_hidden or current_user.is_admin %}

{{ action_translations[action.id].name }}

{% if action_translations[action.id].short_description %}
{% if action.short_description_is_markdown %}{{ action_translations[action.id].short_description | markdown_to_safe_html(anchor_prefix='action-short-description') | safe }}{% else %}

{{ action_translations[action.id].short_description }}

{% endif %}
{% endif %} {{ get_action_type_translation_for_action_type_in_language(action.type_id, get_user_language(current_user).id, True).view_text }} {% if not current_user.is_readonly %} {{ get_action_type_translation_for_action_type_in_language(action.type_id, get_user_language(current_user).id, True).perform_text}} {% endif %} {% endif %} {% endfor %} {% endif %} {% if is_instrument_responsible_user %}

{{ _('Instrument Scientist Notes')}}

{{ _('These notes are only visible to the instrument scientists.')}} {{ _('Read more.')}}

{% with ns = namespace() %} {% set ns.has_notes = False %} {% for translation in instrument_translations %} {% if translation.notes %} {% set ns.has_notes = True %}

{{ translation.language.names | get_translated_text }}

{% if instrument.notes_is_markdown %}{{ translation.notes | markdown_to_safe_html(anchor_prefix='instrument-notes') | safe }}{% else %}

{{ translation.notes }}

{% endif %}
{% endif %} {% endfor %} {% if not ns.has_notes %} — {% endif %} {% endwith %} {% endif %} {% if is_instrument_responsible_user or instrument.users_can_create_log_entries or instrument.users_can_view_log_entries %}

{{ _('Instrument Log')}}

{% if is_instrument_responsible_user %} {{ _('Instrument scientists can use the instrument log to keep track of problems, maintenance or other events.') }} {{ _('Instrument scientists can edit the instrument settings to configure whether users can create or view log entries.', edit_url=url_for('.edit_instrument', instrument_id=instrument.id)) }} {% if instrument.users_can_view_log_entries and instrument.users_can_create_log_entries %} {{ _('Currently, users can create and view log entries.') }} {% elif instrument.users_can_create_log_entries %} {{ _('Currently, users cannot view log entries, but they can create new entries.') }} {% elif instrument.users_can_view_log_entries %} {{ _('Currently, users can view log entries, but they cannot create new entries.') }} {% else %} {{ _('Currently, users can neither create nor view log entries.') }} {% endif %} {% else %} {% if instrument.users_can_view_log_entries %} {{ _('Instrument scientists can use the instrument log to keep track of problems, maintenance or other events.') }} {% endif %} {% if instrument.users_can_create_log_entries %} {{ _('Users can create entries in the instrument log to notify instrument scientists about any issues they encounter.') }} {% endif %} {% endif %} {{ _('Read more.')}}

{% if is_instrument_responsible_user or instrument.users_can_view_log_entries %} {% if instrument_log_entries %}
{% if not current_user.is_readonly and (is_instrument_responsible_user or instrument.users_can_create_log_entries) %} {% endif %}
{% for log_entry in instrument_log_entries %}
{% for category in log_entry.versions[-1].categories %} {{ category.title }} {% endfor %}
{% if log_entry.versions[-1].event_utc_datetime %}
{{ log_entry.versions[-1].event_utc_datetime | babel_format_datetime }}
{% endif %} {% if log_entry.versions[-1].content %} {% if log_entry.versions[-1].content_is_markdown %}
{{ log_entry.versions[-1].content | markdown_to_safe_html(anchor_prefix='log-entry-' + (log_entry.id | string)) | safe }}
{% else %}
{{ log_entry.versions[-1].content }}
{% endif %} {% else %} — {% endif %}
{{ log_entry.author.name }}, {% if log_entry.versions | length > 1 %}{{ log_entry.versions[0].utc_datetime | babel_format_datetime }}{{ log_entry.versions[-1].utc_datetime | babel_format_datetime }}{% else %}{{ log_entry.versions[-1].utc_datetime | babel_format_datetime }}{% endif %}
{% if log_entry.versions[:-1] %}
{% if log_entry.user_id == current_user.id and not current_user.is_readonly %} / {{ _('Edit log entry') }}{% endif %}
{% for version in log_entry.versions[:-1] | reverse %}

{% if version.event_utc_datetime %}
{{ version.event_utc_datetime | babel_format_datetime }}
{% endif %} {% if version.content %} {% if version.content_is_markdown %}
{{ version.content | markdown_to_safe_html(anchor_prefix='log-entry-' + (log_entry.id | string)) | safe }}
{% else %}
{{ version.content }}
{% endif %} {% else %} — {% endif %}
{{ version.utc_datetime | babel_format_datetime }}
{% endfor %} {% elif log_entry.user_id == current_user.id and not current_user.is_readonly %}
{{ _('Edit log entry') }}
{% endif %} {% if log_entry.file_attachments or log_entry.object_attachments %}
{% endif %} {% set file_attachments = log_entry.file_attachments %} {% if file_attachments %}
{{ _('Attached Files') }}:
    {% with hidden_file_attachments = [] %} {% for file_attachment in file_attachments %}{% if not file_attachment.is_hidden %}
  • {% if file_attachment | attachment_is_image %}  Fullscreen Image Preview {% else %} {% endif %} {{ file_attachment.file_name }}
  • {% else %}{{ hidden_file_attachments.append(file_attachment) or '' }}{% endif %}{% endfor %} {% if hidden_file_attachments %}
  • {{ ngettext('%(num)s hidden file', '%(num)s hidden files', hidden_file_attachments | length) }}
  • {% endif %} {% endwith %}
{% endif %} {% set object_attachments = log_entry.object_attachments %} {% if object_attachments %}
{{ _('Attached Objects') }}:
{% endif %}
{% if not current_user.is_readonly and log_entry.user_id == current_user.id %} {% endif %}
{% endfor %}
{% else %}

{{ _('There are no log entries for this instrument.') }}

{% if not current_user.is_readonly and (is_instrument_responsible_user or instrument.users_can_create_log_entries) %} {% endif %} {% endif %} {% endif %} {% if not current_user.is_readonly and (is_instrument_responsible_user or instrument.users_can_create_log_entries) %} {% set log_entry_text_missing = [] %} {% for message in get_flashed_messages() %} {% if 'Please enter a log entry text' in message %} {{ log_entry_text_missing.append(True) or '' }} {% endif %} {% endfor %} {% endif %} {% endif %} {% if mobile_upload_qrcode and mobile_upload_url%} {% endif %} {% endblock %} {% block stylesheets %} {{ super() }} {% endblock %} {% block scripts %} {{ super() }} {% if config['LOAD_OBJECTS_IN_BACKGROUND'] %} {% endif %} {% endblock %}