aboutsummaryrefslogtreecommitdiff
path: root/garage.go
diff options
context:
space:
mode:
Diffstat (limited to 'garage.go')
-rw-r--r--garage.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/garage.go b/garage.go
index b3ca836..236dcbd 100644
--- a/garage.go
+++ b/garage.go
@@ -194,9 +194,8 @@ func handleWebsiteList(w http.ResponseWriter, r *http.Request) {
return
}
- desc := ctrl.Describe()
- if len(desc.Websites) > 0 {
- http.Redirect(w, r, "/website/inspect/"+desc.Websites[0].Pretty, http.StatusFound)
+ if len(ctrl.PrettyList) > 0 {
+ http.Redirect(w, r, "/website/inspect/"+ctrl.PrettyList[0], http.StatusFound)
} else {
http.Redirect(w, r, "/website/new", http.StatusFound)
}
@@ -245,7 +244,7 @@ func handleWebsiteNew(w http.ResponseWriter, r *http.Request) {
}
type WebsiteInspectTpl struct {
- Ctrl *WebsiteController
+ Describe *WebsiteDescribe
View *WebsiteView
Err error
}
@@ -287,8 +286,14 @@ func handleWebsiteInspect(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
+
+ describe, err := ctrl.Describe()
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
- tpl := &WebsiteInspectTpl{ ctrl, view, processErr }
+ tpl := &WebsiteInspectTpl{ describe, view, processErr }
tWebsiteInspect := getTemplate("garage_website_inspect.html")
tWebsiteInspect.Execute(w, &tpl)