diff --git a/README.md b/README.md index 44c626499..b6dd1ea5f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ The goal of this project is to make the easiest, fastest and most painless way t - Create/migrate/mirror/delete/watch/rename/transfer public/private repository - Repository viewer/release/issue tracker - Repository and Organization level webhooks +- Repository Git hooks - Add/remove repository collaborators - Gravatar and cache support - Mail service(register, issue) diff --git a/README_ZH.md b/README_ZH.md index 9581faf78..a8cefa44f 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -24,14 +24,15 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自 - 支持 SSH/HTTP(S) 协议 - 支持 SMTP/LDAP/反向代理 用户认证 - 支持反向代理子路径 -- 注册/删除/重命名 用户 -- 创建/管理/删除 组织以及团队管理功能 -- 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库 -- 仓库 浏览/发布/工单管理 -- 仓库和组织级别 Web 钩子 -- 添加/删除 仓库协作者 -- Gravatar 以及缓存支持 -- 邮件服务(注册、Issue) +- 支持 注册/删除/重命名 用户 +- 支持 创建/管理/删除 组织以及团队管理功能 +- 支持 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库 +- 支持仓库 浏览/发布/工单管理 +- 支持仓库和组织级别 Web 钩子 +- 支持仓库 Git 钩子 +- 支持 添加/删除 仓库协作者 +- 支持 Gravatar 以及本地缓存 +- 支持邮件服务(注册、Issue) - 管理员面板 - Slack Web 钩子集成 - 支持 MySQL、PostgreSQL 以及 SQLite3 数据库 diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index 7452fb735..e0a506650 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -273,6 +273,9 @@ tags = Tags issues = Issues commits = Commits releases = Releases +file_raw = Raw +file_history = History +file_view_raw = View Raw commits.commits = Commits commits.search = Search commits diff --git a/conf/locale/locale_zh-CN.ini b/conf/locale/locale_zh-CN.ini index aeed47561..c704ad205 100644 --- a/conf/locale/locale_zh-CN.ini +++ b/conf/locale/locale_zh-CN.ini @@ -273,6 +273,9 @@ tags = 标签列表 issues = 工单管理 commits = 提交历史 releases = 版本发布 +file_raw = 原始文件 +file_history = 文件历史 +file_view_raw = 查看原始文件 commits.commits = 次代码提交 commits.search = 搜索提交历史 diff --git a/gogs.go b/gogs.go index 05fcd2cd9..85a5626cf 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.5.5.1010 Beta" +const APP_VER = "0.5.5.1011 Beta" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index c33299519..419d034c6 100644 --- a/models/repo.go +++ b/models/repo.go @@ -663,7 +663,7 @@ func RepoPath(userName, repoName string) string { func TransferOwnership(u *User, newOwner string, repo *Repository) error { newUser, err := GetUserByName(newOwner) if err != nil { - return err + return fmt.Errorf("fail to get new owner(%s): %v", newOwner, err) } // Check if new owner has repository with same name. diff --git a/models/user.go b/models/user.go index ee8f8586d..dc9b052ca 100644 --- a/models/user.go +++ b/models/user.go @@ -488,7 +488,7 @@ func GetUserByName(name string) (*User, error) { return user, nil } -// GetUserEmailsByNames returns a slice of e-mails corresponds to names. +// GetUserEmailsByNames returns a list of e-mails corresponds to names. func GetUserEmailsByNames(names []string) []string { mails := make([]string, 0, len(names)) for _, name := range names { diff --git a/modules/middleware/context.go b/modules/middleware/context.go index 1d9f57389..86e98c907 100644 --- a/modules/middleware/context.go +++ b/modules/middleware/context.go @@ -75,12 +75,6 @@ type Context struct { } } -// Query querys form parameter. -func (ctx *Context) Query(name string) string { - ctx.Req.ParseForm() - return ctx.Req.Form.Get(name) -} - // HasError returns true if error occurs in form validation. func (ctx *Context) HasApiError() bool { hasErr, ok := ctx.Data["HasError"] diff --git a/public/ng/css/ui.css b/public/ng/css/ui.css index cc1a277fa..5aa1490f7 100644 --- a/public/ng/css/ui.css +++ b/public/ng/css/ui.css @@ -457,6 +457,9 @@ dt { box-sizing: content-box; text-align: center; } +.btn-comb { + margin-left: -1px; +} .btn-disabled { opacity: .6; cursor: not-allowed; diff --git a/public/ng/less/ui/form.less b/public/ng/less/ui/form.less index b3de4273c..6e33e606b 100644 --- a/public/ng/less/ui/form.less +++ b/public/ng/less/ui/form.less @@ -102,6 +102,9 @@ box-sizing: content-box; text-align: center; } +.btn-comb { + margin-left: -1px; +} .btn-disabled { opacity: .6; diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 4c5bcf0cb..b2c2e0f9a 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -276,13 +276,15 @@ func FileHistory(ctx *middleware.Context) { nextPage = 0 } - ctx.Data["Commits"], err = ctx.Repo.GitRepo.CommitsByFileAndRange( + commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange( branchName, fileName, page) if err != nil { ctx.Handle(500, "repo.FileHistory(CommitsByRange)", err) return } + commits = models.ValidateCommitsWithEmails(commits) + ctx.Data["Commits"] = commits ctx.Data["Username"] = userName ctx.Data["Reponame"] = repoName ctx.Data["FileName"] = fileName diff --git a/routers/repo/view.go b/routers/repo/view.go index ba76a6ada..26fa0b4c7 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -166,7 +166,7 @@ func Home(ctx *middleware.Context) { } if readmeFile != nil { - ctx.Data["ReadmeInHome"] = true + ctx.Data["ReadmeInList"] = true ctx.Data["ReadmeExist"] = true if dataRc, err := readmeFile.Data(); err != nil { ctx.Handle(404, "repo.SinglereadmeFile.LookupBlob", err) diff --git a/templates/.VERSION b/templates/.VERSION index d62a81b60..3f42d63cf 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.5.5.1010 Beta \ No newline at end of file +0.5.5.1011 Beta \ No newline at end of file diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index 5da8f48eb..a7942e09c 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -58,7 +58,7 @@
We recommend every repository include a README, LICENSE, and .gitignore.
-touch README.md
-git init
-git add README.md
-git commit -m "first commit"
-git remote add origin
-git push -u origin master
- git remote add origin
-git push -u origin master
- - | {{.FileContent}} |
-
- | Filename | -Message | -Date modified | -
---|---|---|---|
- | .. | -- | - |
- - | -- - {{$entry.Name}} - - | -- {{$commit.Summary}} - | -- {{TimeSince $commit.Committer.When}} - | -
{{if .ReadmeExist}} - {{if .ReadmeInHome}} + {{if .ReadmeInList}} {{.FileName}} {{else}} {{.FileName}}{{FileSize .FileSize}} {{end}} {{else}} - - {{.FileName}}{{FileSize .FileSize}} + + {{.FileName}}{{FileSize .FileSize}} {{end}} + {{if not .ReadmeInList}} + + + + + + + {{end}}