Project

General

Profile

« Previous | Next » 

Revision 53647eb3

Added by Serghei Mihai over 10 years ago

absences management refactored

View differences:

calebasse/personnes/templates/personnes/worker_update.html
13 13
                        click: function() { $(this).dialog("close"); } }]}
14 14
                );
15 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

  
16 29
        });
17 30
</script>
18 31
{% endblock %}
......
99 112
      </tbody>
100 113
    </table>
101 114
  </div>
102
  <form action="holidays/" method="get">
103 115
    <div class="frame">
104 116
      <h3>Absences</h3>
105
      <button class="save icon-edit"></button>
106
      <ul>
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>
107 130
        {% for holiday in holidays %}
108
        <li>{{ holiday|capfirst }}
131
        <li id='{{ holiday.id }}'>
132
          <ul style="background: {% cycle '#fff' '#eee' %}">
133
            <li class="period">{{ holiday }}</li>
134
            <li class="status">
109 135
            {% if holiday.is_current and holiday.service %}
110
            (congés annuels, en cours)
136
            congés annuels, en cours
111 137
            {% elif holiday.is_current %}
112
            (en cours)
138
            en cours
113 139
            {% elif holiday.service %}
114
            (congés annuels)
115
            {% endif %}
116
            ({{ holiday.holiday_type }})
140
            congés annuels
141
            {% endif %}</li>
142
            <li class="type">
143
            {{ holiday.holiday_type }}
144
            </li>
145
            <li class="comment">
117 146
            {% if holiday.comment %}
118
            « {{ holiday.comment }} »
147
            {{ holiday.comment }}
119 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>
120 155
        </li>
121 156
        {% endfor %}
122 157
      </ul>
158
      {% endif %}
123 159
    </div>
124
  </form>
125 160
</div>
126 161
{% endblock %}
127 162

  
128 163
{% block dialogs %}
129
<div id="lundi-dlg" style="display: none;">
130
  <table>
131
    <tr>
132
      <th>Heure début</th> <th>Heure fin</th> <th>Date début</th> <th>Date fin</th> <th>Périodicité</th> <th>Services</th>
133
    </tr>
134
    <tr>
135
      <td><input value="13h30" size="8"/></td> <td><input value="17h30" size="8"/></td> <td><input value="20/04/2012" size="12"/></td> <td><input value="-" size="12"/></td> <td><select><option>Toutes les semaines</option></select></td> <td><select><option>CAMSP</option><option>CMPP</option><option>...</option><option>+</option></select></td> <td><button>-</button></td>
136
    </tr>
137
    <tr class="expired"> <td>13h30</td> <td>15h30</td> <td>2/01/2012</td> <td>14/04/2012</td> <td>2× par mois</td> <td>CAMSP</td> <td><button>déver.</button> </tr>
138
  </table>
139
  <button>+</button>
164
<div id="holiday-dlg" style="display: none;">
140 165
</div>
141 166
{% endblock %}

Also available in: Unified diff