mirror of
https://github.com/go-gitea/gitea
synced 2024-11-25 05:02:49 +01:00
improve
This commit is contained in:
parent
0956e50893
commit
7486f27681
4 changed files with 9 additions and 2 deletions
|
@ -22,6 +22,11 @@ func Activity(ctx *context.Context) {
|
|||
ctx.Data["Title"] = ctx.Tr("repo.activity")
|
||||
ctx.Data["PageIsActivity"] = true
|
||||
|
||||
if !ctx.Repo.CanReadAny(unit.TypePullRequests, unit.TypeIssues, unit.TypeReleases) {
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/activity/contributors")
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Data["PageIsPulse"] = true
|
||||
|
||||
ctx.Data["Period"] = ctx.PathParam("period")
|
||||
|
|
|
@ -1456,7 +1456,7 @@ func registerRoutes(m *web.Router) {
|
|||
m.Get("/data", repo.RecentCommitsData)
|
||||
}, reqRepoCodeReader)
|
||||
},
|
||||
ignSignIn, context.RepoAssignment, context.RequireRepoReaderOr(unit.TypePullRequests, unit.TypeIssues, unit.TypeReleases),
|
||||
ignSignIn, context.RepoAssignment, context.RequireRepoReaderOr(unit.TypePullRequests, unit.TypeIssues, unit.TypeReleases, unit.TypeCode),
|
||||
context.RepoRef(), repo.MustBeNotEmpty,
|
||||
)
|
||||
// end "/{username}/{reponame}/activity"
|
||||
|
|
|
@ -208,7 +208,7 @@
|
|||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}}
|
||||
{{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases ctx.Consts.RepoUnitTypeCode) (not .IsEmptyRepo)}}
|
||||
<a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity">
|
||||
{{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}}
|
||||
</a>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<div class="ui fluid vertical menu">
|
||||
{{if (or (.Permission.CanRead ctx.Consts.RepoUnitTypeIssues) (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests))}}
|
||||
<a class="{{if .PageIsPulse}}active {{end}}item" href="{{.RepoLink}}/activity">
|
||||
{{ctx.Locale.Tr "repo.activity.navbar.pulse"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
|
||||
<a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
|
||||
{{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
|
||||
|
|
Loading…
Reference in a new issue