commit ee4ee3269ad3f870c02e25a6fe8eda6683d648f9
Author: Serghei MIHAI <smihai@entrouvert.com>
Date:   Tue Jul 1 11:08:30 2014 +0200

    agenda: resources title bars informations updated: workers names displayed, each element place in appropriate container
    
    old resources template removed
    
    Closes #4232

diff --git a/calebasse/agenda/templates/agenda/ajax-ressource-tab.html b/calebasse/agenda/templates/agenda/ajax-ressource-tab.html
index a6cdad0c..5f3f4d62 100644
--- a/calebasse/agenda/templates/agenda/ajax-ressource-tab.html
+++ b/calebasse/agenda/templates/agenda/ajax-ressource-tab.html
@@ -6,12 +6,25 @@
   <h3 class="{{ appointment.type }} {% if appointment.act_absence %}act-absence{% endif %} appointment"
       {% if appointment.act_absence %}title="{{appointment.act_absence}}"{% endif %} id="{{ appointment.event_id }}">
     <span class="hour">{{ appointment.begin_hour }}</span>
-    {% if appointment.event_type %} — {{ appointment.event_type }}  {% endif %}
-    {% if appointment.title %} — {{ appointment.title }}  {% endif %}
-    {% if appointment.length %} — {{ appointment.length }}m {% endif %}
-    {% if appointment.ressources_initial %} —{{ appointment.ressources_initial }} {% endif %}
-    {% if appointment.act_type %} — {{ appointment.act_type }} {% endif %}
-    {% if appointment.ressource %} — {{ appointment.ressource }} {% endif %}
+    {% if appointment.title %}<span class="title">{{ appointment.title }}</span>{% endif %}
+    {% if appointment.length %}<span class="length">{{ appointment.length }} mn</span> {% endif %}
+    {% if appointment.act_type %}<span class="act_type">{{ appointment.act_type }}</span>{% endif %}
+    <span class="participants">
+    {% if appointment.len_workers > 4 %}
+    {% if appointment.workers_absent %}<span class="absent" title="Au moins un intervenant est absent">{% endif %}
+        {{ appointment.len_workers }} inter.
+        {% if appointment.workers_absent %}</span>{% endif %}
+    {% else %}
+    {% if appointment.workers %}
+    {% for worker in appointment.workers %}
+    {% if worker in appointment.workers_absent %}<span class="absent" title="Absent">{% endif %}
+        {{ worker.worker.initials }}{% if not forloop.last %} {% endif %}
+        {% if worker in appointment.workers_absent %}</span>{% endif %}
+    {% endfor %}
+    {% endif %}
+    {% endif %}
+    </span>
+
     <span class="right">
       {% for service_name in appointment.other_services_names %}
       <span class="box {{ service_name }}" title="{{ service_name }}"></span>
diff --git a/calebasse/agenda/templates/agenda/ressources.html b/calebasse/agenda/templates/agenda/ressources.html
deleted file mode 100644
index 7b5771da..00000000
--- a/calebasse/agenda/templates/agenda/ressources.html
+++ /dev/null
@@ -1,168 +0,0 @@
-{% extends "agenda/base.html" %}
-{% load url from future %}
-{% load apptags %}
-
-{% block appbar %}
-    <h2>Agenda</h2>
-    <a href="../">Retourner à l'agenda</a>
-    <button class="newevent" data-hour="" data-url="{% url 'new-event' service=service date=date %}">Nouvel événement</button>
-    <button class="newrdv" data-hour="" data-url="{% url 'nouveau-rdv' service=service date=date %}">Nouveau rendez-vous patient</button>
-{% endblock %}
-
-{% block beforecontent %}
-    <div id="users">
-    <div id="filtre">
-     <input type="text"/>
-    </div>
-    <dl>
-     {% for ressources_type in ressources_types %}
-     <dt>{{ ressources_type.type }}</dt>
-     <dd><ul>
-       {% for ressource in ressources_type.ressources %}
-       <li id="selector-ressource-{{ressource.id}}" class="ressource-item" data-ressource-id="{{ressource.id}}" data-target=".ressource-{{ressource.id}}.agenda">{{ ressource.name }} <span class="toggle" title="cliquer pour déselectionner">(-)</span></li>
-       {% endfor %}
-     </ul></dd>
-     {% endfor %}
-   </dl>
- </div>
-{% endblock %}
-
-{% block agenda-content %}
-   <table>
-    <tbody>
-    <tr>
-     <td id="dispos">
-       <button id="close-all-ressource-agendas" style="display: none">Fermer tous les agendas</button>
-       Disponibilités
-       <table>
-         <tr class="initials"><td></td></tr>
-         {% for start_time in disponibility_start_times %}
-         <tr class="hour-mark">
-           <td rowspan="4">{{ start_time }}:00</td>
-         </tr>
-         <tr></tr>
-         <tr></tr>
-         <tr></tr>
-         {% endfor %}
-       </table>
-     </td>
-
-     <td id="agendas">
-       <div id="tabs">
-       <ul>
-        {% for ressource_agenda in ressources_agenda %}
-        <li style="display: none" class="ressource-{{ ressource_agenda.ressource.id }} agenda">
-        <a id="link-tab-ressource-{{ ressource_agenda.ressource.id }}"  href="#tabs-ressource-{{ ressource_agenda.ressource.id }}" class="tab" data-id="{{ ressource_agenda.ressource.id }}">{{ ressource_agenda.ressource.name }}</a>
-        <a href="#" style="padding: 3px;cursor: auto;" class="close-tab" data-target="selector-ressource-{{ ressource_agenda.ressource.id }}"><span class="ui-icon ui-icon-circle-close"></span></a>
-        </li>
-        {% endfor %}
-       </ul>
-       {% for ressource_agenda in ressources_agenda %}
-       <div id="tabs-ressource-{{ ressource_agenda.ressource.id }}" class="tabs agenda ressource-{{ ressource_agenda.ressource.id }}" style="display: none;">
-         <a class="print" href="#">Imprimer</a>
-         <div>
-           {% for appointment in ressource_agenda.appointments %}
-           <h3 class="{{ appointment.type }} {% if appointment.act_absence %}act-absence{% endif %} appointment"
-               {% if appointment.act_absence %}title="{{appointment.act_absence}}"{% endif %}>
-             <span class="hour">{{ appointment.begin_hour }}</span>
-             {% if appointment.event_type %} — {{ appointment.event_type }}  {% endif %}
-             {% if appointment.title %} — {{ appointment.title }}  {% endif %}
-             {% if appointment.length %} — {{ appointment.length }}m {% endif %}
-             {% if appointment.ressources_initial %} —{{ appointment.ressources_initial }} {% endif %}
-             {% if appointment.act_type %} — {{ appointment.act_type }} {% endif %}
-             {% if appointment.ressource %} — {{ appointment.ressource }} {% endif %}
-             <span class="right">
-                 {% for service_name in appointment.other_services_names %}
-                 <span class="box {{ service_name }}" title="{{ service_name }}"></span>
-                 {% endfor %}
-                 {% if appointment.description %}
-                 <span title="Un commentaire existe" class="icon-comment"></span>
-                 {% endif %}
-                 {% if appointment.event_id %}
-                 {% if appointment.is_recurrent %} R {% endif %}
-                  {% if appointment.patient_record_id %}
-                    <button title="Éditer un rendez-vous" class="edit-appointment icon-edit" data-event-id="{{ appointment.event_id }}"></button>
-                  {% else %}
-                    <button title="Éditer un événement" class="edit-event icon-edit" data-event-id="{{ appointment.event_id }}">
-                  {% endif %}
-                  <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>
-                 {% endif %}
-            </span>
-           </h3>
-
-           <div>
-               {% if appointment.type == 'free' %}
-               <button class='newrdv' data-url="{% url 'nouveau-rdv' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouveau rendez-vous patient</button>
-               <button class='newevent' data-url="{% url 'new-event' service=service date=date %}" data-hour="{{ appointment.begin_hour }}">Nouvel événement</button>
-               {% endif %}
-             {% if appointment.event_id %}
-             {% if appointment.workers %}
-               <p class="workers">
-               Intervenants :
-               {% for worker in appointment.workers %}
-                 {{ worker.first_name }} <span class="lastname">{{ worker.last_name }}</span>{% if forloop.last %}.{% else %}, {% endif %}
-               {% endfor %}
-               </p>
-             {% endif %}
-             <div class="tabs-ressource-{{ ressource_agenda.ressource.id }} textedit">
-                 <span></span>
-                 <textarea>{{ appointment.description }}</textarea>
-                 <button disabled="disabled" data-event-id="{{ appointment.event_id }}">✔</button>
-             </div>
-             {% endif %}
-             {% if appointment.patient_record_id %}
-             <p class="phones">
-             {% for address in appointment.patient.addresses.all %}
-               {% if address.place_of_life and address.phone %}
-                 <span title="{{ address.number }} {{ address.street }} {{ address.zip_code }} {{ address.city }}" class="icon-home-space">{{ address.phone }}</span>
-                 {% for contact in address.patientcontact_set.all  %}
-                   <span title="{{ contact.first_name }} {{ contact.last_name|upper }}" class="icon-user-space">{{ contact.mobile }}</span>
-                 {% endfor %}
-               {% endif %}
-             {% endfor %}
-             </p>
-             <a href="/{{ service }}/dossiers/{{ appointment.patient_record_id }}/view" target="_blank">Dossier patient</a> -
-             <a href="/{{ service }}/dossiers/{{ appointment.patient_record_id }}/view#tab=5" target="_blank">Prochains rendez-vous</a> -
-             <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>
-             {% endif %}
-             {% if appointment.validation %}
-               <div><span>{% if appointment.validation.1 %}<strong>{{ appointment.validation.2 }}</strong>, le {{ appointment.validation.1.created }} par {{ appointment.validation.1.author }}
-                   {% if appointment.validation.1.auto %}(par validation automatique){% endif %}. {% if appointment.validation.0.is_billed %}<strong>Acte facturé</strong>{% endif %}
-                 {% else %}
-                   Non pointé.
-                 {% endif %}
-                 </span>
-                 {% if not appointment.validation.0.validation_locked and appointment.validation.3 %}
-                   <form method="post" class="inline-form">
-                   {% csrf_token %}
-                   <input type="hidden" value="{{appointment.validation.0.id}}" name="acte-id">
-                   <select data-previous="{{ last_status.state_name }}" name="act_state">
-                     {% for state_name, display_state_name in appointment.validation.3.items %}
-                     <option value="{{ state_name }}" {% if state_name == appointment.validation.1.state_name %}selected{% endif %}>{{ display_state_name }}</option>
-                     {% endfor %}
-                   </select>
-                   <button>Modifier</button>
-                   </form>
-                 {% endif %}
-              </div>
-              {% endif %}
-           </div>
-           {% endfor %}
-         </div>
-       </div>
-       {% endfor %}
-
-       </div>
-
-       </div>
-     </td>
-    </tr>
-    </tbody>
-   </table>
-
-{% endblock %}
-
-{% block dialogs %}
-  <div id="rdv" style="display: none;"></div>
-  <div id="ajax-dlg" style="display: none;"></div>
-{% endblock %}
