ninebadge/src/ninebadge-1.0/templates/Tallyday/list.html.twig

93 lines
4.5 KiB
Twig

{% extends "base.html.twig" %}
{% block localstyle %}
{% endblock %}
{% block body %}
<h1 class="page-header">
GERER MES POINTAGES
</h1>
<a class="btn btn-secondary" href={{ path('app_tallyday') }}>Retour</a>
<a class="btn btn-secondary float-right" href={{ path('app_tallyday_userlist',{week:weeknext|date("Y-m-d")}) }}>Semaine Suivante</a>
<a class="btn btn-secondary float-right mr-2" href={{ path('app_tallyday_userlist',{week:weekprev|date("Y-m-d")}) }}>Semaine Précedente</a>
{% if message is defined and not message is empty %}
<div class='alert alert-danger' style='margin: 5px 0px'>
<strong>Erreur</strong><br>
{{ message|raw }}<br>
</div>
{% endif %}
<center class="mt-3">
{% set trans_day_hash = {
"Monday": "Lundi",
"Tuesday": "Mardi",
"Wednesday": "Mercredi",
"Thursday": "Jeudi",
"Friday": "Vendredi",
"Saturday": "Samedi",
"Sunday": "Dimanche"
}
%}
<table class="table table-striped table-bordered table-hover" id="dataTables" >
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th class="no-sort">Date</th>
<th class="no-sort" width="70px">AM début</th>
<th class="no-sort" width="70px">AM fin</th>
<th class="no-sort" width="70px">PM début</th>
<th class="no-sort" width="70px">PM fin</th>
<th class="no-sort" width="70px">Durée</th>
</tr>
</thead>
<tbody>
{%for date in dates %}
<tr>
<td>
{% if date["tallyday"] is empty or (not date["tallyday"].validateuser and not date["tallyday"].validatemaster) %}
{% if not firstvalidate or firstvalidate.dateof < date["date"] %}
<a href="{{ path('app_tallyday_userupdate',{date:date["date"]|date("Y-m-d"),from:"list",week:week|date("Y-m-d")}) }}"><i class="fa fa-file"></i></a>
<a href="{{path("app_tallyday_uservalidate",{date:date["date"]|date("Y-m-d"),from:"list",week:week|date("Y-m-d")})}}"><i class="fas fa-check"></i></a>
{% endif %}
{% elseif not date["tallyday"].validatemaster %}
<a href="{{ path('app_tallyday_userdevalidate',{date:date["date"]|date("Y-m-d"),from:"list",week:week|date("Y-m-d")}) }}"><i class="fas fa-lock"></i></i></a>
{% endif %}
</td>
<td>{{ trans_day_hash[date["date"]|date('l')] }} {{date["date"]|date("d/m/Y")}}</td>
{% if date["tallyday"] is empty %}
<td></td>
<td></td>
<td></td>
<td></td>
<td class="text-center">00:00</td>
{% else %}
<td class="text-center">{% if date["tallyday"].datestartam is not null %}{{date["tallyday"].datestartam|date("H:i")}}{%endif%}</td>
<td class="text-center">{% if date["tallyday"].dateendam is not null %}{{date["tallyday"].dateendam|date("H:i")}}{%endif%}</td>
<td class="text-center">{% if date["tallyday"].datestartpm is not null %}{{date["tallyday"].datestartpm|date("H:i")}}{%endif%}</td>
<td class="text-center">{% if date["tallyday"].dateendpm is not null %}{{date["tallyday"].dateendpm|date("H:i")}}{%endif%}</td>
<td class="text-center">{{ date["tallyday"].timedayformatted }}</td>
{% endif %}
</tr>
{%endfor%}
</table>
</table>
<div class="float-right" style="font-size:35px">TOTAL SEMAINE = {{ timeweek }}</div>
</center>
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$('#dataTables').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 100,
paging: false,
ordering: false,
info: false,
searching: false,
});
});
{% endblock %}