diff options
author | 赵智超 <1012112796@qq.com> | 2020-04-04 13:39:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 02:39:48 -0300 |
commit | 14c97c05019d416d634ad486c03674a2b9af92ef (patch) | |
tree | 43389cad020e8bbcf0c802c0647172103d09ecc3 /routers | |
parent | 4f63f283c47dcf9e705ce5b8e8857f2b42cff8ad (diff) | |
download | gitea-14c97c05019d416d634ad486c03674a2b9af92ef.tar.gz gitea-14c97c05019d416d634ad486c03674a2b9af92ef.zip |
Add titles and improve messages on sidebar menus (#10872)
* ui: add more message on sidebar menus
* add title on the menus
* show some message instead of hide choose bar when have nothing to choose
* add simply filter for each menus
* do same changes in mew_form.tmpl
* remove some unusefull comments in mew_form.tmpl
Signed-off-by: a1012112796 <1012112796@qq.com>
* do review suggestions
* add filter message on sidebar filter
* change IsIssueWriter to HasIssuesOrPullsWritePermission
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/compare.go | 2 | ||||
-rw-r--r-- | routers/repo/issue.go | 4 | ||||
-rw-r--r-- | routers/repo/pull.go | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 87b66dc7fb..198c75e652 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -432,6 +432,8 @@ func CompareDiff(ctx *context.Context) { setTemplateIfExists(ctx, pullRequestTemplateKey, pullRequestTemplateCandidates) renderAttachmentSettings(ctx) + ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWrite(models.UnitTypePullRequests) + ctx.HTML(200, tplCompare) } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 6dbf9cf5c8..0697d11a66 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -487,6 +487,8 @@ func NewIssue(ctx *context.Context) { return } + ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWrite(models.UnitTypeIssues) + ctx.HTML(200, tplIssueNew) } @@ -1076,7 +1078,7 @@ func ViewIssue(ctx *context.Context) { ctx.Data["ReadOnly"] = true ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + ctx.Data["Link"].(string) ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID) - ctx.Data["IsIssueWriter"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) + ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) ctx.Data["IsRepoAdmin"] = ctx.IsSigned && (ctx.Repo.IsAdmin() || ctx.User.IsAdmin) ctx.Data["LockReasons"] = setting.Repository.Issue.LockReasons ctx.HTML(200, tplIssueView) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index c29cfb81b2..55b8bbb42f 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -652,7 +652,7 @@ func ViewPullFiles(ctx *context.Context) { } getBranchData(ctx, issue) ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID) - ctx.Data["IsIssueWriter"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) + ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) ctx.HTML(200, tplPullFiles) } |