2
0
Files
logikonline 07738be978 feat(explore): add organization grouping on explore page
Adds optional group_header field to organizations for categorizing them on the explore page (e.g., "Enterprise", "Community", "Partners"). Includes database migration, organization settings form field, and grouped display template. Groups are sorted alphabetically with ungrouped organizations shown last. Users can toggle grouping view with show_groups parameter.
2026-01-18 13:08:30 -05:00

62 lines
1.9 KiB
Handlebars

{{if and (eq (.SystemConfig.Theme.ExploreOrgDisplayFormat.Value ctx) "tiles")}}
{{/* Tile Cards View for Organizations - Grouped */}}
{{range .OrgHeaders}}
{{if .}}
<h4 class="ui dividing header tw-mt-4">{{.}}</h4>
{{end}}
{{$orgs := index $.GroupedOrgs .}}
<div class="ui four doubling stackable cards">
{{range $orgs}}
<a class="ui card" href="{{.HomeLink}}">
<div class="content tw-text-center">
<div class="tw-mb-3">
{{ctx.AvatarUtils.Avatar . 64 "tw-rounded"}}
</div>
<div class="header">{{.DisplayName}}</div>
{{if .Description}}
<div class="meta tw-mt-2">{{.Description}}</div>
{{end}}
</div>
</a>
{{end}}
</div>
{{end}}
{{else}}
{{/* Default List View - Grouped */}}
{{range .OrgHeaders}}
{{if .}}
<h4 class="ui dividing header tw-mt-4">{{.}}</h4>
{{end}}
{{$orgs := index $.GroupedOrgs .}}
<div class="flex-list">
{{range $orgs}}
<div class="flex-item tw-items-center">
<div class="flex-item-leading">
{{ctx.AvatarUtils.Avatar . 48}}
</div>
<div class="flex-item-main">
<div class="flex-item-title">
<a class="text muted" href="{{.HomeLink}}">{{.DisplayName}}</a>
{{if .Visibility.IsPrivate}}
<span class="ui basic tiny label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{end}}
</div>
<div class="flex-item-body">
{{if .Location}}
<span class="flex-text-inline">{{svg "octicon-location"}}{{.Location}}</span>
{{end}}
{{if and .Email (or (and $.ShowUserEmail $.IsSigned (not .KeepEmailPrivate)) $.PageIsAdminUsers)}}
<span class="flex-text-inline">
{{svg "octicon-mail"}}
<a href="mailto:{{.Email}}">{{.Email}}</a>
</span>
{{end}}
<span class="flex-text-inline">{{svg "octicon-calendar"}}{{ctx.Locale.Tr "user.joined_on" (DateUtils.AbsoluteShort .CreatedUnix)}}</span>
</div>
</div>
</div>
{{end}}
</div>
{{end}}
{{end}}