forked from forgejo/forgejo
Use project.IconName
instead of repeated unreadable if-else
chains (#23538)
The project type will be changed in https://github.com/go-gitea/gitea/pull/23353, so the old fix https://github.com/go-gitea/gitea/pull/23325 will not work as well. And I also found that there were some problems in the old fix.... --------- Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
0206882e8a
commit
1a4efa0ee9
7 changed files with 24 additions and 23 deletions
|
@ -196,8 +196,7 @@
|
|||
</div>
|
||||
{{range .OpenProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -208,8 +207,7 @@
|
|||
</div>
|
||||
{{range .ClosedProjects}}
|
||||
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Title}}
|
||||
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
@ -220,8 +218,7 @@
|
|||
<div class="selected">
|
||||
{{if .Issue.ProjectID}}
|
||||
<a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}">
|
||||
{{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
|
||||
{{.Issue.Project.Title}}
|
||||
{{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}}
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue