forgejo/templates/shared/user/actions_menu.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

49 lines
2 KiB
Go HTML Template

<details class="dropdown dir-auto">
<summary class="border" data-tooltip-content="{{ctx.Locale.Tr "profile.actions.tooltip"}}">
{{svg "octicon-kebab-horizontal"}}
</summary>
<ul>
{{if eq .SignedUserID .ContextUser.ID}}
<li>
<a href="{{AppSubUrl}}/user/settings">{{svg "octicon-pencil"}}{{ctx.Locale.Tr "profile.edit.link"}}</a>
</li>
{{end}}
{{if .IsAdmin}}
<li>
<a href="{{AppSubUrl}}/admin/users/{{.ContextUser.ID}}">{{svg "octicon-gear"}}{{ctx.Locale.Tr "admin.users.details"}}</a>
</li>
{{end}}
{{if and .EnableFeed (or .IsAdmin (eq .SignedUserID .ContextUser.ID) (not .ContextUser.KeepActivityPrivate))}}
<li>
<a href="{{.ContextUser.HomeLink}}.rss">{{svg "octicon-rss"}}{{ctx.Locale.Tr "rss_feed"}}</a>
</li>
<li>
<a href="{{.ContextUser.HomeLink}}.atom">{{svg "octicon-rss"}}{{ctx.Locale.Tr "feed.atom.link"}}</a>
</li>
{{end}}
<li>
<a href="{{.ContextUser.HomeLink}}.keys">{{svg "octicon-key"}}{{ctx.Locale.Tr "keys.ssh.link"}}</a>
</li>
<li>
<a href="{{.ContextUser.HomeLink}}.gpg">{{svg "octicon-key"}}{{ctx.Locale.Tr "keys.gpg.link"}}</a>
</li>
{{if and .IsSigned (ne .SignedUserID .ContextUser.ID)}}
<li hx-target="#profile-avatar-card" hx-indicator="#profile-avatar-card" id="action-block">
{{if .IsBlocked}}
<button class="orange text" hx-post="{{.ContextUser.HomeLink}}?action=unblock">
{{svg "octicon-person"}} {{ctx.Locale.Tr "user.unblock"}}
</button>
{{else}}
<button class="orange text" data-modal-id="block-user" hx-post="{{.ContextUser.HomeLink}}?action=block" hx-confirm="-">
{{svg "octicon-blocked"}} {{ctx.Locale.Tr "user.block"}}
</button>
{{end}}
</li>
{{end}}
{{if and .IsModerationEnabled .IsSigned (ne .SignedUserID .ContextUser.ID)}}
<li>
<a href="{{AppSubUrl}}/report_abuse?type=user&id={{.ContextUser.ID}}" class="orange text">{{svg "octicon-stop"}}{{ctx.Locale.Tr "moderation.report_abuse"}}</a>
</li>
{{end}}
</ul>
</details>