refactor template rendering logic to one base template

This commit is contained in:
Johannes 2022-09-21 22:18:39 +02:00
parent 16e8cf9cd7
commit d60b715d96
18 changed files with 199 additions and 212 deletions

View file

@ -84,7 +84,7 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
MinuteGranularity int
DeleteIcons bool
}{OfficeHour: current, MinuteGranularity: b.config.Date.MinuteGranularity, DeleteIcons: deleteIcons}
Templates.ExecuteTemplate(&celldata, "td.html", data)
RawTemplates.ExecuteTemplate(&celldata, "td.html", data)
tableBody += celldata.String()
}
} else {
@ -116,6 +116,6 @@ func (b *BaseHandler) printTimetable(timetable map[models.Date]map[int]models.Of
slots[4],
template.HTML(tableBody),
}
Templates.ExecuteTemplate(&table, "officeHourTable.html", tableData)
RawTemplates.ExecuteTemplate(&table, "officeHourTable.html", tableData)
return template.HTML(table.String())
}