diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-19 10:10:09 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2015-10-19 10:10:09 -0400 |
commit | 2d0b9529417ef2cf4d2d9cccbd88b065b0db77db (patch) | |
tree | 833171c6febaa732156a35c00d553ed074af5618 /web/web.go | |
parent | 814aa57fc1cebd1e430e36102d8b3c3830351cb8 (diff) | |
parent | 9fa3c996d522589139f56964087022bd0942e5e4 (diff) | |
download | chat-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.go | 10 |
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) } |