Project

General

Profile

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

calebasse / calebasse / personnes / templates / personnes / worker_update.html @ 53647eb3

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="actions">Actions</li>
128
          </ul>
129
        </li>
130
        {% for holiday in holidays %}
131
        <li id='{{ holiday.id }}'>
132
          <ul style="background: {% cycle '#fff' '#eee' %}">
133
            <li class="period">{{ holiday }}</li>
134
            <li class="status">
135
            {% if holiday.is_current and holiday.service %}
136
            congés annuels, en cours
137
            {% elif holiday.is_current %}
138
            en cours
139
            {% elif holiday.service %}
140
            congés annuels
141
            {% endif %}</li>
142
            <li class="type">
143
            {{ holiday.holiday_type }}
144
            </li>
145
            <li class="comment">
146
            {% if holiday.comment %}
147
            {{ holiday.comment }}
148
            {% endif %}
149
            </li>
150
            <li class="actions">
151
              <button class="icon-edit" data-action='edit' data-id='{{ holiday.id }}'></button>
152
              <button class="icon-remove" data-action='delete' data-id='{{ holiday.id }}'></button>
153
            </li>
154
          </ul>
155
        </li>
156
        {% endfor %}
157
      </ul>
158
      {% endif %}
159
    </div>
160
</div>
161
{% endblock %}
162

    
163
{% block dialogs %}
164
<div id="holiday-dlg" style="display: none;">
165
</div>
166
{% endblock %}
(12-12/13)