aboutsummaryrefslogtreecommitdiffstats
path: root/client/templates/client/doc_create.html
blob: 39deb2da58b209e57ed282dc1b68f464a0b1b659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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
99
100
101
102
103
104
105
106
107
108
109
{% extends 'registration/base.html' %}

{% block title %}Crea Documento{% endblock %}

{% block nav %}
    <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
    <a href="#!" class="breadcrumb hide-on-med-and-down">Crea Documento</a>
{% endblock %}

{% block content %}
<div class="row">
  <div class="col l8 offset-l2 s12">
    <div class="card-panel">
      <div class="row">
        <form id="form" action="{% url 'create'%}" method="post" class="col s12">
          {% csrf_token %}
          <input type="hidden" name="action" id="action">
          {% if not next %}
            <div class="row">
              <div class="input-field col s12">
                <select name="doctype">
                  <option value="" disabled selected>Scegli</option>
                  {% for doctype in docs%}
                    <option value="{{doctype.id}}">{{doctype.name}}</option>
                  {% endfor %}
                </select>
                <label>Documento</label>
              </div>
            </div>
            <a class="btn waves-effect waves-light" onclick="window.history.back();" >
              <i class="material-icons left">navigate_before</i>Indietro
            </a>
            <a class="btn waves-effect waves-light" onclick="send('details')" >Avanti
              <i class="material-icons right">navigate_next</i>
            </a>
          {% else %}
            <input type="hidden" name="doctype" value="{{doctype.id}}">
            <div class="row">
              <div class="input-field col s12">
                <select>
                  <option disabled selected>{{doctype.name}}</option>
                </select>
                <label>Documento</label>
              </div>
            </div>
            {% if personal_data %}
              <div class="row">
                <div class="col s12">
                  <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterr&agrave; le informazioni personali, prego verificare che siano corrette e aggiornate</a>
                </div>
              </div>
            {% endif %}
            {% if medical_data %}
              <div class="row">
                <div class="col s12">
                  <a style="pointer-events: none; cursor: default;" class="btn red lighten-1"> Il documento conterr&agrave; le informazioni mediche, prego verificare che siano corrette e aggiornate</a>
                </div>
              </div>
            {% endif %}
            {% if custom_message %}
              <div class="row">
                <div class="col s12">
                  <a style="pointer-events: none; cursor: default;" class="btn red lighten-1">{{custom_message_text}}</a>
                </div>
              </div>
            {% endif %}
            {% if custom_data %}
              {% for key in keys %}
                <div class="row">
                  <div class="input-field col s12">
                    <input value="{{key.1}}" name="{{key.0.id}}" id="{{key.0.id}}" type="text">
                    <label for="{{key.0.id}}">{{key.0.key}}</label>
                  </div>
                </div>
              {% endfor %}
            {% endif %}
            <div class="row">
              <div class="col s12">
                <br>
                <a class="btn waves-effect waves-light" onclick="window.history.back();" >
                  <i class="material-icons left">navigate_before</i>Indietro
                </a>
                <a class="btn waves-effect waves-light" onclick="send('save')" >Crea
                  <i class="material-icons right">create</i>
                </a>
              </div>
            </div>
          {% endif %}
        </form>
      </div>
    </div>
  </div>
</div>
{% endblock %}

{% block script %}
$(document).ready(function(){
    $('select').formSelect();
    {% if error %}
      M.toast({html: '{{ error_text}}', classes: 'orange'})
    {% endif %}
  });
function send(id) {
  var form = document.getElementById('form')
  var action = document.getElementById('action')
  action.setAttribute('value', id);
  form.submit()
}
{% endblock %}