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.

Merge pull request 'Fixes for project selector in sidebar' (#2608) from 0ko/forgejo:projectsfix into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2608
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>

+50 -47
+50 -47
templates/repo/issue/view_content/sidebar.tmpl
··· 151 151 </div> 152 152 </div> 153 153 154 - {{if .IsProjectsEnabled}} 155 - <div class="divider"></div> 154 + <div class="divider"></div> 156 155 157 - <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown"> 158 - <a class="text muted flex-text-block"> 159 - <strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> 160 - {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} 161 - {{svg "octicon-gear" 16 "gt-ml-2"}} 156 + <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown"> 157 + <a class="text muted flex-text-block"> 158 + <strong>{{ctx.Locale.Tr "repo.issues.new.projects"}}</strong> 159 + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} 160 + {{svg "octicon-gear" 16 "gt-ml-2"}} 161 + {{end}} 162 + </a> 163 + <div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/projects"> 164 + {{if or .OpenProjects .ClosedProjects}} 165 + <div class="ui icon search input"> 166 + <i class="icon">{{svg "octicon-search" 16}}</i> 167 + <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}"> 168 + </div> 169 + {{end}} 170 + <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> 171 + {{if and (not .OpenProjects) (not .ClosedProjects)}} 172 + <div class="disabled item"> 173 + {{ctx.Locale.Tr "repo.issues.new.no_items"}} 174 + </div> 175 + {{end}} 176 + {{if .OpenProjects}} 177 + <div class="divider"></div> 178 + <div class="header"> 179 + {{ctx.Locale.Tr "repo.issues.new.open_projects"}} 180 + </div> 181 + {{range .OpenProjects}} 182 + <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> 183 + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} 184 + </a> 162 185 {{end}} 163 - </a> 164 - <div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/projects"> 165 - {{if or .OpenProjects .ClosedProjects}} 166 - <div class="ui icon search input"> 167 - <i class="icon">{{svg "octicon-search" 16}}</i> 168 - <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}"> 186 + {{end}} 187 + {{if .ClosedProjects}} 188 + <div class="divider"></div> 189 + <div class="header"> 190 + {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} 169 191 </div> 170 - {{end}} 171 - <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div> 172 - {{if .OpenProjects}} 173 - <div class="divider"></div> 174 - <div class="header"> 175 - {{ctx.Locale.Tr "repo.issues.new.open_projects"}} 176 - </div> 177 - {{range .OpenProjects}} 178 - <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> 179 - {{svg .IconName 18 "gt-mr-3"}}{{.Title}} 180 - </a> 181 - {{end}} 182 - {{end}} 183 - {{if .ClosedProjects}} 184 - <div class="divider"></div> 185 - <div class="header"> 186 - {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} 187 - </div> 188 - {{range .ClosedProjects}} 189 - <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> 190 - {{svg .IconName 18 "gt-mr-3"}}{{.Title}} 191 - </a> 192 - {{end}} 193 - {{end}} 194 - </div> 195 - </div> 196 - <div class="ui select-project list"> 197 - <span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> 198 - <div class="selected"> 199 - {{if .Issue.Project}} 200 - <a class="item muted sidebar-item-link" href="{{.Issue.Project.Link ctx}}"> 201 - {{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}} 192 + {{range .ClosedProjects}} 193 + <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> 194 + {{svg .IconName 18 "gt-mr-3"}}{{.Title}} 202 195 </a> 203 196 {{end}} 204 - </div> 197 + {{end}} 205 198 </div> 206 - {{end}} 199 + </div> 200 + <div class="ui select-project list"> 201 + <span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> 202 + <div class="selected"> 203 + {{if .Issue.Project}} 204 + <a class="item muted sidebar-item-link" href="{{.Issue.Project.Link ctx}}"> 205 + {{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}} 206 + </a> 207 + {{end}} 208 + </div> 209 + </div> 207 210 208 211 <div class="divider"></div> 209 212