diff options
Diffstat (limited to 'view/recipe.go')
-rw-r--r-- | view/recipe.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/view/recipe.go b/view/recipe.go index 3739143..b0525a1 100644 --- a/view/recipe.go +++ b/view/recipe.go @@ -22,7 +22,13 @@ func Recipe(w http.ResponseWriter, r *http.Request) { return } - err = html.ExecuteTemplate(w, "recipe", recipe) + tmpl := "recipe" + edit, ok := r.URL.Query()["edit"] + if ok && len(edit) == 1 && edit[0] == "true" { + tmpl = "recipe-edit" + } + + err = html.ExecuteTemplate(w, tmpl, recipe) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return |