add.html 1.21 KB
Newer Older
Okhin's avatar
Okhin committed
1
2
3
4
{% extends "base.html" %}
{% load bt %}
{% load i18n %}
{% block styles %}
Okhin's avatar
Okhin committed
5
  <link rel="stylesheet" type="text/css" media="all" href="/static/css/jquery.autocomplete.css" />
Okhin's avatar
Okhin committed
6
7
{% endblock %}
{% block scripts %}
Okhin's avatar
Okhin committed
8
<script type="text/javascript">
Okhin's avatar
Okhin committed
9
10
11
12
13
14
15
16
17
18
19
20
$(document).ready(function(){
  init_form();
  {% if not form.is_bound %}
  $(".fieldWrapper").hide();
  $("#id_country").parent().show();
  $("#save_button").hide();
  {% else %}
  if($("#id_contractual").attr('checked')==false) {
    $("#id_contract_excerpt").parent().hide();
  }
  {% endif %}
});
Okhin's avatar
Okhin committed
21
</script>
Okhin's avatar
Okhin committed
22
23
24
{% endblock %}

{%block content%}
Okhin's avatar
Okhin committed
25
26
  <h2>{% trans "New Violation" %}</h2>
<form id='addForm' name="addForm" enctype="multipart/form-data" action="{% url add_violation %}" method="post">
Okhin's avatar
Okhin committed
27
  {% for field in form %}
Okhin's avatar
Okhin committed
28
      {% if field.label = 'Resource' %}<div id="show_optionals">{% trans "Provide optional details" %}</div><div id="optional">{%endif%}
Okhin's avatar
Okhin committed
29
30
31
      <div class="fieldWrapper">
          <p>
          {{ field.errors }}
Okhin's avatar
Okhin committed
32
          <div class="help_text">{{ field.help_text }}</div>
Okhin's avatar
Okhin committed
33
          {{ field.label_tag }} {{ field }}
Okhin's avatar
Okhin committed
34
35
          </p>
      </div>
Okhin's avatar
Okhin committed
36
  {% endfor %}
Okhin's avatar
Okhin committed
37
  </div>
Okhin's avatar
Okhin committed
38
  {% csrf_token %}
Okhin's avatar
Okhin committed
39
40
  <input id="save_button" type="submit" value="{% trans "save" %}" />
</form>
Okhin's avatar
Okhin committed
41
{%endblock%}