Project

General

Profile

Download (3.57 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / agenda / templates / agenda / act-validation.html @ 64dc45f4

1
{% extends "agenda/base.html" %}
2
{% load url from future %}
3

    
4
{% block body-class %}{{ block.super }} no-left-column{% endblock %}
5

    
6
{% block appbar %}
7
<h2>Validation des actes - {{ date|date:"DATE_FORMAT" }}</h2>
8
    <a href="..">Retourner à l'agenda</a>
9
    {% if authorized_lock %}
10
        <form method="post">
11
          {% csrf_token %}
12
          <input type="hidden" name="unlock-all" value="1">
13
          <button id="unlock-all">Déverrouiller</button>
14
        </form>
15
        <button id="validate-all">Validation automatique</button>
16
    {% endif %}
17
{% endblock %}
18

    
19
{% block beforecontent %}
20
    <div id="extra-top-links">
21
     <a href="../jours-non-verrouilles">Jours non verrouillés</a>
22
    </div>
23
{% endblock %}
24

    
25
{% block agenda-content %}
26
    {% if validation_msg %}
27
    <ul>
28
    {% for message in validation_msg %}
29
     <li>{{ message.what }} ({{ message.when }})</li>
30
    {% endfor %}
31
    </ul>
32
    {% endif %}
33

    
34

    
35
    {% if actes %}
36
    <div id="actes">
37
    {% for acte, last_status, last_status_name in actes %}
38
    <div class="frame acte" id="acte-frame-{{ acte.id }}">
39
      <h3>{{ acte.start_datetime|date:"H:i" }} - <strong><span class="lastname">{{ acte.patient.last_name }}</span> {{ acte.patient.first_name }}</strong>
40
          {% if acte.patient.paper_id %} {{ acte.patient.paper_id }} {% endif %}({{ acte.patient.id }}) -
41
          <strong>{{ acte.act_type }}</strong>
42
          <p>{% if acte.doctors %}{% for doctor in acte.doctors.all %}<span class="lastname">{{ doctor.last_name }}</span> {{ doctor.first_name }} {% endfor %}{% endif %}</p>
43
          {% if acte.description %} <span title="Un commentaire existe" class="icon-comment"></span>{% endif%}
44
      </h3>
45
      <div>
46
         <span>
47
         {% if last_status %}<strong>{{ last_status_name }}</strong>, le {{ last_status.created }}. {% if acte.is_billed %}<strong>Acte facturé</strong>{% endif %}
48
         {% else %}
49
           Non pointé.
50
         {% endif %}
51
         </span>
52
         {% if not acte.validation_locked %}
53
           <form method="post" class="inline-form">
54
           {% csrf_token %}
55
           <input type="hidden" value="{{acte.id}}" name="acte-id">
56
           <select data-previous="{{ last_status.state_name }}" name="act_state">
57
             {% for state_name, display_state_name in validation_states %}
58
             <option value="{{ state_name }}" {% if state_name == last_status.state_name %}selected{% endif %}>{{ display_state_name }}</option>
59
             {% endfor %}
60
           </select>
61
           <button {% if last_status %}disabled{% endif %}>Modifier</button>
62
           </form>
63
         {% endif %}
64
      </div>
65
    </div>
66
    {% endfor %}
67
    </div>
68
    {% else %}
69
    <p><strong>Il n'y a pas d'acte à valider le {{ date|date:"DATE_FORMAT" }}.</strong></p>
70
    {% endif %}
71
{% endblock %}
72

    
73
{% block dialogs %}
74
<div id="validate-all-dialog" title="Validation">
75
  <div id="validate-all-dialog-content">
76
  </div>
77
  <form action="{% url 'validation-all' service=service date=date %}" method="post">
78
    {% csrf_token %}
79
    <input type="hidden" name="validate-all" value="1">
80
  </form>
81
</div>
82
{% endblock %}
83

    
84

    
85
{% block page-end %}
86
<script>
87
  $('#validate-all-dialog').dialog({
88
    autoOpen: false,
89
    modal: true,
90
    buttons: {
91
      "Valider": function () { $('#validate-all-dialog form').submit(); },
92
      "Annuler": function () { $(this).dialog("close"); },
93
    },
94
  });
95
  $('#validate-all').click(function () {
96
    $('#validate-all-dialog-content').load('{% url 'validation-all' service=service date=date %}',
97
      function () {
98
        $('#validate-all-dialog').dialog('open');
99
      }
100
    );
101
  });
102
</script>
103
{% endblock %}
(1-1/16)