0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 03:35:05 +02:00

create templates for group selection menu displayed in organization dashboard header, and update dashboard template to show said selection menu

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-08-16 16:25:24 -04:00
parent e91c1db2cb
commit b32762ae23
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
4 changed files with 56 additions and 4 deletions

View File

@ -0,0 +1,18 @@
<div class="ui floating dropdown jump">
<span class="text">
{{if .Group}}
{{.Group.Name}}
{{else}}
{{ctx.Locale.Tr "org.groups"}}
{{ end }}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="context user overflow menu" data-variation="basic">
<div class="ui header">
{{ctx.Locale.Tr "home.filter_by_group_repositories"}}
</div>
<div class="scrolling menu items">
{{template "group/dashboard/submenu" dict "." . "Items" .GroupNavItems "Depth" 0}}
</div>
</div>
</div>

View File

@ -0,0 +1,19 @@
<a
class="item {{if .Group}}{{if eq $.Group.ID .Item.ID}}active selected{{
end
}}{{ end }}"
style="--depth: {{.Depth}};"
href="{{
$.Org.OrganisationLink
}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{
end
}}/group/{{.Item.ID}}"
>
<span style="padding-left: calc(0.75rem * var(--depth))">
{{.Item.Title}}
</span>
</a>
{{$d := .Depth}}
{{$one := 1}}
{{$d1 := Eval $d "+" $one}}
{{template "group/dashboard/submenu" dict "." . "Items" (.Item.Children .SignedUser) "Depth" $d1}}

View File

@ -0,0 +1,6 @@
{{ range.Items}}
{{if .IsGroup}}
{{ template "group/dashboard/menu_item" dict "." $ "Item" . "Depth" $.Depth}}
{{ end }}
{{ end }}

View File

@ -74,25 +74,34 @@
</div>
</div>
</div>
<div class="item">
{{template "group/dashboard/menu" .}}
</div>
{{end}}
{{if .ContextUser.IsOrganization}}
{{$suffix := ""}}
{{if .Team}}
{{$suffix = PathEscape .Team.Name}}
{{else if .Group}}
{{$suffix = URLJoin "group" (StringUtils.ToString .Group.ID)}}
{{end}}
<div class="right menu tw-flex-wrap tw-justify-end">
<a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
<a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}/{{$suffix}}">
{{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
</a>
{{if not ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled}}
<a class="{{if .PageIsIssues}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/issues{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
<a class="{{if .PageIsIssues}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/issues/{{$suffix}}">
{{svg "octicon-issue-opened"}}&nbsp;{{ctx.Locale.Tr "issues"}}
</a>
{{end}}
{{if not ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled}}
<a class="{{if .PageIsPulls}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/pulls{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
<a class="{{if .PageIsPulls}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/pulls/{{$suffix}}">
{{svg "octicon-git-pull-request"}}&nbsp;{{ctx.Locale.Tr "pull_requests"}}
</a>
{{end}}
{{if and .ShowMilestonesDashboardPage (not (and ctx.Consts.RepoUnitTypeIssues.UnitGlobalDisabled ctx.Consts.RepoUnitTypePullRequests.UnitGlobalDisabled))}}
<a class="{{if .PageIsMilestonesDashboard}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/milestones{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
<a class="{{if .PageIsMilestonesDashboard}}active {{end}}item" href="{{.ContextUser.OrganisationLink}}/milestones/{{$suffix}}">
{{svg "octicon-milestone"}}&nbsp;{{ctx.Locale.Tr "milestones"}}
</a>
{{end}}