Project

General

Profile

« Previous | Next » 

Revision fbfab2cc

Added by Serghei Mihai about 10 years ago

agenda: ressource appointment view redesigned to look like worker's

Closes #5284

View differences:

calebasse/agenda/templates/agenda/ajax-ressource-tab.html
10 10
    {% if appointment.length %}<span class="length">{{ appointment.length }} min</span> {% endif %}
11 11
    {% if appointment.act_type %}<span class="act_type">{{ appointment.act_type }}</span>{% endif %}
12 12
    <span class="participants">
13
    {% if appointment.len_workers > 4 %}
14
    {% if appointment.workers_absent %}<span class="absent" title="Au moins un intervenant est absent">{% endif %}
13
      {% if appointment.len_workers > 4 %}
14
      {% if appointment.workers_absent %}<span class="absent" title="Au moins un intervenant est absent">{% endif %}
15 15
        {{ appointment.len_workers }} inter.
16 16
        {% if appointment.workers_absent %}</span>{% endif %}
17
    {% else %}
18
    {% if appointment.workers %}
19
    {% for worker in appointment.workers %}
20
    {% if worker in appointment.workers_absent %}<span class="absent" title="Absent">{% endif %}
17
      {% else %}
18
      {% if appointment.workers %}
19
      {% for worker in appointment.workers %}
20
      {% if worker in appointment.workers_absent %}<span class="absent" title="Absent">{% endif %}
21 21
        {{ worker.worker.initials }}{% if not forloop.last %} {% endif %}
22 22
        {% if worker in appointment.workers_absent %}</span>{% endif %}
23
    {% endfor %}
24
    {% endif %}
25
    {% endif %}
23
      {% endfor %}
24
      {% endif %}
25
      {% endif %}
26 26
    </span>
27 27

  
28 28
    <span class="right">
......
33 33
      {% if appointment.event_id %}
34 34
      {% if appointment.is_recurrent %} R {% endif %}
35 35
      {% if service in appointment.services_names %}
36
        {% if appointment.patient_record_id %}
37
           <button title="Éditer un rendez-vous" class="edit-appointment icon-edit" data-event-id="{{ appointment.event_id }}"></button>
38
        {% else %}
39
           <button title="Éditer un événement" class="edit-event icon-edit" data-event-id="{{ appointment.event_id }}">
36
      {% if appointment.patient_record_id %}
37
      <button title="Éditer un rendez-vous" class="edit-appointment icon-edit" data-event-id="{{ appointment.event_id }}"></button>
38
      {% else %}
39
      <button title="Éditer un événement" class="edit-event icon-edit" data-event-id="{{ appointment.event_id }}">
40
        {% endif %}
41
        <button class="remove-appointment icon-remove-sign" title="Supprimer un rendez-vous" data-url="{% url 'delete-occurrence' date=date service=service pk=appointment.event_id %}" data-rdv="{{ appointment.title }}"></button>
40 42
        {% endif %}
41
           <button class="remove-appointment icon-remove-sign" title="Supprimer un rendez-vous" data-url="{% url 'delete-occurrence' date=date service=service pk=appointment.event_id %}" data-rdv="{{ appointment.title }}"></button>
42 43
        {% endif %}
43
     {% endif %}
44 44
    </span>
45 45
  </h3>
46

  
47 46
  <div>
48 47
    {% if appointment.type == 'free' %}
49 48
    <button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}" data-duration="{{ appointment.length }}">Nouveau rendez-vous patient</button>
......
57 56
      {{ worker.first_name }} <span class="lastname">{{ worker.last_name }}</span>{% if forloop.last %}.{% else %}, {% endif %}
58 57
      {% endfor %}
59 58
    </p>
59
    <p class="phones">
60
    {% if appointment.patient.mobile %}
61
    <span title="{{ appointment.patient.first_name }} {{ appointment.patient.last_name|upper }} (Patient - Perso)" class="icon-user-space">
62
    {{ appointment.patient.mobile }}
63
    </span>
60 64
    {% endif %}
61
      {% if service in appointment.services_names %}
62
        <div class="tabs-ressource-{{ ressource_agenda.ressource.id }} textedit">
63
          <span></span>
64
          <textarea>{{ appointment.description }}</textarea>
65
          <button disabled="disabled" data-event-id="{{ appointment.event_id }}" data-date="{{ date|date:"Y-m-d" }}">✔</button>
66
        </div>
67
      {% else %}
68
        <p>{{ appointment.description }}</p>
69
      {% endif %}
65
    {% if appointment.patient.phone %}
66
    <span title="{{ appointment.patient.first_name }} {{ appointment.patient.last_name|upper }} (Patient - Pro)" class="icon-user-space">
67
    {{ appointment.patient.phone }}
68
    </span>
70 69
    {% endif %}
71
    {% if appointment.patient_record_id %}
72
    <p class="phones">
73
      {% for address in appointment.patient.addresses.all %}
74
      {% if address.place_of_life and address.phone %}
75
      <span title="{{ address.number }} {{ address.street }} {{ address.zip_code }} {{ address.city }}" class="icon-home-space">{{ address.phone }}</span>
76
      {% for contact in address.patientcontact_set.all  %}
77
        {% if contact.mobile %}
78
          <span title="{{ contact.first_name }} {{ contact.last_name|upper }}" class="icon-user-space">{{ contact.mobile }}</span>
79
        {% endif %}
80
      {% endfor %}
70
    {% for address in appointment.patient.addresses.all %}
71
      {% if address.place_of_life %}
72
        {% if address.phone %}<span title="{{ address.display_name }}" class="icon-home-space">{{ address.phone }}</span>{% endif %}
73
        {% for contact in address.patientcontact_set.all  %}
74
          {% if contact.id != appointment.patient.id %}
75
          {% if contact.mobile %}<span title="{{ contact.first_name }} {{ contact.last_name|upper }} (Perso)" class="icon-user-space">{{ contact.mobile }}</span>{% endif %}
76
          {% if contact.phone %}<span title="{{ contact.first_name }} {{ contact.last_name|upper }} (Pro)" class="icon-user-space">{{ contact.phone }}</span>{% endif %}
77
          {% endif %}
78
        {% endfor %}
81 79
      {% endif %}
82
      {% endfor %}
80
    {% endfor %}
83 81
    </p>
82
    {% endif %}
83
    {% endif %}
84

  
85
    {% if appointment.patient_record_id %}
84 86
    <a href="/{{ service }}/dossiers/{{ appointment.patient_record_id }}/view" target="_blank">Dossier patient</a> -
85 87
    <a href="/{{ service }}/dossiers/{{ appointment.patient_record_id }}/view#tab=5" target="_blank">Prochains rendez-vous</a> -
86 88
    <a href="#" class="generate-mail-btn" data-dossier-id="{{ appointment.patient_record_id }}" data-date="{{date|date:"Y-m-d"}}" data-event-id="{{ appointment.event_id }}" data-next-url="{{ request.get_full_path }}">Courrier</a>
87 89
    {% endif %}
90

  
88 91
    {% if appointment.validation %}
89
    <div><span>{% if appointment.validation.1 %}<strong>{{ appointment.validation.2 }}</strong>, le {{ appointment.validation.1.created }} par {{ appointment.validation.1.author }}
92
    <div>
93
      <span>{% if appointment.validation.1 %}<strong>{{ appointment.validation.2 }}</strong>, le {{ appointment.validation.1.created }} par {{ appointment.validation.1.author }}
90 94
        {% if appointment.validation.1.auto %}(par validation automatique){% endif %}. {% if appointment.validation.0.is_billed %}<strong>Acte facturé</strong>{% endif %}
91 95
        {% else %}
92 96
        Non pointé.
93 97
        {% endif %}
94 98
      </span>
95
      {% if not appointment.validation.0.validation_locked and appointment.validation.3 %}
96
      <form method="post" class="inline-form">
97
        {% csrf_token %}
98
        <input type="hidden" value="{{appointment.validation.0.id}}" name="acte-id">
99
        <select data-previous="{{ last_status.state_name }}" name="act_state">
100
          {% for state_name, display_state_name in appointment.validation.3.items %}
101
          <option value="{{ state_name }}" {% if state_name == appointment.validation.1.state_name %}selected{% endif %}>{{ display_state_name }}</option>
102
          {% endfor %}
103
        </select>
104
        <button>Pointer</button>
105
      </form>
106
      {% endif %}
107 99
    </div>
108 100
    {% endif %}
101

  
102
    {% if not appointment.validation.0.validation_locked and appointment.validation.3 %}
103
    <form method="post" class="inline-form">
104
      {% csrf_token %}
105
      <input type="hidden" value="{{appointment.validation.0.id}}" name="acte-id">
106
      <select data-previous="{{ last_status.state_name }}" name="act_state">
107
        {% for state_name, display_state_name in appointment.validation.3.items %}
108
        <option value="{{ state_name }}" {% if state_name == appointment.validation.1.state_name %}selected{% endif %}>{{ display_state_name }}</option>
109
        {% endfor %}
110
      </select>
111
      <button>Pointer</button>
112
    </form>
113
    {% endif %}
114

  
115
    {% if service in appointment.services_names %}
116
    <div class="tabs-ressource-{{ ressource_agenda.ressource.id }} textedit">
117
      <span></span>
118
      <textarea>{{ appointment.description }}</textarea>
119
      <button disabled="disabled" data-event-id="{{ appointment.event_id }}" data-date="{{ date|date:"Y-m-d" }}">✔</button>
120
    </div>
121
    {% else %}
122
    <p>{{ appointment.description }}</p>
123
    {% endif %}
109 124
  </div>
110 125
  {% endfor %}
111 126
</div>

Also available in: Unified diff