Project

General

Profile

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

calebasse / calebasse / personnes / templates / personnes / worker_update.html @ c125a508

1
{% extends "personnes/base.html" %}
2

    
3
{% block extrascripts %}
4
{{ block.super }}
5
    <script>
6
        $(function() {
7
            $('#lundi').click(function() {
8
                $('#lundi-dlg').dialog({title: 'Plages du lundi',
9
                    width: '950px',
10
                    buttons: [ { text: "Annuler",
11
                        click: function() { $(this).dialog("close"); } },
12
                    { text: "Valider",
13
                        click: function() { $(this).dialog("close"); } }]}
14
                );
15
            });
16

    
17
            $('button[data-action=delete]').click(function() {
18
                delete_holiday({{ object.id }}, $(this).data('id'));
19
            });
20

    
21
            $('button[data-action=edit]').click(function() {
22
                edit_holiday({{ object.id }}, $(this).data('id'));
23
            });
24

    
25
            $('button[data-action=new]').click(function() {
26
                add_holiday({{ object.id }});
27
            });
28

    
29
        });
30
</script>
31
{% endblock %}
32

    
33
{% block appbar %}
34
<h2>Personnel - <span class="lastname">{{ object.last_name }}</span> {{ object.first_name }}
35
  {% if holiday %}<span class="en-conge">(absent jusqu'au {{ holiday.end_date|date:"j F" }})</span>{% endif %}
36
</h2>
37
    <a href="..">Retourner à l'administration du personnel</a>
38
    <form action="delete/" method="post" data-confirmation-msg="Êtes-vous sûr de vouloir supprimer le personnel {{object.last_name}} {{object.first_name}} ?" class="form-with-confirmation">
39
      {% csrf_token %}
40
      <button>Supprimer</button>
41
    </form>
42
{% endblock %}
43

    
44
{% block content %}
45

    
46
{% if messages %}
47
<ul class="messages">
48
    {% for message in messages %}
49
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
50
    {% endfor %}
51
</ul>
52
<script type="text/javascript">
53
$('.messages').delay(1000*(1+{{ messages|length }})).fadeOut('slow');
54
</script>
55
{% endif %}
56

    
57
<div id="info-membre">
58
  <form method="post" class="ajax" id="id-form">
59
    {% csrf_token %}
60
    <div class="frame inline">
61
      <h3>État civil</h3>
62
      <button class="save enable-on-change"></button>
63
      <p>
64
      {% for field in forms.id %}
65
      {{ field.label_tag  }} : {{ field }}
66
      {% if field.name == 'gender' %}
67
      </p><p>
68
      {% endif %}
69
      {% endfor %}
70
      </p>
71
    </div>
72
  </form>
73

    
74
  <form method="post" class="ajax" id="services-form">
75
    {% csrf_token %}
76
    <div class="inline frame">
77
      <h3>Services</h3>
78
      <button class="save enable-on-change"></button>
79

    
80
      <p class="services">
81
      {{ forms.services.services }}
82
      </p>
83
    </div>
84
  </form>
85

    
86
  <div class="frame" id="schedule">
87
    <h3>Horaires de travail</h3>
88

    
89
    <table>
90
      <thead>
91
        <tr>
92
          {% for weekday, name in weekdays %}
93
            <td><a href="{{weekday}}/">{{ name|capfirst }}</a></td>
94
          {% endfor %}
95
        </tr>
96
      </thead>
97
      <tbody>
98
      <tr>
99
        {% for timetable in timetables %}
100
        <td>
101
          {% for schedule in timetable.schedules %}
102
            De {{ schedule.start_time }} à {{ schedule.end_time }}
103
            {% if not forloop.last %}
104
            <br/>
105
            {% endif %}
106
          {% empty %}
107
          -
108
          {% endfor %}
109
        </td>
110
        {% endfor %}
111
      </tr>
112
      </tbody>
113
    </table>
114
  </div>
115
    <div class="frame">
116
      <h3>Absences</h3>
117
      <!-- <button class="save icon-edit"></button> -->
118
      <button class="save icon-plus" data-action='new'></button>
119
      {% if holidays %}
120
      <ul id="holidays">
121
        <li>
122
          <ul class="caption">
123
            <li class="period">Période</li>
124
            <li class="status">Statut</li>
125
            <li class="type">Type</li>
126
            <li class="comment">Commentaire</li>
127
            <li class="groupe">Groupe</li>
128
            <li class="actions">Actions</li>
129
          </ul>
130
        </li>
131
        {% for holiday in holidays %}
132
        <li id='{{ holiday.id }}'>
133
          <ul style="background: {% cycle '#fff' '#eee' %}">
134
            <li class="period">{{ holiday }}</li>
135
            <li class="status">
136
            {% if holiday.is_current and holiday.service %}
137
            congés annuels, en cours
138
            {% elif holiday.is_current %}
139
            en cours
140
            {% elif holiday.service %}
141
            congés annuels
142
            {% endif %}</li>
143
            <li class="type">
144
            {{ holiday.holiday_type }}
145
            </li>
146
            <li class="comment">
147
            {% if holiday.comment %}
148
            {{ holiday.comment }}
149
            {% endif %}
150
            </li>
151
            <li class="groupe">
152
              {% if holiday.holiday_type.for_group %}
153
              <span class="icon-ok"></span>
154
              {% endif %}
155
            </li>
156
            <li class="actions">
157
              <button class="icon-edit" data-action='edit' data-id='{{ holiday.id }}'></button>
158
              <button class="icon-remove" data-action='delete' data-id='{{ holiday.id }}'></button>
159
            </li>
160
          </ul>
161
        </li>
162
        {% endfor %}
163
      </ul>
164
      {% endif %}
165
    </div>
166
</div>
167
{% endblock %}
168

    
169
{% block dialogs %}
170
<div id="holiday-dlg" style="display: none;">
171
</div>
172
{% endblock %}
(12-12/13)