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

{{ _('Instrument') }} #{{ instrument.id }}: {{ instrument.name | get_translated_text(default=_('Unnamed Instrument')) }} {{ import_information_symbol(instrument) }}

{% if instrument.is_hidden %}

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

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

{{ instrument.description | get_translated_text }}

{% endif %}
{% endif %} {% if not config['DISABLE_TOPICS'] and instrument.topics %}

{{ _('Topics') }}: {% for topic in instrument.topics %} {{ topic.name | get_translated_text }} {% endfor %}

{% endif %} {% if instrument.location is not none %}
{{ _('Location') }}: {{ instrument.location | get_full_location_name(include_id=true) }}
{% endif %} {% if instrument.object_id is not none and not instrument.show_linked_object_data %}
{{ _('Information') }}: {% if linked_object and linked_object.data %} {{ linked_object.data['name']['text'] | get_translated_text(_('Object') + ' #' + (instrument.object_id | string)) }} {% else %} {{ _('Object') }} #{{ instrument.object_id }} {% 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) and instrument.fed_id is none %} {{ _('Edit Instrument') }} {% endif %} {% endif %} {% if not current_user.is_readonly and is_instrument_responsible_user and object_link_form %} {% if instrument.object_id %} {% else %} {% endif %} {% endif %} {% if instrument_actions %}

{{ _('Actions') }}

{% for action in instrument_actions %}

{{ action.name | get_translated_text }} {{ import_information_symbol(action) }}

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

{{ action.short_description | get_translated_text }}

{% endif %}
{% endif %} {{ action.type.view_text | get_translated_text(default=_('View Objects')) }} {% if not current_user.is_readonly and action.type_id is not none and action.schema is not none and (not action.disable_create_objects) and (not action.type.disable_create_objects) and (not action.admin_only or current_user.is_admin) %} {{ action.type.perform_text | get_translated_text(default=_('Create Object')) }} {% endif %} {% endfor %} {% endif %} {% if instrument.object_id and instrument.show_linked_object_data %}

{{ _('Information') }}

{% if linked_object and linked_object.schema and linked_object.data %} {% set id_prefix_root = "object" %} {% set property_path = () %} {% set id_prefix = id_prefix_for_property_path(property_path, id_prefix_root) %} {# counter for plotly_chart_plots #} {% set object_id = instrument.object_id %} {% set schema = linked_object.schema %} {% set data = linked_object.data %} {% set plot_counter = namespace(value=0) %} {% set object_reference_counter = namespace(value=0) %} {% set indent_level = 0 %} {% set show_indent_border = False %} {% include "objects/view/object.html" %} {% include "objects/view/timeseries_modals.html" %} {% else %} {{ _('Object #%(object_id)s contains additional information for this instrument.', object_id=instrument.object_id, object_url=url_for('.object', object_id=instrument.object_id)) }} {% endif %} {% 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 language in languages %} {% if language.lang_code in instrument.notes %} {% set ns.has_notes = True %}

{{ language.names | get_translated_text }}

{% if instrument.notes_is_markdown %}{{ instrument.notes[language.lang_code] | markdown_to_safe_html(anchor_prefix='instrument-notes') | safe }}{% else %}

{{ instrument.notes[language.lang_code] }}

{% 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 %}
{% set editable_log_entries = [] %} {% for log_entry in instrument_log_entries %} {% set json_log_entry_info = {} %} {% if log_entry.user_id == current_user.id and not current_user.is_readonly %} {% do json_log_entry_info.update({ 'id': log_entry.id, 'contentIsMarkdown': log_entry.versions[-1].content_is_markdown, 'content': log_entry.versions[-1].content or '', 'hasEventDatetime': False, 'eventDatetime': None, 'categoryIds': [], 'existingAttachedObjectIds': [], 'existingObjectAttachments': [], 'existingFileAttachments': [] }) %} {% if log_entry.versions[-1].event_utc_datetime %} {% do json_log_entry_info.update({ 'hasEventDatetime': True, 'eventDatetime': log_entry.versions[-1].event_utc_datetime | babel_format_datetime(format=instrument_log_entry_form.event_utc_datetime.format) }) %} {% endif %} {% for category in log_entry.versions[-1].categories %} {% do json_log_entry_info['categoryIds'].append(category.id) %} {% endfor %} {% for object_attachment in log_entry.object_attachments %} {% if not object_attachment.is_hidden %} {% do json_log_entry_info['existingAttachedObjectIds'].append(object_attachment.object_id) %} {% endif %} {% endfor %} {% for object_attachment in log_entry.object_attachments %} {% if not object_attachment.is_hidden %} {% do json_log_entry_info['existingObjectAttachments'].append({"id": object_attachment.id, "label": attached_object_names.get(object_attachment.object_id, 'Object') | get_translated_text + " (#" + (object_attachment.object_id | string) + ")"}) %} {% endif %} {% endfor %} {% for file_attachment in log_entry.file_attachments %} {% if not file_attachment.is_hidden %} {% do json_log_entry_info['existingFileAttachments'].append({"id": file_attachment.id, "label": file_attachment.file_name}) %} {% endif %} {% endfor %} {% do editable_log_entries.append(json_log_entry_info) %} {% endif %}
{% 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 %}
{% endfor %} {% if editable_log_entries %} {% endif %}
{% 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 template_values %} {% set categories_shown = {'none': True} %} {% for category in instrument_log_categories %} {% do categories_shown.update({category.id | string: True}) %} {% endfor %} {% do set_template_value("categories_shown", categories_shown) %} {% set editable_log_entry_ids = [] %} {% if instrument_log_entries %} {% for log_entry in instrument_log_entries %} {% if not current_user.is_readonly and (current_user.id == log_entry.user_id) %} {% do editable_log_entry_ids.append(log_entry.id) %} {% endif %} {% endfor %} {% endif %} {% do set_template_value("instrument_log_entries.editable_ids", editable_log_entry_ids) %} {% do set_template_value("can_create_instrument_log_entries", not current_user.is_readonly and (is_instrument_responsible_user or instrument.users_can_create_log_entries)) %} {% set ns = namespace(log_entry_text_missing=False) %} {% for message in get_flashed_messages() %} {% if 'Please enter a log entry text' in message %} {% set ns.log_entry_text_missing = True %} {% endif %} {% endfor %} {% do set_template_value("log_entry_text_missing", ns.log_entry_text_missing) %} {% do set_template_value("event_utc_datetime.format_moment", instrument_log_entry_form.event_utc_datetime.format_moment) %} {% do set_template_value("translations.month_names", get_local_month_names()) %} {% do set_template_value("translations.collapse_all_days", _('Collapse all days')) %} {% do set_template_value("translations.collapse_all_months", _('Collapse all months')) %} {% do set_template_value("translations.collapse_all_years", _('Collapse all years')) %} {% do set_template_value("translations.collapse_all_authors", _('Collapse all authors')) %} {% do set_template_value("translations.expand_all_days", _('Expand all days')) %} {% do set_template_value("translations.expand_all_months", _('Expand all months')) %} {% do set_template_value("translations.expand_all_years", _('Expand all years')) %} {% do set_template_value("translations.expand_all_authors", _('Expand all authors')) %} {% do set_template_value("translations.files_selected", _('files selected')) %} {% do set_template_value("set_instrument_log_order_url", url_for('.set_instrument_log_order')) %} {{ super() }} {% endblock %} {% block scripts %} {{ super() }} {% if get_user_language(current_user).lang_code == 'de' %} {% endif %} {% endblock %}