summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-13 13:14:43 +0800
committerFuXiaoHei <fuxiaohei@hexiaz.com>2014-03-13 13:14:43 +0800
commit37fae304d3d335d5e0320a2bd73f86d410b71b84 (patch)
treec2c3b8bd2f0a693ab328caf56ea41ed13d32c075 /routers
parentf65d8f9144436d11cdce2614b3520271b31ae288 (diff)
downloadgitea-37fae304d3d335d5e0320a2bd73f86d410b71b84.tar.gz
gitea-37fae304d3d335d5e0320a2bd73f86d410b71b84.zip
single repository page ui, add spec handler to get repo
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/single.go8
-rw-r--r--routers/user/user.go20
2 files changed, 25 insertions, 3 deletions
diff --git a/routers/repo/single.go b/routers/repo/single.go
index 02fd34212a..db16a84b8a 100644
--- a/routers/repo/single.go
+++ b/routers/repo/single.go
@@ -2,10 +2,11 @@ package repo
import (
"github.com/codegangsta/martini"
+ "github.com/martini-contrib/render"
+
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/log"
- "github.com/martini-contrib/render"
)
func Single(params martini.Params, r render.Render, data base.TmplData) {
@@ -20,7 +21,10 @@ func Single(params martini.Params, r render.Render, data base.TmplData) {
r.HTML(200, "base/error", data)
return
}
- data["Files"] = files
+
data["IsRepoToolbarSource"] = true
+
+ data["Files"] = files
+
r.HTML(200, "repo/single", data)
}
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()
+}