Updated settings template and route to show basic user info

pull/24/head
Jordan 2014-01-30 15:15:12 -06:00
parent c59415a133
commit e9aa8d2c88
2 changed files with 9 additions and 7 deletions

View File

@ -84,7 +84,6 @@ func Base(w http.ResponseWriter, r *http.Request) {
Title string
Flashes []interface{}
}{Title: "Dashboard", User: ctx.Get(r, "user").(models.User)}
fmt.Println(params.User.Username)
getTemplate(w, "dashboard").ExecuteTemplate(w, "base", params)
}
@ -93,7 +92,11 @@ func Users(w http.ResponseWriter, r *http.Request) {
}
func Settings(w http.ResponseWriter, r *http.Request) {
getTemplate(w, "settings").ExecuteTemplate(w, "base", nil)
params := struct {
User models.User
Title string
}{Title: "Settings", User: ctx.Get(r, "user").(models.User)}
getTemplate(w, "settings").ExecuteTemplate(w, "base", params)
}
func Campaigns(w http.ResponseWriter, r *http.Request) {

View File

@ -1,4 +1,4 @@
{{define "content"}} {{template "nav"}}
{{define "content"}} {{template "nav" .User}}
<div class="jumbotron">
<div class="container" style="text-align:center;">
<h1 class="sans header">
@ -20,10 +20,9 @@
</ul>
</div>
<div class="col-md-9 sans">
<h1 style="margin-top:0px"><i class="fa fa-gear"></i> Gophish API</h1>
<p>Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality</p>
<h2 class="api_heading">/api/campaigns</h2>
<p>Test.</p>
<h1 style="margin-top:0px">User Settings</h1>
<p><b>Username:</b> {{.User.Username}}</p>
<p><b>Api Key:</b> {{.User.APIKey}}</p>
</div>
</div>
{{end}}