Abwesenheit OHNE Benachrichtigungen FERTIG
This commit is contained in:
parent
19447ce4f7
commit
bcc87e7811
|
|
@ -4,12 +4,20 @@
|
|||
{% load counter_tag %}
|
||||
{% if request.user.profile.agency.module_timemanagement %}
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script>
|
||||
<div class="content-section col-12">
|
||||
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}</h3>
|
||||
<hr>
|
||||
<h3>Abwesenheiten{% if request.user.profile.showtooltips %} <small><i data-toggle="tooltip" data-placement="top" title="Bearbeiten Sie hier Ihre Abwesenheiten." class="far fa-question-circle"></i></small>{% endif %}
|
||||
|
||||
<ul class="nav nav-tabs" id="absencetabs" role="tablist">
|
||||
</h3>
|
||||
<hr>
|
||||
{% if yearinfo != False %}
|
||||
<p>Verbrauchte Urlaubstage: {{yearinfo.days_inuse}} | Verfügbar: {{yearinfo.days}}</p>
|
||||
{% else %}
|
||||
<p>Keine Abwesenheitsinformationen vorhanden</p>
|
||||
{% endif %}
|
||||
<div >
|
||||
|
||||
<ul class="nav nav-tabs " id="absencetabs" role="tablist" >
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="team-tab" data-toggle="tab" href="#team" role="tab" aria-controls="team" aria-selected="false">Teamübersicht</a>
|
||||
</li>
|
||||
|
|
@ -31,8 +39,13 @@
|
|||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
<div class="chart-container" style="position: absolute; height:160px; width:160px; margin-bottom: -150px; right: -15px; top:54px">
|
||||
<canvas id="datainfo_restdays"></canvas>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="tab-content" id="absencetabsContent">
|
||||
|
||||
<div class="tab-pane fade" id="team" role="tabpanel" aria-labelledby="team-tab">
|
||||
|
|
@ -437,6 +450,27 @@ $('#absencetabs a').on('click', function (e) {
|
|||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var ctx = document.getElementById("datainfo_restdays");
|
||||
var myChart = new Chart(ctx, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ['Kontigent', 'Genutzt'],
|
||||
datasets: [{
|
||||
backgroundColor: ['#5a5c69','#ff304f'],
|
||||
data: [{{kontingent}}, {{inuse}}]
|
||||
}]
|
||||
},
|
||||
options : {
|
||||
legend: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{% else %}
|
||||
<h3>Das Modul Abwesenheits- und Zeiterfassung wurde in ihrer Agentur deaktiviert.</h3>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -153,6 +153,16 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
|
|||
if(tempTime.startdate == None):
|
||||
missinguserdata.append(user)
|
||||
|
||||
kontingent = 0
|
||||
inuse = 0
|
||||
yearinfo = False
|
||||
try:
|
||||
yearinfo = list(UserYearAbsenceInfo.objects.filter(year=activeyear, user=request.user))[0]
|
||||
inuse = int(yearinfo.days_inuse)
|
||||
kontingent = int(yearinfo.days)
|
||||
except:
|
||||
pass
|
||||
|
||||
context = {
|
||||
"active_link" : "abscence",
|
||||
"usersofagency" : User.objects.filter(profile__agency=request.user.profile.agency).order_by("-last_name"),
|
||||
|
|
@ -164,6 +174,9 @@ def AbsenceManagmenet(request, activemonth=False, activeyear=False):
|
|||
"prevyear" : prevyear,
|
||||
"activemonth" : activemonth,
|
||||
"activeyear" : activeyear,
|
||||
"inuse" : inuse,
|
||||
"yearinfo" : yearinfo,
|
||||
"kontingent" : kontingent,
|
||||
"abscenceform" : AddAbsence(instance=request.user),
|
||||
"userown" : Absence.objects.filter(agency=request.user.profile.agency, user=request.user).order_by("-start")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue