[UPDT] BASE: Empty HTML template for dashboard

This commit is contained in:
Horilla
2023-10-24 19:18:02 +05:30
parent 6a47cec8de
commit 5135e3790d
2 changed files with 24 additions and 10 deletions

View File

@@ -9,7 +9,21 @@ $(document).ready(function () {
dataSet = response.dataSet;
labels = response.labels;
createAttendanceChart(dataSet, labels);
if (isChartEmpty(response.dataSet)) {
$("#dailyAnalytic").parent().html(
`<div style="height: 220px; display:flex;align-items: center;justify-content: center;" class="">
<div style="" class="">
<img style="display: block;width: 70px;margin: 20px auto ;" src="/static/images/ui/joiningchart.png" class="" alt=""/>
<h3 style="font-size:16px" class="oh-404__subtitle">${response.message}</h3>
</div>
</div>`
);
} else {
$("#chart_input").html(
'<canvas id="dailyAnalytic" style = "cursor: pointer;"></canvas>'
);
createAttendanceChart(response.dataSet, response.labels);
}
},
});
});
@@ -132,14 +146,14 @@ function changeMonth() {
},
success: function (response) {
if (isChartEmpty(response.dataSet)) {
$("#chart_input").html(
`<div style="height: 310px; display:flex;align-items: center;justify-content: center;" class="">
<div style="" cladailyAnalyticss="">
<img style=" display: block;width: 70px;margin: 20px auto ;" src="/static/images/ui/attendance.png" class="" alt=""/>
<h3 style="font-size:16px" class="oh-404__subtitle">${response.message}</h3>
</div>
</div>`
);
$("#dailyAnalytic").parent().html(
`<div style="height: 220px; display:flex;align-items: center;justify-content: center;" class="">
<div style="" class="">
<img style="display: block;width: 70px;margin: 20px auto ;" src="/static/images/ui/joiningchart.png" class="" alt=""/>
<h3 style="font-size:16px" class="oh-404__subtitle">${response.message}</h3>
</div>
</div>`
);
} else {
$("#chart_input").html(
'<canvas id="dailyAnalytic" style = "cursor: pointer;"></canvas>'

View File

@@ -263,5 +263,5 @@ def dashboard_attendance(request):
departments = Department.objects.all()
for dept in departments:
data_set.append(generate_data_set(request, start_date, type, end_date, dept))
message = "No data exist"
message = _("No data Found...")
return JsonResponse({"dataSet": data_set, "labels": labels, "message": message})