mirror of https://github.com/go-gitea/gitea.git
#2251 fix button name
This commit is contained in:
parent
53eb37d529
commit
5ff6eedf5e
|
@ -51,6 +51,8 @@ func MustEnablePulls(ctx *middleware.Context) {
|
||||||
if !ctx.Repo.Repository.EnablePulls {
|
if !ctx.Repo.Repository.EnablePulls {
|
||||||
ctx.Handle(404, "MustEnablePulls", nil)
|
ctx.Handle(404, "MustEnablePulls", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.Data["HasForkedRepo"] = ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RetrieveLabels(ctx *middleware.Context) {
|
func RetrieveLabels(ctx *middleware.Context) {
|
||||||
|
@ -69,9 +71,12 @@ func RetrieveLabels(ctx *middleware.Context) {
|
||||||
func Issues(ctx *middleware.Context) {
|
func Issues(ctx *middleware.Context) {
|
||||||
isPullList := ctx.Params(":type") == "pulls"
|
isPullList := ctx.Params(":type") == "pulls"
|
||||||
if isPullList {
|
if isPullList {
|
||||||
|
MustEnablePulls(ctx)
|
||||||
|
if ctx.Written() {
|
||||||
|
return
|
||||||
|
}
|
||||||
ctx.Data["Title"] = ctx.Tr("repo.pulls")
|
ctx.Data["Title"] = ctx.Tr("repo.pulls")
|
||||||
ctx.Data["PageIsPullList"] = true
|
ctx.Data["PageIsPullList"] = true
|
||||||
ctx.Data["HasForkedRepo"] = ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
MustEnableIssues(ctx)
|
MustEnableIssues(ctx)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
<a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
<a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
{{template "repo/issue/navbar" .}}
|
{{template "repo/issue/navbar" .}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
<a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
|
<a class="ui green button {{if not .HasForkedRepo}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.SignedUserName}}:{{.BranchName}}">{{.i18n.Tr "repo.pulls.new"}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
|
|
Loading…
Reference in New Issue