ux: hide officeHourTable if it has no entries at all

This commit is contained in:
Johannes 2023-07-09 15:26:58 +02:00
parent 809f86de67
commit 0b1988f2a8

View file

@ -50,6 +50,9 @@ func (b *BaseHandler) GetTimetable(officeHours []models.OfficeHour) (timetable m
} }
func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.OfficeHour, slots []int, deleteIcons bool) template.HTML { func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.OfficeHour, slots []int, deleteIcons bool) template.HTML {
if len(timetable) == 0 { // no office hours to display
return template.HTML("<p class=\"text-center\">Aktuell sind keine passenden Sprechstunden eingetragen.</p>")
}
var tableBody string var tableBody string
for hour := 8; hour < 19; hour += 1 { for hour := 8; hour < 19; hour += 1 {
for minute := 0; minute < 60; minute += b.config.Date.MinuteGranularity { for minute := 0; minute < 60; minute += b.config.Date.MinuteGranularity {