{% extends "base.html" %}

{% block title %}{{ _('Action Type') }} #{{ action_type.id }}: {{ action_type.name | get_translated_text(default=_('Unnamed Action Type')) }} — {{ service_name }}{% endblock %}

{% block content %}
  <h1>
    <a href="{{ url_for('.action_type', type_id=action_type.id) }}" title="{{ action_type.name | get_translated_text(default=_('Unnamed Action Type')) }}">{{ action_type.name | get_translated_text(default=_('Unnamed Action Type')) }}</a>
    {{ import_information_symbol(action_type) }}
  </h1>

  <dl>
    <dt>{{ _('Description') }}</dt><dd>{{ action_type.description | get_translated_text(default='—') }}</dd>
    <dt>{{ _('Object Name (Singular)') }}</dt><dd>{{ action_type.object_name | get_translated_text(default=_('Object')) }}</dd>
    <dt>{{ _('Object Name (Plural)') }}</dt><dd>{{ action_type.object_name_plural | get_translated_text(default=_('Objects')) }}</dd>
    <dt>{{ _('View Text') }}</dt><dd>{{ action_type.view_text | get_translated_text(default=_('View Objects')) }}</dd>
    <dt>{{ _('Perform Text') }}</dt><dd>{{ action_type.perform_text | get_translated_text(default=_('Create Object')) }}</dd>
    <dt>{{ _('Only for Administrators') }}</dt><dd>{% if action_type.admin_only %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, only administrators can create actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, all users can create actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Show on Frontpage') }}</dt><dd>{% if action_type.show_on_frontpage %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, this action type should be shown on the frontpage') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, this action type should not be shown on the frontpage') }}{% endif %}</dd>
    <dt>{{ _('Show in Navbar') }} <span data-toggle="tooltip" data-placement="top" title="{{ _('Only action types with usable actions are shown in the navbar Actions drop-down menu') }}"><i class="fa fa-question-circle" aria-hidden="true"></i></span></dt><dd>{% if action_type.show_in_navbar %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, actions of this type should be shown in the navbar') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, actions of this type should not be shown in the navbar') }}{% endif %}</dd>
    <dt>{{ _('Show in Object Filters') }}</dt><dd>{% if action_type.show_in_object_filters %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, this action type should be shown in object filters') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, this actions type should not be shown in object filters') }}{% endif %}</dd>
    <dt>{{ _('Enable Labels') }}</dt><dd>{% if action_type.enable_labels %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, labels are enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, labels are disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Files') }}</dt><dd>{% if action_type.enable_files %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, files are enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, files are disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Locations and Responsible Users') }}</dt><dd>{% if action_type.enable_locations %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, locations and responsible users are enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, locations and responsible users are disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Publications') }}</dt><dd>{% if action_type.enable_publications %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, publications are enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, publications are disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Comments') }}</dt><dd>{% if action_type.enable_comments %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, comments are enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, comments are disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Activity Log') }}</dt><dd>{% if action_type.enable_activity_log %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, the activity log is enabled for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, the activity log is disabled for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Enable Related Objects') }}</dt><dd>{% if action_type.enable_related_objects %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, show related objects for objects created with actions of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, do not show related objects for objects created with actions of this type') }}{% endif %}</dd>
    <dt>{{ _('Disable Creating Objects') }}</dt><dd>{% if action_type.disable_create_objects %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, disable creating objects of this type') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, allow creating objects of this type') }}{% endif %}</dd>
    <dt>{{ _('Allow including as Schema Template') }}</dt><dd>{% if action_type.is_template %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, allow including actions of this type as schema templates in other actions') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, disable including actions of this type as schema templates in other actions') }}{% endif %}</dd>
    <dt>{{ _('Enable Linking to Project Group') }}</dt><dd>{% if action_type.enable_project_link %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, objects created with actions of this type can be linked to a project group as project metadata') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, objects created with actions of this type cannot be linked to a project group as project metadata') }}{% endif %}</dd>
    <dt>{{ _('Enable Linking to Instrument') }}</dt><dd>{% if action_type.enable_instrument_link %}<i class="fa fa-check" aria-hidden="true"></i> {{ _('Yes, objects created with actions of this type can be linked to an instrument as instrument metadata') }}{% else %}<i class="fa fa-times" aria-hidden="true"></i> {{ _('No, objects created with actions of this type cannot be linked to an instrument as instrument metadata') }}{% endif %}</dd>
    <dt>{{ _("Usable in") }}</dt><dd><i>{% if action_type.usable_in_action_types|length == 0 %}&mdash;{% else %}
      {% for action_type in action_type.usable_in_action_types %}
      {{action_type.name | get_translated_text(default=_('Unnamed Action Type'))}}{{ ", " if not loop.last else "" }}
      {% endfor %}{% endif %}</i></dd>
    <dt>{{ _("SciCat Export Type") }}</dt><dd><i>{% if action_type.scicat_export_type is none %}&mdash;{% else %}{{ action_type.scicat_export_type.name.lower().replace('_', ' ') }}{% endif %}</i></dd>
  </dl>
  <a href="{{ url_for('.actions', t=action_type.id) }}" class="btn btn-default">{{ _('View Actions') }}</a>
  {% if current_user.is_admin and not current_user.is_readonly and action_type.fed_id is none %}
    <a href="{{ url_for('.action_type', type_id=action_type.id, mode='edit') }}" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="{{ _('Modify the settings for this action type.') }}">{{ _('Edit Action Type') }}</a>
  {% endif %}
{% endblock %}
