_position_form_modal.html 3.19 KB
Newer Older
Nicolas Joyard's avatar
Nicolas Joyard committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{% load i18n %}
{% load bootstrap3 %}

<div class="modal fade" id="add-position-form" tabindex="-1" role="dialog" aria-labelledby="btn-position">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <form method="post" action="">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}"><span aria-hidden="true">&times;</span></button>

          <h4 class="modal-title">{% trans "Add a representative public position" %}</h4>

        </div>

        <div class="modal-body">
16
17
18

          {% csrf_token %}

Nicolas Joyard's avatar
Nicolas Joyard committed
19
20
21
          <div class="row">
            <div class="col-sm-12">
              <div class="well well-sm text-justify">{% include "text/position_info.html" %}</div>
22
            </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
23
24
25
26
          </div>

          <div class="row">
            <div class="col-sm-6">
27
              {% bootstrap_field position_form.representatives layout='horizontal' %}
Nicolas Joyard's avatar
Nicolas Joyard committed
28
29
              {% bootstrap_field position_form.datetime layout='horizontal' %}
              {% bootstrap_field position_form.link layout='horizontal' %}
30
              {% bootstrap_field position_form.title layout='horizontal'  %}
31
            </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
32
33

            <div class="col-sm-6">
34
              {% bootstrap_field position_form.kind layout='horizontal' %}
Nicolas Joyard's avatar
Nicolas Joyard committed
35
              {% bootstrap_field position_form.themes layout='horizontal' %}
36
            </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
37
38
39
40
          </div>

          <div class="row">
            <div class="col-sm-12">
41

Nicolas Joyard's avatar
Nicolas Joyard committed
42
43
44
45
46
47
48
49
50
51
52
              <div class="col-sm-12">
                {% bootstrap_field position_form.text %}
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          {% bootstrap_form_errors position_form %}

          <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
          <button type="submit" class="btn btn-primary">{% trans "Submit public position" %}</button>
53
        </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
54
      </form>
55
    </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
56
  </div>
57
</div>
Nicolas Joyard's avatar
Nicolas Joyard committed
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

{% if position_form.errors %}
  <script>
    $(function() {
       $("#add-position-form").modal("show");
    });
  </script>
{% endif %}

{% if position_created %}
  <div class="modal fade" id="add-position-success" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="{% trans 'Close' %}"><span aria-hidden="true">&times;</span></button>

          <h4 class="modal-title">{% trans "Add a representative public position" %}</h4>
        </div>

        <div class="modal-body">
        </div>

        <div class="modal-footer">

          <div class="row">
            <div class="col-sm-12">
              <div role="alert" class="alert alert-success text-justify">{% trans "Thanks! The position was submitted and will be reviewed shortly." %}</div>
            </div>
          </div>

          <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
        </div>
      </div>
    </div>
  </div>

  <script>
    $(function() {
       $("#add-position-success").modal("show");
    });
  </script>
99
{% endif %}