Projet

Général

Profil

« Précédent | Suivant » 

Révision 9aa3425b

Ajouté par Serghei Mihai (congés, retour 15/05) il y a plus de 9 ans

agenda: arrivals and departures design improvings

Closes #5466

Voir les différences:

calebasse/agenda/appointments.py
38 38
        self.holiday = False
39 39
        self.services_names = []
40 40
        self.event = False
41
        self.timetable_type = None
41 42
        self.__set_time(begin_time)
42 43

  
43 44
    def __set_time(self, time):
......
125 126
        self.init_busy_time(title, length, begin_time, description)
126 127
        self.holiday = True
127 128

  
128
    def init_start_stop(self, title, time, type):
129
    def init_start_stop(self, title, time, type, kind):
129 130
        """
130 131
        title: Arrivee ou Depart
131 132
        """
132
        self.type = type
133
        self.type = kind
133 134
        self.title = title
134 135
        self.__set_time(time)
136
        self.timetable_type = type
135 137

  
136 138
def get_daily_appointments(date, worker, service, time_tables, events, holidays):
137 139
    """
......
191 193
            appointment.type = 'busy-elsewhere'
192 194
        appointment.other_services_names = [s.slug for s in services if s != service]
193 195
        appointments.append(appointment)
194
    print "time tables: %s" % time_tables
195 196
    for time_table in time_tables:
196 197
        interval_set = IntervalSet.between(time_table.to_interval(date).lower_bound.time(),
197 198
                                   time_table.to_interval(date).upper_bound.time())
......
207 208
        services = time_table.services.all()
208 209
        common_service = service in services
209 210
        services = [s.slug for s in services if s != service]
211
        appointment_kind = 'timetable '
210 212
        if common_service:
211
            appointment_type = 'info'
213
            appointment_kind += 'info'
212 214
        else:
213
            appointment_type = 'busy-elsewhere'
215
            appointment_kind += 'busy-elsewhere'
214 216
        appointment = Appointment()
215 217
        appointment.other_services_names = services
216
        appointment.init_start_stop(u"Arrivée", start_time, appointment_type)
218
        appointment.init_start_stop(u"Arrivée", start_time, 'arrival',
219
                                    appointment_kind)
217 220
        activity['arrival'] = start_time
218 221
        appointment.weight = 1
219 222
        appointments.append(appointment)
220 223
        appointment = Appointment()
221
        appointment.init_start_stop(u"Départ", end_time, appointment_type)
224
        appointment.init_start_stop(u"Départ", end_time, 'departure',
225
                                    appointment_kind)
222 226
        appointment.other_services_names = services
223 227
        activity['departure'] = end_time
224 228
        appointment.weight = -1
calebasse/agenda/templates/agenda/ajax-worker-tab.html
7 7
      {% if appointment.act_absence %}title="{{appointment.act_absence}}"{% endif %}>
8 8
    <span class="hour">{{ appointment.begin_hour }}</span>
9 9
    <span class="length">{% if appointment.length %}{% if appointment.length|str_length_lt:3 %}&nbsp;{% endif %}{{ appointment.length }} min{% endif %}</span>
10
    <span class="title">{% if appointment.title %}{{ appointment.title }}{% endif %}
11
    {% if appointment.patient.paper_id %} {{ appointment.patient.paper_id }} {% endif %}</span>
10
    <span class="title">
11
      {% if appointment.title %}
12
      {{ appointment.title }}
13
      {% if appointment.timetable_type and appointment.other_services_names %}
14
      {% if appointment.timetable_type == 'arrival' %}
15
      dans le{{appointment.other_services_names|pluralize}}
16
      {% else %}
17
      d{{appointment.other_services_names|pluralize:'u,es'}}
18
      {% endif %}
19
      service{{ appointment.other_services_names|pluralize }}
20
      {% for service_name in appointment.other_services_names %}
21
      {{ service_name }}{% if not forloop.last %},{% endif %}
22
      {% endfor %}
23
      {% endif %}
24

  
25
      {% endif %}
26
      {% if appointment.patient.paper_id %}
27
      {{ appointment.patient.paper_id }}
28
      {% endif %}
29
    </span>
12 30
    <span class="participants">
13 31
    {% if appointment.len_workers > 4 %}
14 32
        {% if appointment.workers_absent %}<span class="absent" title="Au moins un intervenant est absent">{% endif %}
......
38 56
        {% if appointment.workers_absent %}
39 57
        <span title="Au moins un intervenant est absent" class="icon-warning-sign absent"></span>
40 58
        {% endif %}
59
        {% if appointment.timetable_type %}
60
        <span class="icon-{{ appointment.timetable_type }}"></span>
61
        {% else %}
41 62
        {% for service_name in appointment.other_services_names %}
42 63
        <span class="box {{ service_name }}" title="{{ service_name }}"></span>
43 64
        {% endfor %}
65
        {% endif %}
44 66
        <span title="Un commentaire existe" class="icon-comment" {% if appointment.description %}style='display: inline'{% endif %}></span>
45 67
        {% if appointment.event_id %}
46 68
        {% if appointment.is_recurrent %} R {% endif %}
calebasse/static/css/agenda.css
266 266

  
267 267
.frame.acte:target, div.changed {
268 268
    box-shadow: 2px 2px .5em 5px #db9595;
269
}
270

  
271
#content div.agenda h3.timetable {
272
    font-size: .8em;
273
}
274

  
275
.icon-arrival:before {
276
    content: "\f090";
277
}
278

  
279
.icon-departure:before {
280
    content: "\f08b";
269 281
}

Formats disponibles : Unified diff