summaryrefslogtreecommitdiffstats
path: root/web/web.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2015-10-19 10:10:09 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2015-10-19 10:10:09 -0400
commit2d0b9529417ef2cf4d2d9cccbd88b065b0db77db (patch)
tree833171c6febaa732156a35c00d553ed074af5618 /web/web.go
parent814aa57fc1cebd1e430e36102d8b3c3830351cb8 (diff)
parent9fa3c996d522589139f56964087022bd0942e5e4 (diff)
downloadchat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.tar.gz
chat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.tar.bz2
chat-2d0b9529417ef2cf4d2d9cccbd88b065b0db77db.zip
Merge pull request #1101 from stasvovk/admin_console_urls
#962: change url when a user navigates between tabs in admin console
Diffstat (limited to 'web/web.go')
-rw-r--r--web/web.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/web.go b/web/web.go
index 00e00b3b9..f10c4f2a1 100644
--- a/web/web.go
+++ b/web/web.go
@@ -64,6 +64,9 @@ func InitWeb() {
mainrouter.Handle("/signup/{service:[A-Za-z]+}/complete", api.AppHandlerIndependent(signupCompleteOAuth)).Methods("GET")
mainrouter.Handle("/admin_console", api.UserRequired(adminConsole)).Methods("GET")
+ mainrouter.Handle("/admin_console/", api.UserRequired(adminConsole)).Methods("GET")
+ mainrouter.Handle("/admin_console/{tab:[A-Za-z0-9-_]+}", api.UserRequired(adminConsole)).Methods("GET")
+ mainrouter.Handle("/admin_console/{tab:[A-Za-z0-9-_]+}/{team:[A-Za-z0-9-]*}", api.UserRequired(adminConsole)).Methods("GET")
mainrouter.Handle("/hooks/{id:[A-Za-z0-9]+}", api.ApiAppHandler(incomingWebhook)).Methods("POST")
@@ -699,7 +702,14 @@ func adminConsole(c *api.Context, w http.ResponseWriter, r *http.Request) {
return
}
+ params := mux.Vars(r)
+ activeTab := params["tab"]
+ teamId := params["team"]
+
page := NewHtmlTemplatePage("admin_console", "Admin Console")
+
+ page.Props["ActiveTab"] = activeTab
+ page.Props["TeamId"] = teamId
page.Render(c, w)
}