diff --git a/README.md b/README.md index 0e354a9d4..dd95e90d6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0b Gogs(Go Git Service) is a GitHub-like clone in the Go Programming Language, it currently supports Linux and Max OS X, but Windows has **NOT** supported yet due to installation problem with [libgit2](http://libgit2.github.com/) in Windows. -##### Current version: 0.0.7 Alpha +##### Current version: 0.0.8 Alpha ## Purpose diff --git a/models/action.go b/models/action.go index 8008d331c..6a77d7300 100644 --- a/models/action.go +++ b/models/action.go @@ -56,6 +56,7 @@ func NewRepoAction(user *User, repo *Repository) error { return err } +// GetFeeds returns action list of given user in given context. func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) { actions := make([]Action, 0, 20) sess := orm.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid) diff --git a/models/repo2.go b/models/repo2.go index ef0131d83..6aa6eda60 100644 --- a/models/repo2.go +++ b/models/repo2.go @@ -1,3 +1,7 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + package models import ( diff --git a/modules/auth/user.go b/modules/auth/user.go index 9c9ce686d..21336cdd9 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -63,7 +63,7 @@ func IsSignedIn(session sessions.Session) bool { type FeedsForm struct { UserId int64 `form:"userid" binding:"Required"` - Offset int64 `form:"offset"` + Page int64 `form:"p"` } type UpdateProfileForm struct { diff --git a/routers/user/user.go b/routers/user/user.go index 450f09b6d..c66904a24 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -5,6 +5,7 @@ package user import ( + "fmt" "net/http" "github.com/codegangsta/martini" @@ -27,6 +28,13 @@ func Dashboard(r render.Render, data base.TmplData, session sessions.Session) { return } data["MyRepos"] = repos + + feeds, err := models.GetFeeds(auth.SignedInId(session), 0, false) + if err != nil { + log.Handle(200, "user.Dashboard", data, r, err) + return + } + data["Feeds"] = feeds r.HTML(200, "user/dashboard", data) } @@ -172,10 +180,21 @@ func Delete(data base.TmplData, req *http.Request, session sessions.Session, r r r.HTML(200, "user/delete", data) } +const ( + feedTpl = ` +