|
30 | 30 | {{.NumStars}}
|
31 | 31 | </a>
|
32 | 32 | </div>
|
33 |
| - {{if and (not .IsBare) ($.Permission.CanAccess $.UnitTypeCode)}} |
| 33 | + {{if and (not .IsBare) ($.Permission.CanRead $.UnitTypeCode)}} |
34 | 34 | <div class="ui compact labeled button" tabindex="0">
|
35 | 35 | <a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
|
36 | 36 | <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
|
|
47 | 47 | {{if not .IsDiffCompare}}
|
48 | 48 | <div class="ui tabs container">
|
49 | 49 | <div class="ui tabular stackable menu navbar">
|
50 |
| - {{if .Permission.CanAccess $.UnitTypeCode}} |
| 50 | + {{if .Permission.CanRead $.UnitTypeCode}} |
51 | 51 | <a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
|
52 | 52 | <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
|
53 | 53 | </a>
|
54 | 54 | {{end}}
|
55 | 55 |
|
56 |
| - {{if .Permission.CanAccess $.UnitTypeIssues}} |
| 56 | + {{if .Permission.CanRead $.UnitTypeIssues}} |
57 | 57 | <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
|
58 | 58 | <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
|
59 | 59 | </a>
|
60 | 60 | {{end}}
|
61 | 61 |
|
62 |
| - {{if .Permission.CanAccess $.UnitTypeExternalTracker}} |
| 62 | + {{if .Permission.CanRead $.UnitTypeExternalTracker}} |
63 | 63 | <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" target="_blank" rel="noopener noreferrer">
|
64 | 64 | <i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
|
65 | 65 | </a>
|
66 | 66 | {{end}}
|
67 | 67 |
|
68 |
| - {{if and .Repository.CanEnablePulls (.Permission.CanAccess $.UnitTypePullRequests)}} |
| 68 | + {{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}} |
69 | 69 | <a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
|
70 | 70 | <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui {{if not .Repository.NumOpenPulls}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenPulls}}</span>
|
71 | 71 | </a>
|
72 | 72 | {{end}}
|
73 | 73 |
|
74 |
| - {{if and (.Permission.CanAccess $.UnitTypeReleases) (not .IsBareRepo) }} |
| 74 | + {{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsBareRepo) }} |
75 | 75 | <a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
|
76 | 76 | <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui {{if not .Repository.NumReleases}}gray{{else}}blue{{end}} small label">{{.Repository.NumReleases}}</span>
|
77 | 77 | </a>
|
78 | 78 | {{end}}
|
79 | 79 |
|
80 |
| - {{if or (.Permission.CanAccess $.UnitTypeUncyclo) (.Permission.CanAccess $.UnitTypeExternalUncyclo)}} |
81 |
| - <a class="{{if .PageIsUncyclo}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanAccess $.UnitTypeExternalUncyclo)}} target="_blank" rel="noopener noreferrer" {{end}}> |
| 80 | + {{if or (.Permission.CanRead $.UnitTypeUncyclo) (.Permission.CanRead $.UnitTypeExternalUncyclo)}} |
| 81 | + <a class="{{if .PageIsUncyclo}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalUncyclo)}} target="_blank" rel="noopener noreferrer" {{end}}> |
82 | 82 | <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
|
83 | 83 | </a>
|
84 | 84 | {{end}}
|
85 | 85 |
|
86 |
| - {{if and (.Permission.CanAccessAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}} |
| 86 | + {{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}} |
87 | 87 | <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
|
88 | 88 | <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
|
89 | 89 | </a>
|
|
0 commit comments