Skip to content

Commit

Permalink
finish basic dashboard page
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Jan 25, 2014
1 parent 7c60151 commit 5c0d016
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/handler/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import (
"github.com/fuxiaohei/GoBlog/app/utils"
"strconv"
"strings"
"fmt"
)

func Admin(context *GoInk.Context) {
uid, _ := strconv.Atoi(context.Cookie("token-user"))
user := model.GetUserById(uid)
context.Layout("admin")
context.Render("admin/home", map[string]interface{}{
"Title": "控制台",
"Statis": model.NewStatis(),
"User": user,
})
fmt.Println(model.NewStatis())
}

func AdminProfile(context *GoInk.Context) {
Expand Down
2 changes: 1 addition & 1 deletion view/admin/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="grid-1-5 left">
<div class="welcome">
<h4>Welcome</h4>
<p>欢迎回来, <strong>傅小黑</strong></p>
<p>欢迎回来, <strong>{{.User.Nick}}</strong></p>
</div>
<div class="quick-link">
<h4>快速链接</h4>
Expand Down

0 comments on commit 5c0d016

Please sign in to comment.