1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
This commit is contained in:
Ferdinand Mütsch
2020-03-31 11:24:44 +02:00
parent 0664861f74
commit 0e61870568
9 changed files with 1544 additions and 7 deletions

View File

@ -44,7 +44,7 @@ func (m *SummaryHandler) loadTemplates() {
m.indexTemplate = indexTpl
}
func (h *SummaryHandler) Get(w http.ResponseWriter, r *http.Request) {
func (h *SummaryHandler) ApiGet(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
@ -91,7 +91,12 @@ func (h *SummaryHandler) Index(w http.ResponseWriter, r *http.Request) {
return
}
h.indexTemplate.Execute(w, summary)
vm := models.SummaryViewModel{
Summary: summary,
LanguageColors: utils.FilterLanguageColors(h.SummarySrvc.Config.LanguageColors, summary),
}
h.indexTemplate.Execute(w, vm)
}
func loadUserSummary(r *http.Request, summaryService *services.SummaryService) (*models.Summary, error, int) {