loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Apply switch redesign to more areas (#6542)

[skip ci] no relevant tests

Followup to https://codeberg.org/forgejo/forgejo/pulls/6459.

This PR applies the new switch design to areas where it is simple to apply and no other interventions are needed other than switching classes.

Also, added back the utility class `list-header-toggle` to a few places where it was removed in https://codeberg.org/forgejo/forgejo/pulls/6459. It is used for item reordering on smaller screens and it isn't actually needed in those areas (does nothing because of too wide elements), but it wasn't supposed to be removed.

The affected areas also include the menus in notifications. This is a followup to https://codeberg.org/forgejo/forgejo/pulls/3175 which should make the unchosen item look more obviously as an interactive element.

## Preview

|Area|Before|After|
|-|-|-|
|`projects/list.tmpl`|![](https://codeberg.org/attachments/e6977cbd-6fcc-400b-9f8a-1107b9ac5b54)|![](https://codeberg.org/attachments/8bd8ddb3-caf5-4f1b-aa3a-1942b9ea7f4a)|
|`repo/issue/navbar.tmp`||No visible change|
|`repo/issue/openclose.tmpl`||No visible change|
|`.../dashboard/issues.tmpl`|![](https://codeberg.org/attachments/5bc431aa-c522-4813-8d0f-b52e8c035dd0)|![](https://codeberg.org/attachments/a397be12-d8dc-434a-b109-2ba3521b36e6)|
|`.../dashboard/milestones.tmpl`|![](https://codeberg.org/attachments/211d76fc-c5e5-40f5-ade9-96e7bf56526e)|![](https://codeberg.org/attachments/760b0a3b-bd14-43ef-bb2b-21da426e91a3)|
|`.../notification_div.tmpl`|![](https://codeberg.org/attachments/822cfda7-e66d-47cf-9436-e20f392df2ce)|![](https://codeberg.org/attachments/07587fe5-454d-474c-8c39-e1331ff4deb5)|
|`.../notification_subscriptions.tmpl`|![](https://codeberg.org/attachments/960ac65a-f3a3-4385-b8fc-7bbf44c21bee)|![](https://codeberg.org/attachments/880bbcad-605b-4fbf-92e3-a0b270a40725)|

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6542
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>

authored by

0ko
0ko
and committed by
Otto
2ff408c8 333f384b

+7 -7
+1 -1
templates/projects/list.tmpl
··· 1 1 {{if and $.CanWriteProjects (not $.Repository.IsArchived)}} 2 2 <div class="tw-flex tw-justify-between tw-mb-4"> 3 - <div class="small-menu-items ui compact tiny menu list-header-toggle"> 3 + <div class="switch list-header-toggle"> 4 4 <a class="item{{if not .IsShowClosed}} active{{end}}" href="?state=open&q={{$.Keyword}}"> 5 5 {{svg "octicon-project-symlink" 16 "tw-mr-2"}} 6 6 {{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+1 -1
templates/repo/issue/navbar.tmpl
··· 1 - <div class="switch"> 1 + <div class="switch list-header-toggle"> 2 2 <a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a> 3 3 <a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a> 4 4 </div>
+1 -1
templates/repo/issue/openclose.tmpl
··· 1 - <div class="switch"> 1 + <div class="switch list-header-toggle"> 2 2 <a class="{{if eq .State "open"}}active {{end}}item" href="{{.OpenLink}}" data-test-name="open-issue-count"> 3 3 {{if .PageIsMilestones}} 4 4 {{svg "octicon-milestone" 16 "tw-mr-2"}}
+1 -1
templates/user/dashboard/issues.tmpl
··· 4 4 <div class="ui container"> 5 5 {{template "base/alert" .}} 6 6 <div class="list-header"> 7 - <div class="small-menu-items ui compact tiny menu list-header-toggle"> 7 + <div class="switch list-header-toggle"> 8 8 <a class="item{{if not .IsShowClosed}} active{{end}}" href="?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&q={{$.Keyword}}&fuzzy={{.IsFuzzy}}"> 9 9 {{svg "octicon-issue-opened" 16 "tw-mr-2"}} 10 10 {{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+1 -1
templates/user/dashboard/milestones.tmpl
··· 35 35 </div> 36 36 <div class="flex-container-main content"> 37 37 <div class="list-header"> 38 - <div class="small-menu-items ui compact tiny menu list-header-toggle"> 38 + <div class="switch list-header-toggle"> 39 39 <a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}"> 40 40 {{svg "octicon-milestone" 16 "tw-mr-2"}} 41 41 {{ctx.Locale.PrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
+1 -1
templates/user/notification/notification_div.tmpl
··· 2 2 <div class="ui container"> 3 3 {{$notificationUnreadCount := call .NotificationUnreadCount}} 4 4 <div class="tw-flex tw-items-center tw-justify-between tw-mb-4"> 5 - <div class="ui secondary partial menu"> 5 + <div class="switch"> 6 6 <a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread"> 7 7 {{ctx.Locale.Tr "notification.unread"}} 8 8 <div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}tw-hidden{{end}}">{{$notificationUnreadCount}}</div>
+1 -1
templates/user/notification/notification_subscriptions.tmpl
··· 2 2 <div role="main" aria-label="{{.Title}}" class="page-content user notification"> 3 3 <div class="ui container"> 4 4 <div class="tw-flex tw-items-center tw-justify-between tw-mb-4"> 5 - <div class="ui secondary partial menu"> 5 + <div class="switch"> 6 6 <a href="{{AppSubUrl}}/notifications/subscriptions" class="{{if eq .Status 1}}active {{end}}item"> 7 7 {{ctx.Locale.Tr "notification.subscriptions"}} 8 8 </a>