diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-13 13:14:43 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-03-13 13:14:43 +0800 |
commit | 37fae304d3d335d5e0320a2bd73f86d410b71b84 (patch) | |
tree | c2c3b8bd2f0a693ab328caf56ea41ed13d32c075 /routers/user | |
parent | f65d8f9144436d11cdce2614b3520271b31ae288 (diff) | |
download | gitea-37fae304d3d335d5e0320a2bd73f86d410b71b84.tar.gz gitea-37fae304d3d335d5e0320a2bd73f86d410b71b84.zip |
single repository page ui, add spec handler to get repo
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/user.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index 5017e878c6..ae9dd90290 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -5,6 +5,7 @@ package user import ( + "bytes" "net/http" "github.com/codegangsta/martini" @@ -140,7 +141,6 @@ func SignUp(form auth.RegisterForm, data base.TmplData, req *http.Request, r ren r.Redirect("/user/login") } -// TODO: unfinished func Delete(data base.TmplData, req *http.Request, session sessions.Session, r render.Render) { data["Title"] = "Delete Account" @@ -166,3 +166,21 @@ func Delete(data base.TmplData, req *http.Request, session sessions.Session, r r r.HTML(200, "user/delete", data) } + +func Feeds(form auth.FeedsForm, r render.Render) string { + actions, err := models.GetFeeds(form.UserId, form.Offset) + if err != nil { + return err.Error() + } + + length := len(actions) + buf := bytes.NewBuffer([]byte("[")) + for i, action := range actions { + buf.WriteString(action.Content) + if i < length-1 { + buf.WriteString(",") + } + } + buf.WriteString("]") + return buf.String() +} |