Fix incorrect project links and use symlink icon for org-wide projects (#23325)

Fix displaying same projects icons between user/repo projects.
And fix incorrect projects links.
A part of https://github.com/go-gitea/gitea/pull/22865.


![image](https://user-images.githubusercontent.com/18380374/223044279-7b620ff1-d88a-4146-97e6-531bbf269761.png)

![image](https://user-images.githubusercontent.com/18380374/223044390-42911e3f-1f6b-439f-8441-4f3ebf99ea13.png)

![image](https://user-images.githubusercontent.com/18380374/223044437-5cad5391-0f95-4c8b-b0a3-32e263e2854f.png)
This commit is contained in:
yp05327 2023-03-07 01:32:56 +09:00 committed by GitHub
parent 471b6d24b4
commit 3f547c7afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View File

@ -4,7 +4,7 @@
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}} {{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
</a> </a>
<a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects"> <a class="{{if .PageIsViewProjects}}active {{end}}item" href="{{$.Org.HomeLink}}/-/projects">
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}} {{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
</a> </a>
{{if .IsPackageEnabled}} {{if .IsPackageEnabled}}
<a class="item" href="{{$.Org.HomeLink}}/-/packages"> <a class="item" href="{{$.Org.HomeLink}}/-/packages">

View File

@ -12,7 +12,7 @@
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="ui compact tiny menu"> <div class="ui compact tiny menu">
<a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open"> <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open">
{{svg "octicon-project" 16 "gt-mr-3"}} {{svg "octicon-project-symlink" 16 "gt-mr-3"}}
{{JsPrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}} {{JsPrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
</a> </a>
<a class="item{{if .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=closed"> <a class="item{{if .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=closed">
@ -38,7 +38,7 @@
<div class="milestone list"> <div class="milestone list">
{{range .Projects}} {{range .Projects}}
<li class="item"> <li class="item">
{{svg "octicon-project"}} <a href="{{$.Link}}/{{.ID}}">{{.Title}}</a> {{svg "octicon-project-symlink"}} <a href="{{.Link}}">{{.Title}}</a>
<div class="meta"> <div class="meta">
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
{{if .IsClosed}} {{if .IsClosed}}

View File

@ -176,8 +176,8 @@
{{.locale.Tr "repo.issues.new.open_projects"}} {{.locale.Tr "repo.issues.new.open_projects"}}
</div> </div>
{{range .OpenProjects}} {{range .OpenProjects}}
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{$.RepoLink}}/projects/{{.ID}}"> <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
{{svg "octicon-project" 18 "gt-mr-3"}} {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
{{.Title}} {{.Title}}
</a> </a>
{{end}} {{end}}
@ -188,8 +188,8 @@
{{.locale.Tr "repo.issues.new.closed_projects"}} {{.locale.Tr "repo.issues.new.closed_projects"}}
</div> </div>
{{range .ClosedProjects}} {{range .ClosedProjects}}
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{$.RepoLink}}/projects/{{.ID}}"> <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
{{svg "octicon-project" 18 "gt-mr-3"}} {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
{{.Title}} {{.Title}}
</a> </a>
{{end}} {{end}}
@ -201,8 +201,8 @@
<span class="no-select item {{if .Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span> <span class="no-select item {{if .Project}}gt-hidden{{end}}">{{.locale.Tr "repo.issues.new.no_projects"}}</span>
<div class="selected"> <div class="selected">
{{if .Project}} {{if .Project}}
<a class="item muted sidebar-item-link" href="{{.RepoLink}}/projects/{{.Project.ID}}"> <a class="item muted sidebar-item-link" href="{{.Project.Link}}">
{{svg "octicon-project" 18 "gt-mr-3"}} {{if .IsOrganizationProject}}{{svg "octicon-project-symlink" 18 "gt-mr-3"}}{{else}}{{svg "octicon-project" 18 "gt-mr-3"}}{{end}}
{{.Project.Title}} {{.Project.Title}}
</a> </a>
{{end}} {{end}}

View File

@ -40,7 +40,7 @@
<div class="milestone list"> <div class="milestone list">
{{range .Projects}} {{range .Projects}}
<li class="item"> <li class="item">
{{svg "octicon-project"}} <a href="{{$.RepoLink}}/projects/{{.ID}}">{{.Title}}</a> {{svg "octicon-project"}} <a href="{{.Link}}">{{.Title}}</a>
<div class="meta"> <div class="meta">
{{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}} {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
{{if .IsClosed}} {{if .IsClosed}}

View File

@ -87,8 +87,8 @@
</a> </a>
{{end}} {{end}}
{{if .Project}} {{if .Project}}
<a class="project" {{if $.RepoLink}}href="{{$.RepoLink}}/projects/{{.Project.ID}}"{{else}}href="{{.Repo.Link}}/projects/{{.Project.ID}}"{{end}}> <a class="project" href="{{.Project.Link}}">
{{svg "octicon-project" 14 "gt-mr-2"}}{{.Project.Title}} {{if .Project.IsOrganizationProject}}{{svg "octicon-project-symlink" 14 "gt-mr-2"}}{{else}}{{svg "octicon-project" 14 "gt-mr-2"}}{{end}}{{.Project.Title}}
</a> </a>
{{end}} {{end}}
{{if .Ref}} {{if .Ref}}

View File

@ -23,7 +23,7 @@
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}} {{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
</a> </a>
<a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if .PageIsViewProjects}}active {{end}}item"> <a href="{{.ContextUser.HomeLink}}/-/projects" class="{{if .PageIsViewProjects}}active {{end}}item">
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}} {{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
</a> </a>
{{if (not .UnitPackagesGlobalDisabled)}} {{if (not .UnitPackagesGlobalDisabled)}}
<a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item"> <a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item">

View File

@ -107,7 +107,7 @@
{{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}} {{svg "octicon-repo"}} {{.locale.Tr "user.repositories"}}
</a> </a>
<a href="{{.Owner.HomeLink}}/-/projects" class="{{if eq .TabName "projects"}}active {{end}}item"> <a href="{{.Owner.HomeLink}}/-/projects" class="{{if eq .TabName "projects"}}active {{end}}item">
{{svg "octicon-project"}} {{.locale.Tr "user.projects"}} {{svg "octicon-project-symlink"}} {{.locale.Tr "user.projects"}}
</a> </a>
{{if .IsPackageEnabled}} {{if .IsPackageEnabled}}
<a class='{{if eq .TabName "packages"}}active {{end}}item' href="{{.Owner.HomeLink}}/-/packages"> <a class='{{if eq .TabName "packages"}}active {{end}}item' href="{{.Owner.HomeLink}}/-/packages">