diff --git a/boardvoting.go b/boardvoting.go index 7228849..e58bee1 100644 --- a/boardvoting.go +++ b/boardvoting.go @@ -219,7 +219,9 @@ func motionListHandler(w http.ResponseWriter, r *http.Request) { templateContext.PrevPage = params.Page - 1 } - renderTemplate(w, r, []string{"motions.html", "motion_fragments.html", "header.html", "footer.html"}, templateContext) + renderTemplate(w, r, []string{ + "motions.html", "motion_fragments.html", "page_fragments.html", "header.html", "footer.html", + }, templateContext) } func motionHandler(w http.ResponseWriter, r *http.Request) { @@ -252,7 +254,7 @@ func motionHandler(w http.ResponseWriter, r *http.Request) { } templateContext.Decision = decision templateContext.PageTitle = fmt.Sprintf("Motion %s: %s", decision.Tag, decision.Title) - renderTemplate(w, r, []string{"motion.html", "motion_fragments.html", "header.html", "footer.html"}, templateContext) + renderTemplate(w, r, []string{"motion.html", "motion_fragments.html", "page_fragments.html", "header.html", "footer.html"}, templateContext) } func singleDecisionHandler(w http.ResponseWriter, r *http.Request, tag string, handler func(http.ResponseWriter, *http.Request)) { @@ -326,7 +328,7 @@ func (a *withDrawMotionAction) Handle(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusPreconditionFailed), http.StatusPreconditionFailed) return } - templates := []string{"withdraw_motion_form.html", "header.html", "footer.html", "motion_fragments.html"} + templates := []string{"withdraw_motion_form.html", "header.html", "footer.html", "motion_fragments.html", "page_fragments.html"} var templateContext struct { PageTitle string Decision *DecisionForDisplay @@ -366,7 +368,7 @@ func (h *newMotionHandler) Handle(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusPreconditionFailed), http.StatusPreconditionFailed) } - templates := []string{"create_motion_form.html", "header.html", "footer.html"} + templates := []string{"create_motion_form.html", "page_fragments.html", "header.html", "footer.html"} var templateContext struct { Form NewDecisionForm PageTitle string @@ -428,7 +430,7 @@ func (a editMotionAction) Handle(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusPreconditionFailed), http.StatusPreconditionFailed) return } - templates := []string{"edit_motion_form.html", "header.html", "footer.html"} + templates := []string{"edit_motion_form.html", "page_fragments.html", "header.html", "footer.html"} var templateContext struct { Form EditDecisionForm PageTitle string @@ -560,7 +562,7 @@ func (h *directVoteHandler) Handle(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/motions/", http.StatusMovedPermanently) default: - templates := []string{"direct_vote_form.html", "header.html", "footer.html", "motion_fragments.html"} + templates := []string{"direct_vote_form.html", "header.html", "footer.html", "motion_fragments.html", "page_fragments.html"} var templateContext struct { Decision *DecisionForDisplay VoteChoice VoteChoice @@ -601,7 +603,7 @@ func (h *proxyVoteHandler) Handle(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } - templates := []string{"proxy_vote_form.html", "header.html", "footer.html", "motion_fragments.html"} + templates := []string{"proxy_vote_form.html", "header.html", "footer.html", "motion_fragments.html", "page_fragments.html"} var templateContext struct { Form ProxyVoteForm Decision *DecisionForDisplay diff --git a/boardvoting/templates/create_motion_form.html b/boardvoting/templates/create_motion_form.html index ef72ec6..2d8db12 100644 --- a/boardvoting/templates/create_motion_form.html +++ b/boardvoting/templates/create_motion_form.html @@ -1,74 +1,66 @@ {{ template "header.html" . }} -