|
128 | 128 | {{if .IsGenerated}}<div class="fork-flag">{{ctx.Locale.Tr "repo.generated_from"}} <a href="{{(.TemplateRepo ctx).Link}}">{{(.TemplateRepo ctx).FullName}}</a></div>{{end}} |
129 | 129 | </div> |
130 | 130 | {{end}} |
131 | | - <overflow-menu class="ui container secondary pointing tabular top attached borderless menu tw-pt-0 tw-my-0"> |
132 | | - {{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}} |
133 | | - <div class="overflow-menu-items"> |
134 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}} |
135 | | - <a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if and (ne .BranchName .Repository.DefaultBranch) (not $.PageIsWiki)}}/src/{{.BranchNameSubURL}}{{end}}"> |
136 | | - {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} |
137 | | - </a> |
138 | | - {{end}} |
139 | | - |
140 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} |
141 | | - <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues"> |
142 | | - {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}} |
143 | | - {{if .Repository.NumOpenIssues}} |
144 | | - <span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span> |
145 | | - {{end}} |
| 131 | + <div class="ui container"> |
| 132 | + <overflow-menu class="ui secondary pointing menu"> |
| 133 | + {{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}} |
| 134 | + <div class="overflow-menu-items"> |
| 135 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}} |
| 136 | + <a class="{{if .PageIsViewCode}}active {{end}}item" href="{{.RepoLink}}{{if and (ne .BranchName .Repository.DefaultBranch) (not $.PageIsWiki)}}/src/{{.BranchNameSubURL}}{{end}}"> |
| 137 | + {{svg "octicon-code"}} {{ctx.Locale.Tr "repo.code"}} |
146 | 138 | </a> |
147 | | - {{end}} |
| 139 | + {{end}} |
148 | 140 |
|
149 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalTracker}} |
150 | | - <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer"> |
151 | | - {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}} |
152 | | - </a> |
153 | | - {{end}} |
| 141 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeIssues}} |
| 142 | + <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoLink}}/issues"> |
| 143 | + {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues"}} |
| 144 | + {{if .Repository.NumOpenIssues}} |
| 145 | + <span class="ui small label">{{CountFmt .Repository.NumOpenIssues}}</span> |
| 146 | + {{end}} |
| 147 | + </a> |
| 148 | + {{end}} |
154 | 149 |
|
155 | | - {{if and .Repository.CanEnablePulls (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests)}} |
156 | | - <a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls"> |
157 | | - {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}} |
158 | | - {{if .Repository.NumOpenPulls}} |
159 | | - <span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span> |
160 | | - {{end}} |
161 | | - </a> |
162 | | - {{end}} |
| 150 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalTracker}} |
| 151 | + <a class="{{if .PageIsIssueList}}active {{end}}item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer"> |
| 152 | + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.issues"}} |
| 153 | + </a> |
| 154 | + {{end}} |
163 | 155 |
|
164 | | - {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeActions)}} |
165 | | - <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> |
166 | | - {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} |
167 | | - {{if .Repository.NumOpenActionRuns}} |
168 | | - <span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span> |
169 | | - {{end}} |
170 | | - </a> |
171 | | - {{end}} |
| 156 | + {{if and .Repository.CanEnablePulls (.Permission.CanRead ctx.Consts.RepoUnitTypePullRequests)}} |
| 157 | + <a class="{{if .PageIsPullList}}active {{end}}item" href="{{.RepoLink}}/pulls"> |
| 158 | + {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.pulls"}} |
| 159 | + {{if .Repository.NumOpenPulls}} |
| 160 | + <span class="ui small label">{{CountFmt .Repository.NumOpenPulls}}</span> |
| 161 | + {{end}} |
| 162 | + </a> |
| 163 | + {{end}} |
172 | 164 |
|
173 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypePackages}} |
174 | | - <a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item"> |
175 | | - {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} |
176 | | - </a> |
177 | | - {{end}} |
| 165 | + {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeActions)}} |
| 166 | + <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> |
| 167 | + {{svg "octicon-play"}} {{ctx.Locale.Tr "actions.actions"}} |
| 168 | + {{if .Repository.NumOpenActionRuns}} |
| 169 | + <span class="ui small label">{{CountFmt .Repository.NumOpenActionRuns}}</span> |
| 170 | + {{end}} |
| 171 | + </a> |
| 172 | + {{end}} |
178 | 173 |
|
179 | | - {{$projectsUnit := .Repository.MustGetUnit $.Context ctx.Consts.RepoUnitTypeProjects}} |
180 | | - {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeProjects) ($projectsUnit.ProjectsConfig.IsProjectsAllowed "repo")}} |
181 | | - <a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item"> |
182 | | - {{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project_board"}} |
183 | | - {{if .Repository.NumOpenProjects}} |
184 | | - <span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span> |
185 | | - {{end}} |
186 | | - </a> |
187 | | - {{end}} |
| 174 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypePackages}} |
| 175 | + <a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item"> |
| 176 | + {{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}} |
| 177 | + </a> |
| 178 | + {{end}} |
188 | 179 |
|
189 | | - {{if and (.Permission.CanRead ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}} |
190 | | - <a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases"> |
191 | | - {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} |
192 | | - {{if .NumReleases}} |
193 | | - <span class="ui small label">{{CountFmt .NumReleases}}</span> |
194 | | - {{end}} |
195 | | - </a> |
196 | | - {{end}} |
| 180 | + {{$projectsUnit := .Repository.MustGetUnit $.Context ctx.Consts.RepoUnitTypeProjects}} |
| 181 | + {{if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead ctx.Consts.RepoUnitTypeProjects) ($projectsUnit.ProjectsConfig.IsProjectsAllowed "repo")}} |
| 182 | + <a href="{{.RepoLink}}/projects" class="{{if .IsProjectsPage}}active {{end}}item"> |
| 183 | + {{svg "octicon-project"}} {{ctx.Locale.Tr "repo.project_board"}} |
| 184 | + {{if .Repository.NumOpenProjects}} |
| 185 | + <span class="ui small label">{{CountFmt .Repository.NumOpenProjects}}</span> |
| 186 | + {{end}} |
| 187 | + </a> |
| 188 | + {{end}} |
197 | 189 |
|
198 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypeWiki}} |
199 | | - <a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki"> |
200 | | - {{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}} |
| 190 | + {{if and (.Permission.CanRead ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}} |
| 191 | + <a class="{{if or .PageIsReleaseList .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/releases"> |
| 192 | + {{svg "octicon-tag"}} {{ctx.Locale.Tr "repo.releases"}} |
| 193 | + {{if .NumReleases}} |
| 194 | + <span class="ui small label">{{CountFmt .NumReleases}}</span> |
| 195 | + {{end}} |
201 | 196 | </a> |
202 | | - {{end}} |
| 197 | + {{end}} |
203 | 198 |
|
204 | | - {{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalWiki}} |
205 | | - <a class="item" href="{{(.Repository.MustGetUnit $.Context ctx.Consts.RepoUnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank" rel="noopener noreferrer"> |
206 | | - {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}} |
207 | | - </a> |
208 | | - {{end}} |
| 199 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeWiki}} |
| 200 | + <a class="{{if .PageIsWiki}}active {{end}}item" href="{{.RepoLink}}/wiki"> |
| 201 | + {{svg "octicon-book"}} {{ctx.Locale.Tr "repo.wiki"}} |
| 202 | + </a> |
| 203 | + {{end}} |
209 | 204 |
|
210 | | - {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}} |
211 | | - <a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity"> |
212 | | - {{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}} |
213 | | - </a> |
214 | | - {{end}} |
| 205 | + {{if .Permission.CanRead ctx.Consts.RepoUnitTypeExternalWiki}} |
| 206 | + <a class="item" href="{{(.Repository.MustGetUnit $.Context ctx.Consts.RepoUnitTypeExternalWiki).ExternalWikiConfig.ExternalWikiURL}}" target="_blank" rel="noopener noreferrer"> |
| 207 | + {{svg "octicon-link-external"}} {{ctx.Locale.Tr "repo.wiki"}} |
| 208 | + </a> |
| 209 | + {{end}} |
215 | 210 |
|
216 | | - {{template "custom/extra_tabs" .}} |
| 211 | + {{if and (.Permission.CanReadAny ctx.Consts.RepoUnitTypePullRequests ctx.Consts.RepoUnitTypeIssues ctx.Consts.RepoUnitTypeReleases) (not .IsEmptyRepo)}} |
| 212 | + <a class="{{if .PageIsActivity}}active {{end}}item" href="{{.RepoLink}}/activity"> |
| 213 | + {{svg "octicon-pulse"}} {{ctx.Locale.Tr "repo.activity"}} |
| 214 | + </a> |
| 215 | + {{end}} |
217 | 216 |
|
218 | | - {{if .Permission.IsAdmin}} |
219 | | - <span class="item-flex-space"></span> |
| 217 | + {{template "custom/extra_tabs" .}} |
| 218 | + |
| 219 | + {{if .Permission.IsAdmin}} |
| 220 | + <span class="item-flex-space"></span> |
| 221 | + <a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings"> |
| 222 | + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} |
| 223 | + </a> |
| 224 | + {{end}} |
| 225 | + </div> |
| 226 | + {{else if .Permission.IsAdmin}} |
| 227 | + <div class="overflow-menu-items"> |
220 | 228 | <a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings"> |
221 | 229 | {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} |
222 | 230 | </a> |
223 | | - {{end}} |
224 | | - </div> |
225 | | - {{else if .Permission.IsAdmin}} |
226 | | - <div class="overflow-menu-items"> |
227 | | - <a class="{{if .PageIsRepoSettings}}active {{end}} item" href="{{.RepoLink}}/settings"> |
228 | | - {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} |
229 | | - </a> |
230 | | - </div> |
231 | | - {{end}} |
232 | | - </overflow-menu> |
| 231 | + </div> |
| 232 | + {{end}} |
| 233 | + </overflow-menu> |
| 234 | + </div> |
233 | 235 | <div class="ui tabs divider"></div> |
234 | 236 | </div> |
0 commit comments