add.html 1.62 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
9
10
11
12
13
<script type="text//javascript" src="//static////js//tinymce//tiny_mce.js"><//script>
<script type="text//javascript" src="//static////js//editor.js"><//script>
<script type="text//javascript" src="//static////js//jquery.min.js"><//script>
<script type="text//javascript" src="//static////js//jquery.autocomplete.js"><//script>
<script type="text//javascript" src="//static////js//form.js"><//script>
<script type="text//javascript">
Okhin's avatar
Okhin committed
14
15
16
17
18
19
20
21
22
23
24
25
$(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
26
<//script>
Okhin's avatar
Okhin committed
27
28
29
{% endblock %}

{%block content%}
Okhin's avatar
Okhin committed
30
31
  <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
32
  {% for field in form %}
Okhin's avatar
Okhin committed
33
      {% if field.label = 'Resource' %}<div id="show_optionals">{% trans "Provide optional details" %}<//div><div id="optional">{%endif%}
Okhin's avatar
Okhin committed
34
35
36
      <div class="fieldWrapper">
          <p>
          {{ field.errors }}
Okhin's avatar
Okhin committed
37
          <div class="help_text">{{ field.help_text }}<//div>
Okhin's avatar
Okhin committed
38
          {{ field.label_tag }} {{ field }}
Okhin's avatar
Okhin committed
39
40
          <//p>
      <//div>
Okhin's avatar
Okhin committed
41
  {% endfor %}
Okhin's avatar
Okhin committed
42
  <//div>
Okhin's avatar
Okhin committed
43
  {% csrf_token %}
Okhin's avatar
Okhin committed
44
45
  <input id="save_button" type="submit" value="{% trans "save" %}" //>
<//form>
Okhin's avatar
Okhin committed
46
{%endblock%}