{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap3 %}


{% block extrajs %}
  <script type="text/javascript" src="{% static "admin/js/admin/RelatedObjectLookups.js" %}"></script>
  <script type="text/javascript">
    $(document).ready(function(){
      $("[id$='_date']").datepicker({ dateFormat: 'yy-mm-dd' });
    });
  </script>
{% endblock %}


{% block title %}
{% if form.instance.pk %}
  {% trans "Edit Instrument"  %}
{% else %}
  {% trans "Add Instrument" %}
{% endif %}
{% endblock %}


{% block content %}
  <div class="container">
    {% if form.errors %}
    <div class="row">
      <div class="alert alert-danger col-sm-offset-2 col-sm-6">
        <p><strong>{% trans "Please correct the errors below: " %}{{ form.field_errors }}</strong></p>
      </div>
    </div>
    {% endif %}
    <div class="col-md-3"></div>
    <div class="col-md-6">
      <form method="post" action="" enctype="multipart/form-data"
          class="form-vertical">
        {% if form.instance.pk %}
          <h3> {% trans "Edit instrument file details:" %}</h3>
        {% else %}
          <h3> {% trans "Fill the instrument file details:" %}</h3>
        {% endif %}
        {% csrf_token %}
        {% bootstrap_form form %}
        {% buttons %}
          <button type="submit" class="btn btn-primary">{% trans "Submit Changes" %}</button>
        {% endbuttons %}
      </form>
    </div>
  </div> <!--container-->
{% endblock %}
