new watchers, stars and forks UI

This commit is contained in:
Unknwon committed 2015-11-16 23:28:46 -05:00
1 parent e06558e208
commit 9ab96172fc
12 files changed
+216 -256

No files matched your search

+3 -1
View File
@@ -350,6 +350,9 @@ auto_init = Initialize this repository with selected files and template
create_repo = Create Repository
default_branch = Default Branch
mirror_interval = Mirror Interval (hour)
watchers = Watchers
stargazers = Stargazers
forks = Forks
form.name_reserved = Repository name '%s' is reserved.
form.name_pattern_not_allowed = Repository name pattern '%s' is not allowed.
@@ -382,7 +385,6 @@ create_new_repo_command = Create a new repository on the command line
push_exist_repo = Push an existing repository from the command line
repo_is_empty = This repository is empty, please come back later!
branch = Branch
tree = Tree
filter_branch_and_tag = Filter branch or tag
+14 -21
View File
@@ -49,7 +49,7 @@ var (
Gitignores, Licenses, Readmes []string
// Maximum items per page in forks, watchers and stars of a repo
ItemsPerPage = 54
ItemsPerPage = 40
)
func LoadRepoConfig() {
@@ -1696,25 +1696,21 @@ func WatchRepo(uid, repoId int64, watch bool) (err error) {
return watchRepo(x, uid, repoId, watch)
}
func getWatchers(e Engine, rid int64) ([]*Watch, error) {
func getWatchers(e Engine, repoID int64) ([]*Watch, error) {
watches := make([]*Watch, 0, 10)
err := e.Find(&watches, &Watch{RepoID: rid})
return watches, err
return watches, e.Find(&watches, &Watch{RepoID: repoID})
}
// GetWatchers returns all watchers of given repository.
func GetWatchers(rid int64) ([]*Watch, error) {
return getWatchers(x, rid)
func GetWatchers(repoID int64) ([]*Watch, error) {
return getWatchers(x, repoID)
}
// Repository.GetWatchers returns all users watching given repository.
func (repo *Repository) GetWatchers(offset int) ([]*User, error) {
users := make([]*User, 0, 10)
offset = (offset - 1) * ItemsPerPage
err := x.Limit(ItemsPerPage, offset).Where("repo_id=?", repo.ID).Join("LEFT", "watch", "user.id=watch.user_id").Find(&users)
return users, err
// Repository.GetWatchers returns range of users watching given repository.
func (repo *Repository) GetWatchers(page int) ([]*User, error) {
users := make([]*User, 0, ItemsPerPage)
return users, x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).
Where("repo_id=?", repo.ID).Join("LEFT", "watch", "user.id=watch.user_id").Find(&users)
}
func notifyWatchers(e Engine, act *Action) error {
@@ -1794,13 +1790,10 @@ func IsStaring(uid, repoId int64) bool {
return has
}
func (repo *Repository) GetStars(offset int) ([]*User, error) {
users := make([]*User, 0, 10)
offset = (offset - 1) * ItemsPerPage
err := x.Limit(ItemsPerPage, offset).Where("repo_id=?", repo.ID).Join("LEFT", "star", "user.id=star.uid").Find(&users)
return users, err
func (repo *Repository) GetStargazers(page int) ([]*User, error) {
users := make([]*User, 0, ItemsPerPage)
return users, x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).
Where("repo_id=?", repo.ID).Join("LEFT", "star", "user.id=star.uid").Find(&users)
}
// ___________ __
+2 -2
View File
@@ -4364,7 +4364,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil
}
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xeb\x72\xdc\x48\xae\xe6\x7f\x3e\x05\xdb\x27\x1c\xb6\x23\xe4\x72\x74\xf7\xde\xa2\xa3\xed\x5e\x59\x6a\x5f\xe6\x58\x96\xc6\x52\xcf\x6c\xaf\xc3\xc1\x66\x15\x59\x55\x1c\x57\x91\xd5\x24\xcb\xb2\xe6\xc4\x89\xd8\x07\xd8\x07\xd8\x7d\xbd\xf3\x24\x0b\x7c\x00\xf2\x42\xb2\x24\xbb\x67\x62\xfd\xc3\x62\x65\x22\x6f\x48\x24\x12\x89\x04\x90\xf9\x6e\x97\x15\x65\xb7\x48\x9f\xa6\xc7\xe9\x2e\xaf\xea\x4d\xd9\x75\x69\x57\x6e\x96\x8f\xd7\x4d\xd7\x97\x45\xfa\xb2\xea\xe9\x77\xfb\xa9\x5a\x94\x49\xb2\x6e\xb6\x25\x81\xbe\xa2\x3f\x49\x91\x77\xeb\x79\x93\xb7\x05\x25\x9c\xda\x77\x52\x7e\xde\x6d\x9a\x96\x81\x7e\x96\xaf\x64\x5d\x6e\x76\x5c\x86\xfe\x24\x5d\xb5\xaa\xb3\xaa\xa6\x9f\x97\xf4\x95\xbe\xae\x25\xa5\xd9\xf7\x96\x74\xbe\xef\x25\x6d\xbf\xb3\xa4\x5f\x76\x49\x5b\xae\x2a\xea\x4d\x4b\x49\xef\xf4\x33\xb9\x2e\xe7\x5d\xd5\x73\x4b\x7f\x95\xaf\xe4\x53\xd9\x76\x55\xc3\xb5\xff\x45\xbe\x92\x5d\xbe\x62\x80\x0b\xfa\x93\xf4\xe5\x76\xb7\xc9\x51\xe0\x4a\x3f\x93\x4d\x5e\xaf\xf6\x02\xf3\x46\x3f\x93\x45\x5b\x52\x56\x56\x97\xd7\x94\x7a\x82\x1f\xb3\xd9\x2c\xd9\x13\x12\xb2\x5d\xdb\x2c\xab\x4d\x99\xe5\x75\x91\x6d\x65\x98\xbf\x50\x7a\xaa\xe9\x29\xa5\xa7\x9c\x8e\x21\x94\x05\x0d\x35\xcb\x3b\x1d\x07\xe1\x92\x46\x9e\x77\x09\xaa\xaa\xf3\xad\x95\xe6\xcf\xa4\xdc\xe6\xd5\x86\xb1\xf6\x98\x3f\xa8\xe3\x5d\x77\xdd\x00\xb7\x17\xfa\x49\x48\xc8\xfa\x9b\x5d\x09\x1c\x3c\xbe\xa2\xaf\x64\x91\xef\xfa\xc5\x3a\xe7\x7e\xca\x57\x42\x40\xbb\x86\x90\xd1\xb4\x37\x80\xb3\x1f\x49\xd3\xae\xf2\xba\xfa\x7b\xde\x0b\x82\xce\x83\x9f\xc9\xb6\x6a\xdb\x86\x71\x7b\x86\x8f\x84\x86\x9e\x71\x3d\x94\xf2\x96\xb0\x10\xd4\xc2\x39\xdb\x6a\xd5\x0a\x1a\x39\xf3\x0c\xbf\xb8\x16\xce\x5b\x36\xed\x47\xcd\x78\xc1\x9f\x83\xa2\xd4\x09\xcd\x8d\xdb\xcf\x6b\x42\xbc\xe6\x9e\xe1\x47\x04\xd0\x25\x79\xb1\x25\x54\xee\xf2\xba\x64\x1c\x1d\xf3\x2f\xc2\x0b\xfd\x4a\xf2\xc5\xa2\xd9\xd7\x7d\xd6\x95\x7d\x5f\xd5\x2b\x46\xf6\xb1\x24\xa5\x97\x9a\x94\x04\x79\x2e\xed\xa6\xd9\xbb\xe9\xa4\xf4\x5f\xe9\x67\x7a\x21\x3f\x25\x2f\x28\x84\x4c\x57\x92\x47\xd2\x65\xcb\xb2\x2c\x64\x2c\x5d\xfa\x82\xbe\x93\xdd\x7e\xb3\x21\xac\xfd\xbe\x2f\xbb\x9e\x0b\x5d\xd0\x6f\x1a\xbf\xfc\x4e\xaa\xae\xa3\x0f\x4a\x7e\x8d\x8f\x84\xa6\xae\x5e\x60\x30\x27\xf8\x48\x92\xf7\x5d\x99\xb7\x8b\xf5\x87\x44\xfe\xa2\xaf\xfc\xc1\xb4\x77\x68\x52\x99\x90\x94\x88\xa4\x05\x6b\x20\x59\x34\x05\xff\x38\xa1\x3f\x54\x75\x55\x77\x7d\xbe\xd9\x7c\x48\xf4\x83\xc1\xe4\x4b\x26\xa0\xaf\x7a\x60\x41\x13\xd3\xcb\xbe\xdc\x75\x3c\x83\xe9\x8b\xaa\xed\xfa\xc7\x7d\x45\xc4\xfa\x6e\x5f\x27\x45\xb3\xf8\x48\xcb\x80\x97\x34\x5a\x7e\xbd\x4c\x09\x59\x0f\x68\x21\xb4\xfb\xba\x26\xf4\xa4\x2f\x1b\x42\x19\x35\x53\x51\xfb\xa7\x80\x3e\x4a\x77\x9b\x32\xef\x08\xa4\xcc\x8b\xf4\xc7\x3c\xed\xf3\x76\x55\xf6\x4f\xef\x65\x73\x5a\x7e\x1f\xef\xa5\xeb\xb6\x5c\x3e\xbd\x77\xbf\xbb\xf7\xec\xe5\x9e\x8a\x6d\xaa\xba\xec\x7e\x7c\x92\x3f\x4b\x17\x39\xe5\x10\x1a\x6f\xd2\x79\xb9\xe4\xd5\x46\x6d\xa5\x44\xe5\xf5\x8a\x57\xda\x4d\xbf\xe6\x06\x89\x12\xe8\xa3\x4b\x79\xa9\x7f\x93\xf0\x04\x10\x2b\xc8\x8a\xb9\xb1\x35\x74\x08\xc9\x2d\x4d\xc0\xd9\xcd\xe5\x9f\xdf\x1c\xa5\x17\xc4\xdb\x56\x6d\x89\x6f\xfa\x8f\x4a\x7c\x9f\xd2\x68\xaf\xaa\xd3\xe7\xb3\x84\xca\x1a\x42\x4e\xf3\x3e\x9f\x73\xdf\xdd\xec\x73\xa6\x2c\x42\x97\x87\xa5\xc8\xdc\x12\x9c\xb1\xeb\xa3\x69\x99\x5a\xc8\x54\x87\x2e\x7f\x57\xc7\x5b\xe6\x01\x94\xee\x30\x7b\x21\x38\xa3\xaa\xd2\xd7\x6f\xdf\x9e\x9f\x3e\x4f\xcb\x7a\x45\x98\x49\xaf\xab\x7e\x9d\xee\xfb\xe5\x7f\xcb\x56\x65\x5d\xb6\xf9\x26\x5b\x54\x8c\x94\x96\x08\x36\x25\x2c\xc9\x10\x67\x49\xd7\x6d\x88\x45\x81\x0a\x2e\x2f\xdf\xa4\x67\x4c\x09\xbb\xbc\x5f\xa3\x23\xfd\x3a\xe9\x7e\xdf\x30\xa2\x5c\x83\x57\xeb\x32\xc5\x62\x00\x50\xb3\x1c\xe2\x25\x2d\xb4\xaf\xb3\xa4\x6c\xdb\x8c\x38\x68\x7f\xc3\x68\xd6\x3a\x0f\x41\x4b\x75\x44\xed\x75\xd3\xd3\x34\xa6\x28\x27\x55\x54\xf5\xa7\x7c\x53\x15\x84\x6c\x8f\x90\xb8\x2c\x12\x8b\x86\xe6\x8d\x4b\x13\x65\x36\xd7\x18\x6a\xbe\xa0\x0d\xa0\x4b\xef\xcd\xee\x81\xe3\xde\x7b\x7c\x6f\x96\xd4\x4d\x26\x5c\x82\x79\x73\x51\x75\xf9\x9c\xf8\xb4\xec\x1b\xad\x71\xbd\x5f\x99\x7e\xa4\x2b\x0a\x91\x46\x10\x8c\x5b\xde\x8b\xb0\x05\x30\x71\xe5\xc4\xb0\xc1\x6c\x94\xcd\x84\x63\x37\x9e\xe4\xe6\x57\xd8\x92\x4b\x18\x8d\x39\xb1\x09\x33\xea\x3a\xde\xed\x36\xd5\x42\x9a\x7e\x29\x79\x9e\xd0\x78\x67\x56\xa4\x84\x70\x20\x14\xcb\x0b\xc8\x85\x7a\xcd\x6c\x2b\x8d\xf8\x3c\xca\xaf\x4b\x5a\x39\xeb\xfd\x4a\x76\xa7\x4d\xb3\x2f\xbe\x01\x43\xb1\x99\xf3\xfc\x24\x7d\xd7\x50\x87\x41\x1d\x0e\xc0\x37\x71\x4c\x8c\x81\x85\x81\xb6\xdc\x36\x3d\x23\x4e\x8b\x55\x34\x3d\xd7\x15\x65\xd2\x48\xbb\xfc\x13\xb1\xc5\xbe\x91\x25\x59\xd0\x92\x5b\x70\xc5\xc4\xc1\xf6\xb4\xa3\xcb\xb2\x20\x3e\x22\x4b\xc3\xd2\x62\x1a\x04\xd4\x76\x4f\xab\x69\x4d\x95\x31\xe2\x59\x22\xa1\x2a\xa7\xfa\x89\x21\x51\x3d\x58\xe5\xb4\x72\x1b\xda\x3c\x79\xa2\x4f\xf1\xa1\xbf\xc3\xfa\xa9\x57\xf9\x72\x49\xbd\xea\x68\x55\xbc\x4a\x17\x9b\x86\x96\xd4\x2f\xef\xde\x74\xbc\x60\xd6\xd9\xae\x69\x21\x89\x50\xd6\x05\x7d\xba\xb4\x00\xd1\x0c\x51\xef\xb7\x73\xfa\x75\xbd\xae\x88\x51\x03\xed\x5c\x82\xa5\x24\x4a\xa5\x26\xf6\x1d\x4d\xe1\x51\x4a\x4b\x98\x4Line truncated
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xbc\x7d\xeb\x72\xdc\x48\xae\xe6\x7f\x3e\x05\xdb\x27\x1c\xb6\x23\xe4\x72\x74\xf7\xde\xa2\xa3\xed\x5e\x59\x6a\x5f\xe6\x58\x96\xc6\x52\xcf\xec\xac\xc3\xc1\x66\x15\xa9\x2a\x8e\xab\xc8\x6a\x92\xe5\xb2\xfa\xc4\x89\xd8\x07\xd8\x07\xd8\x7d\xbd\xf3\x24\x0b\x7c\x00\xf2\x42\xb2\x24\xbb\x67\x62\xfd\xc3\x62\x65\x22\x6f\x48\x24\x12\x89\x04\x90\xf9\x76\x9b\x15\x65\xb7\x48\x9f\xa6\xc7\xe9\x36\xaf\xea\x75\xd9\x75\x69\x57\xae\xaf\x1f\xaf\x9a\xae\x2f\x8b\xf4\x65\xd5\xd3\xef\xf6\x53\xb5\x28\x93\x64\xd5\x6c\x4a\x02\x7d\x45\x7f\x92\x22\xef\x56\xf3\x26\x6f\x0b\x4a\x38\xb5\xef\xa4\xfc\xbc\x5d\x37\x2d\x03\xfd\x2c\x5f\xc9\xaa\x5c\x6f\xb9\x0c\xfd\x49\xba\x6a\x59\x67\x55\x4d\x3f\x2f\xe9\x2b\x7d\x5d\x4b\x4a\xb3\xeb\x2d\xe9\x7c\xd7\x4b\xda\x6e\x6b\x49\xbf\x6c\x93\xb6\x5c\x56\xd4\x9b\x96\x92\xde\xe9\x67\xb2\x2f\xe7\x5d\xd5\x73\x4b\x7f\x95\xaf\xe4\x53\xd9\x76\x55\xc3\xb5\xff\x45\xbe\x92\x6d\xbe\x64\x80\x0b\xfa\x93\xf4\xe5\x66\xbb\xce\x51\xe0\x4a\x3f\x93\x75\x5e\x2f\x77\x02\xf3\x46\x3f\x93\x45\x5b\x52\x56\x56\x97\x7b\x4a\x3d\xc1\x8f\xd9\x6c\x96\xec\x08\x09\xd9\xb6\x6d\xae\xab\x75\x99\xe5\x75\x91\x6d\x64\x98\xbf\x50\x7a\xaa\xe9\x29\xa5\xa7\x9c\x8e\x21\x94\x05\x0d\x35\xcb\x3b\x1d\x07\xe1\x92\x46\x9e\x77\x09\xaa\xaa\xf3\x8d\x95\xe6\xcf\xa4\xdc\xe4\xd5\x9a\xb1\xf6\x98\x3f\xa8\xe3\x5d\xb7\x6f\x80\xdb\x0b\xfd\x24\x24\x64\xfd\xcd\xb6\x04\x0e\x1e\x5f\xd1\x57\xb2\xc8\xb7\xfd\x62\x95\x73\x3f\xe5\x2b\x21\xa0\x6d\x43\xc8\x68\xda\x1b\xc0\xd9\x8f\xa4\x69\x97\x79\x5d\xfd\x9e\xf7\x82\xa0\xf3\xe0\x67\xb2\xa9\xda\xb6\x61\xdc\x9e\xe1\x23\xa1\xa1\x67\x5c\x0f\xa5\xbc\x25\x2c\x04\xb5\x70\xce\xa6\x5a\xb6\x82\x46\xce\x3c\xc3\x2f\xae\x85\xf3\xae\x9b\xf6\xa3\x66\xbc\xe0\xcf\x41\x51\xea\x84\xe6\xc6\xed\xe7\x35\x21\x5e\x73\xcf\xf0\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x17\xe1\x85\x7e\x25\xf9\x62\xd1\xec\xea\x3e\xeb\xca\xbe\xaf\xea\x25\x23\xfb\x58\x92\xd2\x4b\x4d\x4a\x82\x3c\x97\x76\xd3\xec\xdc\x74\x52\xfa\xdf\xe8\x67\x7a\x21\x3f\x25\x2f\x28\x84\x4c\x57\x92\x47\xd2\x65\xd7\x65\x59\xc8\x58\xba\xf4\x05\x7d\x27\xdb\xdd\x7a\x4d\x58\xfb\x6d\x57\x76\x3d\x17\xba\xa0\xdf\x34\x7e\xf9\x9d\x54\x5d\x47\x1f\x94\xfc\x1a\x1f\x09\x4d\x5d\xbd\xc0\x60\x4e\xf0\x91\x24\xef\xbb\x32\x6f\x17\xab\x0f\x89\xfc\x45\x5f\xf9\x83\x69\xef\xd0\xa4\x32\x21\x29\x11\x49\x0b\xd6\x40\xb2\x68\x0a\xfe\x71\x42\x7f\xa8\xea\xaa\xee\xfa\x7c\xbd\xfe\x90\xe8\x07\x83\xc9\x97\x4c\x40\x5f\xf5\xc0\x82\x26\xa6\x97\x7d\xb9\xed\x78\x06\xd3\x17\x55\xdb\xf5\x8f\xfb\x8a\x88\xf5\xdd\xae\x4e\x8a\x66\xf1\x91\x96\x01\x2f\x69\xb4\xfc\xfa\x3a\x25\x64\x3d\xa0\x85\xd0\xee\xea\x9a\xd0\x93\xbe\x6c\x08\x65\xd4\x4c\x45\xed\x9f\x02\xfa\x28\xdd\xae\xcb\xbc\x23\x90\x32\x2f\xd2\x1f\xf3\xb4\xcf\xdb\x65\xd9\x3f\xbd\x97\xcd\x69\xf9\x7d\xbc\x97\xae\xda\xf2\xfa\xe9\xbd\xfb\xdd\xbd\x67\x2f\x77\x54\x6c\x5d\xd5\x65\xf7\xe3\x93\xfc\x59\xba\xc8\x29\x87\xd0\x78\x93\xce\xcb\x6b\x5e\x6d\xd4\x56\x4a\x54\x5e\x2f\x79\xa5\xdd\xf4\x2b\x6e\x90\x28\x81\x3e\xba\x94\x97\xfa\x37\x09\x4f\x00\xb1\x82\xac\x98\x1b\x5b\x43\x87\x90\xdc\xd2\x04\x9c\xdd\x5c\xfe\xf9\xcd\x51\x7a\x41\xbc\x6d\xd9\x96\xf8\xa6\xff\xa8\xc4\xf7\x29\x8d\xf6\xaa\x3a\x7d\x3e\x4b\xa8\xac\x21\xe4\x34\xef\xf3\x39\xf7\xdd\xcd\x3e\x67\xca\x22\x74\x79\x58\x8a\xcc\x2d\xc1\x19\xbb\x3e\x9a\x96\xa9\x85\x4c\x75\xe8\xf2\x77\x75\xbc\x65\x1e\x40\xe9\x0e\xb3\x17\x82\x33\xaa\x2a\x7d\xfd\xf6\xed\xf9\xe9\xf3\xb4\xac\x97\x84\x99\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x9b\xaf\xb3\x45\xc5\x48\x69\x89\x60\x53\xc2\x92\x0c\x71\x96\x74\xdd\x9a\x58\x14\xa8\xe0\xf2\xf2\x4d\x7a\xc6\x94\xb0\xcd\xfb\x15\x3a\xd2\xaf\x92\xee\xb7\x35\x23\xca\x35\x78\xb5\x2a\x53\x2c\x06\x00\x35\xd7\x43\xbc\xa4\x85\xf6\x75\x96\x94\x6d\x9b\x11\x07\xed\x6f\x18\xcd\x5a\xe7\x21\x68\xa9\x8e\xa8\xbd\x6e\x7a\x9a\xc6\x14\xe5\xa4\x8a\xaa\xfe\x94\xaf\xab\x82\x90\xed\x11\x12\x97\x45\x62\xd1\xd0\xbc\x71\x69\xa2\xcc\x66\x8f\xa1\xe6\x0b\xda\x00\xba\xf4\xde\xec\x1e\x38\xee\xbd\xc7\xf7\x66\x49\xdd\x64\xc2\x25\x98\x37\x17\x55\x97\xcf\x89\x4f\xcb\xbe\xd1\x1a\xd7\xfb\x1b\xd3\x8f\x74\x45\x21\xd2\x08\x82\x71\xcb\x7b\x11\xb6\x00\x26\xae\x9c\x18\x36\x98\x8d\xb2\x99\x70\xec\xc6\x93\xdc\xfc\x0a\x5b\x72\x09\xa3\x31\x27\x36\x61\x46\x5d\xc7\xdb\xed\xba\x5a\x48\xd3\x2f\x25\xcf\x13\x1a\xef\xcc\x8a\x94\x10\x0e\x84\x62\x79\x01\xb9\x50\xaf\x99\x6d\xa5\x11\x9f\x47\xf9\x55\x49\x2b\x67\xb5\x5b\xca\xee\xb4\x6e\x76\xc5\x37\x60\x28\x36\x73\x9e\x9f\xa4\xef\x1a\xea\x30\xa8\xc3\x01\xf8\x26\x8e\x89\x31\xb0\x30\xd0\x96\x9b\xa6\x67\xc4\x69\xb1\x8a\xa6\x67\x5f\x51\x26\x8d\xb4\xcb\x3f\x11\x5b\xec\x1b\x59\x92\x05\x2d\xb9\x05\x57\x4c\x1c\x6c\x47\x3b\xba\x2c\x0b\xe2\x23\xb2\x34\x2c\x2d\xa6\x41\x40\x6d\x76\xb4\x9a\x56\x54\x19\x23\x9e\x25\x12\xaa\x72\xaa\x9f\x18\x12\xd5\x83\x55\x4e\x2b\xb7\xa1\xcd\x93\x27\xfa\x14\x1f\xfa\x3b\xac\x9f\x7a\x95\x5f\x5f\x53\xaf\x3a\x5a\x15\xaf\xd2\xc5\xba\xa1\x25\xf5\xcb\xbb\x37\x1d\x2f\x98\x55\xb6\x6d\x5a\x48\x22\x94\x75\x41\x9f\x2e\x2d\x40\x34\x43\xd4\xbb\xcd\x9c\x7e\xed\x57\x15\x31\x6a\xa0\x9d\x4b\xb0\x94\x44\xa9\xd4\xc4\xae\xa3\x29\x3c\x4a\x69\x09\xdLine truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead(
@@ -4379,7 +4379,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 44703, mode: os.FileMode(420), modTime: time.Unix(1447686173, 0)}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 44760, mode: os.FileMode(420), modTime: time.Unix(1447733937, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
+40
View File
@@ -2470,6 +2470,46 @@ footer .container .links > *:first-child {
.repository.new.release .prerelease.field {
margin-bottom: 0;
}
.repository.watchers .list {
padding: 0;
}
.repository.watchers .list .item {
list-style: none;
width: 25%;
margin: 10px 10px 10px 0;
padding-bottom: 14px;
float: left;
}
.repository.watchers .list .item .avatar {
width: 48px;
height: 48px;
float: left;
display: block;
margin-right: 10px;
}
.repository.watchers .list .item .name {
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
}
.repository.watchers .list .item .meta {
margin-top: 5px;
}
.repository.forks .list {
margin-top: 0;
}
.repository.forks .list .item {
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #DDD;
}
.repository.forks .list .item .ui.avatar {
float: left;
margin-right: 5px;
}
.repository.forks .list .item .link {
padding-top: 5px;
}
.issue.list {
list-style: none;
padding-top: 15px;
+49
View File
@@ -885,6 +885,55 @@
margin-bottom: 0;
}
}
&.watchers {
.list {
padding: 0;
.item {
list-style: none;
width: 25%;
margin: 10px 10px 10px 0;
padding-bottom: 14px;
float: left;
.avatar {
width: 48px;
height: 48px;
float: left;
display: block;
margin-right: 10px;
}
.name {
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
}
.meta {
margin-top: 5px;
}
}
}
}
&.forks {
.list {
margin-top: 0;
.item {
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #DDD;
.ui.avatar {
float: left;
margin-right: 5px;
}
.link {
padding-top: 5px;
}
}
}
}
}
// End of .repository
-44
View File
@@ -1,44 +0,0 @@
// 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 repo
import (
"github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
)
const (
STARS base.TplName = "repo/stars"
)
func Stars(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repos.stars")
page := ctx.QueryInt("page")
if page <= 0 {
page = 1
}
ctx.Data["Page"] = paginater.New(ctx.Repo.Repository.NumStars, models.ItemsPerPage, page, 5)
stars, err := ctx.Repo.Repository.GetStars(ctx.QueryInt("page"))
if err != nil {
ctx.Handle(500, "GetStars", err)
return
}
if (ctx.QueryInt("page")-1)*models.ItemsPerPage > ctx.Repo.Repository.NumStars {
ctx.Handle(404, "ctx.Repo.Repository.NumStars", nil)
return
}
ctx.Data["Stars"] = stars
ctx.HTML(200, STARS)
}
+34 -1
View File
@@ -11,6 +11,8 @@ import (
"path/filepath"
"strings"
"github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/git"
@@ -20,7 +22,8 @@ import (
)
const (
HOME base.TplName = "repo/home"
HOME base.TplName = "repo/home"
WATCHERS base.TplName = "repo/watchers"
)
func Home(ctx *middleware.Context) {
@@ -245,3 +248,33 @@ func Home(ctx *middleware.Context) {
ctx.Data["BranchLink"] = branchLink
ctx.HTML(200, HOME)
}
func renderItems(ctx *middleware.Context, total int, getter func(page int) ([]*models.User, error)) {
page := ctx.QueryInt("page")
if page <= 0 {
page = 1
}
pager := paginater.New(total, models.ItemsPerPage, page, 5)
ctx.Data["Page"] = pager
items, err := getter(pager.Current())
if err != nil {
ctx.Handle(500, "getter", err)
return
}
ctx.Data["Watchers"] = items
ctx.HTML(200, WATCHERS)
}
func Watchers(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repo.watchers")
ctx.Data["PageIsWatchers"] = true
renderItems(ctx, ctx.Repo.Repository.NumWatches, ctx.Repo.Repository.GetWatchers)
}
func Stars(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repo.stargazers")
ctx.Data["PageIsStargazers"] = true
renderItems(ctx, ctx.Repo.Repository.NumStars, ctx.Repo.Repository.GetStargazers)
}
-44
View File
@@ -1,44 +0,0 @@
// 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 repo
import (
"github.com/Unknwon/paginater"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
)
const (
WATCHERS base.TplName = "repo/watchers"
)
func Watchers(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repos.watches")
page := ctx.QueryInt("page")
if page <= 0 {
page = 1
}
ctx.Data["Page"] = paginater.New(ctx.Repo.Repository.NumWatches, models.ItemsPerPage, page, 5)
watchers, err := ctx.Repo.Repository.GetWatchers(ctx.QueryInt("page"))
if err != nil {
ctx.Handle(500, "GetWatchers", err)
return
}
if (ctx.QueryInt("page")-1)*models.ItemsPerPage > ctx.Repo.Repository.NumWatches {
ctx.Handle(404, "ctx.Repo.Repository.NumWatches", nil)
return
}
ctx.Data["Watchers"] = watchers
ctx.HTML(200, WATCHERS)
}
+20 -24
View File
@@ -1,27 +1,23 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="forks">
<h4>
<strong>{{.i18n.Tr "repos.forks"}}</strong>
</h4>
<ol>
{{range .Forks}}
<p>
<img class="avatar-small" src="{{.Owner.AvatarLink}}">
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
/
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a>
</p>
{{end}}
</div>
{{template "base/head" .}}
<div class="repository forks">
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/sidebar" .}}
<h2 class="ui dividing header">
{{.i18n.Tr "repo.forks"}}
</h2>
<div class="ui list">
{{range .Forks}}
<div class="item">
<img class="ui avatar image" src="{{.Owner.AvatarLink}}">
<div class="link">
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
/
<a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a>
</div>
</div>
{{template "repo/sidebar" .}}
{{end}}
</div>
</div>
</div>
{{template "ng/base/footer" .}}
{{template "base/footer" .}}
+1 -1
View File
@@ -114,4 +114,4 @@
{{end}}
</div>
</div>
{{template "base/footer" .}}
{{template "base/footer" .}}
-61
View File
@@ -1,61 +0,0 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="stars">
<h4>
<strong>{{.i18n.Tr "repos.stars"}}</strong>
</h4>
<ol>
{{range .Stars}}
<li>
<a href="{{AppSubUrl}}/{{.Name}}">
<img class="avatar" src="{{.AvatarLink}}" title="{{.Name}}"/>
<h3>{{.Name}}</h3>
</a>
<p>
{{if .Website}}
<span class="octicon octicon-link"></span> <a href="{{.Website}}" target="_blank">{{.Website}}</a>
{{else if .Location}}
<span class="octicon octicon-location"></span> {{.Location}}
{{else}}
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
{{end}}
</p>
</li>
{{end}}
</ol>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="pagination">
{{if .HasPrevious}}
<a href="{{$.RepoLink}}/stars?page={{.Previous}}">{{$.i18n.Tr "issues.previous"}}</a>
{{end}}
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/stars?page={{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
{{if .HasNext}}
<a href="{{$.RepoLink}}/stars?page={{.Next}}">{{$.i18n.Tr "issues.next"}}</a>
{{end}}
</div>
{{end}}
{{end}}
</div>
</div>
{{template "repo/sidebar" .}}
</div>
</div>
{{template "ng/base/footer" .}}
+53 -57
View File
@@ -1,61 +1,57 @@
{{template "ng/base/head" .}}
{{template "ng/base/header" .}}
<div id="repo-wrapper">
{{template "repo/header_old" .}}
<div id="repo-content" class="clear container">
<div id="repo-main" class="left grid-5-6">
<div id="stars">
<h4>
<strong>{{.i18n.Tr "repos.watches"}}</strong>
</h4>
{{template "base/head" .}}
<div class="repository watchers">
{{template "repo/header" .}}
<div class="ui container">
{{template "repo/sidebar" .}}
<h2 class="ui dividing header">
{{if .PageIsWatchers}}
{{.i18n.Tr "repo.watchers"}}
{{else}}
{{.i18n.Tr "repo.stargazers"}}
{{end}}
</h2>
<ul class="list">
{{range .Watchers}}
<li class="item ui segment">
<a href="{{.HomeLink}}">
<img class="avatar" src="{{.AvatarLink}}"/>
</a>
<h3 class="name"><a href="{{.HomeLink}}">{{.DisplayName}}</a></h3>
<ol>
{{range .Watchers}}
<li>
<a href="{{AppSubUrl}}/{{.Name}}">
<img class="avatar" src="{{.AvatarLink}}" title="{{.Name}}"/>
<h3>{{.Name}}</h3>
</a>
<p>
{{if .Website}}
<span class="octicon octicon-link"></span> <a href="{{.Website}}" target="_blank">{{.Website}}</a>
{{else if .Location}}
<span class="octicon octicon-location"></span> {{.Location}}
{{else}}
<span class="octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
{{end}}
</p>
</li>
{{end}}
</ol>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="pagination">
{{if .HasPrevious}}
<a href="{{$.RepoLink}}/watchers?page={{.Previous}}">{{$.i18n.Tr "issues.previous"}}</a>
{{end}}
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.RepoLink}}/watchers?page={{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
{{if .HasNext}}
<a href="{{$.RepoLink}}/watchers?page={{.Next}}">{{$.i18n.Tr "issues.next"}}</a>
{{end}}
</div>
{{end}}
{{end}}
</div>
<div class="meta">
{{if .Website}}
<span class="icon octicon octicon-link"></span> <a href="{{.Website}}" target="_blank">{{.Website}}</a>
{{else if .Location}}
<span class="icon octicon octicon-location"></span> {{.Location}}
{{else}}
<span class="icon octicon octicon-clock"></span> {{$.i18n.Tr "user.join_on"}} {{DateFmtShort .Created}}
{{end}}
</div>
{{template "repo/sidebar" .}}
</li>
{{end}}
</ul>
{{with .Page}}
{{if gt .TotalPages 1}}
<div class="center page buttons">
<div class="ui borderless pagination menu">
<a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?page={{.Previous}}"{{end}}>
<i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
</a>
{{range .Pages}}
{{if eq .Num -1}}
<a class="disabled item">...</a>
{{else}}
<a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?page={{.Num}}"{{end}}>{{.Num}}</a>
{{end}}
{{end}}
<a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?page={{.Next}}"{{end}}>
{{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
</a>
</div>
</div>
{{end}}
{{end}}
</div>
</div>
{{template "ng/base/footer" .}}
{{template "base/footer" .}}