{% extends "base.html" %}

{% set calculations = [] %}

{% block stylesheets %}
  {{ super() }}
  <link rel="stylesheet" href="{{ fingerprinted_static('bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css') }}" />
  <link rel="stylesheet" href="{{ fingerprinted_static('bootstrap-select/css/bootstrap-select.min.css') }}" />
  <link rel="stylesheet" href="{{ fingerprinted_static('bootstrap-tagsinput/css/bootstrap-tagsinput.css') }}" />
  <link rel="stylesheet" href="{{ fingerprinted_static('inscrybmde/css/inscrybmde.min.css') }}" />
{% endblock %}


{% block content %}
  {% if errors_by_title %}
    <div class="alert alert-danger" role="alert">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      {{ _('The object could not be saved due to an error.') }}
      <input type="checkbox" id="object-form-errors-show-more-input"/>
      <label id="object-form-errors-show-more-label" for="object-form-errors-show-more-input"> {{ _('Show more') }}</label>
      <div id="object-form-errors-show-more-content">
        <ul>
          {% for title in errors_by_title %}
          <li><strong>{{ title}}</strong>: <ul>{% for message in errors_by_title[title] %}<li>{{ message }}</li>{% endfor %}</ul></li>
          {% endfor %}
        </ul>
      </div>
    </div>
  {% endif %}
{% endblock %}

{% block template_values %}
  {% do set_template_value("tags", tags) %}
  {% do set_template_value("temporary_file_upload_url", url_for(".temporary_file_upload")) %}
  {% do set_template_value("form_data", form_data or {}) %}
  {% do set_template_value("file_names_by_id", file_names_by_id or {}) %}
  {% do set_template_value("errors", errors) %}
  {% do set_template_value("local_decimal_delimiter", get_local_decimal_delimiter()) %}
  {% do set_template_value("translations.filter_by_action", _('Filter by Action…')) %}
  {% do set_template_value("translations.error", _('Error:')) %}
  {% do set_template_value("translations.field_index_placeholder", _('Field %(index)s', index="INDEX_PLACEHOLDER")) %}
  {% do set_template_value("translations.sets", _('sets:')) %}

  {{ super() }}
{% endblock %}

{% block scripts %}
  {{ super() }}
  <script src="{{ fingerprinted_static('bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js') }}"></script>
  <script src="{{ fingerprinted_static('bootstrap-select/js/bootstrap-select.min.js') }}"></script>
  <script src="{{ fingerprinted_static('bootstrap-tagsinput/js/bootstrap-tagsinput.min.js') }}"></script>
  <script src="{{ fingerprinted_static('typeahead/js/typeahead.bundle.min.js') }}"></script>
  <script src="{{ fingerprinted_static('inscrybmde/js/inscrybmde.min.js') }}"></script>
  <script src="{{ fingerprinted_static('math-js/js/math.min.js') }}"></script>
  <script src="{{ fingerprinted_static('sampledb/js/object_form/hazards.js') }}" type="module"></script>
  <script src="{{ fingerprinted_static('sampledb/js/object_form/tags.js') }}" type="module"></script>
  <script src="{{ fingerprinted_static('sampledb/js/object_form/datetime.js') }}" type="module"></script>
  <script src="{{ fingerprinted_static('sampledb/js/object_form/file.js') }}" type="module"></script>
  <script src="{{ fingerprinted_static('sampledb/js/page/form-base.js') }}" type="module"></script>
{% endblock %}
