aboutsummaryrefslogtreecommitdiffstats
path: root/server/templates/server/index.html
blob: d8a13f2550e29f1c678c47a5524a79f66c22532b (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{% extends 'registration/base_admin.html' %}

{% block title %}Admin{% endblock %}

{% block breadcrumb %}
    <a href="#!" class="breadcrumb hide-on-med-and-down">Admin</a>
{% endblock %}

{% block content %}
<div class="row">
  {% if user.is_staff %}
  <div class="col l5 s12">
    <div class="card large">
      <div class="card-content">
        <p>
        <table>
            <tr>
                <th>Username</th>
                <th>Nome</th>
                <th>Cognome</th>
            </tr>
            {% for user in users %}
                <tr>
                {% for att in user %}
                    <td>{{att}}</td>
                {% endfor %}
                </tr>
            {% endfor %}
        </table> 
        </p>
      </div>
      <div class="card-action">
        <div class="hide-on-med-and-down">
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'ulist' %}">Utenti</a>
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'uapprove' %}">Approva utente</a>
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'request' %}">Richiedi dati</a>
        </div>

        <div class="hide-on-large-only">
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'ulist' %}">Utenti</a>
          <br>
          <br>
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'uapprove' %}">Approva utente</a>
          <br>
          <br>
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'request' %}">Richiedi dati</a>
        </div>
      </div>
    </div>
  </div>
  {% endif %}
  {% if user.is_staff %}
  <div class="col l7 s12">
  {% else %}
  <div class="col s12">
  {% endif %}
    <div class="card large">
      <div class="card-content">
        <form id="form" action="{% url 'server'%}" method="post">
          {% csrf_token %}
          <div class="row">
            <div class="col s12">
              <div id="select_switch" class="switch col s12">
                Documenti visibili ad aggiunti<br class="hide-on-med-and-up">
                <label>
                  No
                  <input onclick="execute_confirm()" name="doc_view" type="checkbox" {{doc_view_check}}>
                  <span class="lever"></span>
                  Si
                </label>
              </div>
              <a style="display: none" id="send_button" class="waves-effect waves-light btn green" onclick="form.submit()"><i class="material-icons left">check</i> Applica</a>
            </div>
          </div>
        </form>
        <ul class="collection">
          {% for doctype in docs %}
            <li class="collection-item">
                {% if not doctype.0.enabled %}
                    <i class="material-icons left">visibility_off</i>
                {% endif %}
                {% if not doctype.0.group_private %}
                    <i class="material-icons left">public</i>
                {% endif %}
                {% if doctype.0.auto_sign %}
                  <i class="material-icons left">assignment_turned_in</i>
                {% endif %}
                {{doctype.0.name}}
                <span class="new badge {{color}}" data-badge-caption="">{{doctype.1}}</span>
          {% endfor %}
        </ul>
      </div>
      <div class="card-action">
        <div class="hide-on-med-and-down">
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Tipi</a>
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'doclist' %}">Documenti</a>
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'docapprove' %}">Approva documento</a>
          <a class="waves-effect waves-light btn {{color}}" href="{% url 'docupload' %}">Carica firma</a>
        </div>

        <div class="hide-on-large-only">
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'doctype' %}">Tipi</a>
          <br>
          <br>
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'doclist' %}">Documenti</a>
          <br>
          <br>
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'docapprove' %}">Approva documento</a>
          <br>
          <br>
          <a class="col s12 waves-effect waves-light btn {{color}}" href="{% url 'docupload' %}">Carica firma</a>
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}

{% block script %}
function execute_confirm() {
  var selection = document.getElementById('select_switch')
  var button = document.getElementById('send_button')
  selection.style.display = "none"
  button.style.display = "inline-block"
  {% if doc_view_check == 'checked="checked"'%}
    button.innerHTML = "Applica (gli aggiunti <b>NON</b> potranno vedere i documenti)"
  {% else %}
    button.innerHTML = "Applica (gli aggiunti <b>POTRANNO</b> vedere i documenti)"
  {% endif %}
}
{% endblock %}