forgejo/templates/org/header.tmpl
0ko 2b4754c1d7 feat(ui): JSfree sorting on /explore/{users,organizations} (#9556)
This PR replaces the sort dropdowns on Users and Organizations pages of Explore with the one we've got earlier in two other areas. Previous such replacement happened in #8572.

This implies a few positive changes such as:
* larger font size
* larger clickable area for coarse cursor
* it is possible to use while scripts are still loading
* it is possible to use w/o JS

Some refactors were made to support this change and as general improvements.

Desktop, closed
B: https://codeberg.org/attachments/354f7194-b247-4ecd-8875-2e95dadc7445
A: https://codeberg.org/attachments/0fa49cf5-e8e5-4c15-b2b0-7d13e8505945

Desktop, open
B: https://codeberg.org/attachments/b01b75d1-dbe4-458c-abd5-64cd8c121bc1
A: https://codeberg.org/attachments/94baccc4-fe36-4ae1-ace0-9b4d5fbd9f42

Mobile, open
B: https://codeberg.org/attachments/f868720a-ec71-4829-87f7-a1cfab860e37
A: https://codeberg.org/attachments/bbe72710-6824-4107-8086-d2bd50897038

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9556
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-09 14:33:33 +02:00

55 lines
2.5 KiB
Go HTML Template

<div class="ui container tw-flex tw-gap-x-4">
{{ctx.AvatarUtils.Avatar .Org 100 "org-avatar"}}
<div id="org-info" class="tw-flex tw-flex-col">
<div class="org-header tw-flex">
<div class="org-title">
<h1>{{.Org.DisplayName}}</h1>
<span class="org-visibility">
{{if .Org.Visibility.IsLimited}}<span class="ui large horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
{{if .Org.Visibility.IsPrivate}}<span class="ui large horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
</span>
</div>
<span class="button-sequence tw-items-center tw-ml-auto tw-whitespace-nowrap">
{{if .IsSigned}}
{{template "org/follow_unfollow" .}}
{{end}}
{{if .IsOrganizationMember}}
<a class="secondary button" href="{{.OrgLink}}/dashboard">{{ctx.Locale.Tr "org.open_dashboard"}}</a>
{{end}}
{{$moderationEntryNeeded := and .IsModerationEnabled .IsSigned (not .IsOrganizationOwner)}}
{{if or .EnableFeed $moderationEntryNeeded}}
<details class="dropdown dir-rtl">
<summary class="border" data-tooltip-content="{{ctx.Locale.Tr "profile.actions.tooltip"}}">
{{svg "octicon-kebab-horizontal" 20}}
</summary>
<ul>
{{if .EnableFeed}}
<li>
<a href="{{.Org.HomeLink}}.rss">{{svg "octicon-rss"}}{{ctx.Locale.Tr "rss_feed"}}</a>
</li>
<li>
<a href="{{.Org.HomeLink}}.atom">{{svg "octicon-rss"}}{{ctx.Locale.Tr "feed.atom.link"}}</a>
</li>
{{end}}
{{if $moderationEntryNeeded}}
<li>
<a class="orange text" href="{{AppSubUrl}}/report_abuse?type=org&id={{$.Org.ID}}">{{svg "octicon-stop"}}{{ctx.Locale.Tr "moderation.report_abuse"}}</a>
</li>
{{end}}
</ul>
</details>
{{end}}
</span>
</div>
{{if .RenderedDescription}}<div class="render-content markup">{{.RenderedDescription}}</div>{{end}}
<div class="text light meta tw-mt-1">
{{if .Org.Location}}<div class="flex-text-block">{{svg "octicon-location"}} <span>{{.Org.Location}}</span></div>{{end}}
{{if .Org.Website}}<div class="flex-text-block">{{svg "octicon-link"}} <a class="muted" target="_blank" rel="noopener noreferrer me" href="{{.Org.Website}}">{{.Org.Website}}</a></div>{{end}}
{{if .IsSigned}}
{{if .Org.Email}}<div class="flex-text-block">{{svg "octicon-mail"}} <a class="muted" href="mailto:{{.Org.Email}}">{{.Org.Email}}</a></div>{{end}}
{{end}}
</div>
</div>
</div>
{{template "org/menu" .}}