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.

Fix long project name display in issue list and in related dropdown (#23653)

This PR is to fix the second problem mentioned in #23625, along with the
long texts problem in `issue-item-bottom-row` of `issuelist.tmpl`

Main changes are:
1. Add `max-width` to the search dropdowns in issue list and make the
possible long texts inside to show ellipsis if texts are long
2. Adjust the conditions in
[issuelist.tmpl](https://github.com/go-gitea/gitea/blob/1d35fa0e784dffcadacb2322a3d7ac3ec2ff89b2/templates/shared/issuelist.tmpl#L146-L167)
to fix the problem as mentioned by the
[comment](https://github.com/go-gitea/gitea/issues/23625#issuecomment-1479281060)
3. Use `word-break: break-word;` in `issue-item-bottom-row` to break the
possible long texts.

After the PR
issuelist in repo (similar for pr list):
<img width="366" alt="截屏2023-03-23 17 42 40"
src="https://user-images.githubusercontent.com/17645053/227163953-93e9adbd-5785-4c16-b538-9db901787775.png">

dropdowns with long name (Here take reference from github to deal with
the long names cases: show ellipsis with no title, because all these
options are clickable, and it might not be necessary to add titles to
them ):

<img width="370" alt="截屏2023-03-23 17 43 50"
src="https://user-images.githubusercontent.com/17645053/227164215-df6fcaaa-9fee-4256-a57c-053fbcffafbb.png">

<img width="365" alt="截屏2023-03-23 17 43 56"
src="https://user-images.githubusercontent.com/17645053/227164227-9c99abcd-f410-4e07-b5b8-cbce764eedcd.png">

issue page (similar for pr page):
<img width="374" alt="截屏2023-03-23 17 45 37"
src="https://user-images.githubusercontent.com/17645053/227164668-654a8188-dac8-4bbf-a6e3-f3768a644a1b.png">

on PC:
<img width="1412" alt="截屏2023-03-23 17 47 20"
src="https://user-images.githubusercontent.com/17645053/227166694-e7bcc6e5-9667-4cef-9fbf-db85640a2c6c.png">

<img width="1433" alt="截屏2023-03-23 17 46 40"
src="https://user-images.githubusercontent.com/17645053/227165182-4e2a5d19-74bc-4c66-b73c-23cbca176ffe.png">

authored by

Hester Gong and committed by
GitHub
a9cceb05 84daddc2

+20 -13
+4 -4
templates/repo/issue/list.tmpl
··· 99 99 {{.locale.Tr "repo.issues.new.open_projects"}} 100 100 </div> 101 101 {{range .OpenProjects}} 102 - <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> 103 - {{svg .IconName 18 "gt-mr-3"}}{{.Title}} 102 + <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}"> 103 + {{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span> 104 104 </a> 105 105 {{end}} 106 106 {{end}} ··· 131 131 </div> 132 132 <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a> 133 133 {{range .Posters}} 134 - <a class="{{if eq $.PosterID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{.ID}}"> 134 + <a class="{{if eq $.PosterID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{.ID}}"> 135 135 {{avatar $.Context .}}{{template "repo/search_name" .}} 136 136 </a> 137 137 {{end}} ··· 151 151 </div> 152 152 <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a> 153 153 {{range .Assignees}} 154 - <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> 154 + <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> 155 155 {{avatar $.Context .}}{{template "repo/search_name" .}} 156 156 </a> 157 157 {{end}}
+1 -1
templates/repo/search_name.tmpl
··· 1 - {{.Name}}{{if IsShowFullName}}<span class="search-fullname"> {{.FullName}}</span>{{end}} 1 + <span class="gt-ellipsis">{{.Name}}{{if IsShowFullName}}<span class="search-fullname"> {{.FullName}}</span>{{end}}</span>
+11 -7
templates/shared/issuelist.tmpl
··· 143 143 {{end}} 144 144 </div> 145 145 </div> 146 + {{if or .TotalTrackedTime .Assignees .NumComments}} 146 147 <div class="issue-item-icons-right gt-df gt-p-2"> 148 + {{if .TotalTrackedTime}} 147 149 <div class="issue-item-icon-right text grey"> 148 - {{if .TotalTrackedTime}} 149 150 {{svg "octicon-clock" 16 "gt-mr-2"}} 150 151 {{.TotalTrackedTime | Sec2Time}} 151 - {{end}} 152 152 </div> 153 + {{end}} 154 + {{if .Assignees}} 153 155 <div class="issue-item-icon-right text grey"> 154 156 {{range .Assignees}} 155 157 <a class="ui assignee tooltip gt-tdn" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-position="left center"> ··· 157 159 </a> 158 160 {{end}} 159 161 </div> 162 + {{end}} 163 + {{if .NumComments}} 160 164 <div class="issue-item-icon-right text grey"> 161 - {{if .NumComments}} 162 - <a class="gt-tdn muted" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> 163 - {{svg "octicon-comment" 16 "gt-mr-2"}}{{.NumComments}} 164 - </a> 165 - {{end}} 165 + <a class="gt-tdn muted" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}"> 166 + {{svg "octicon-comment" 16 "gt-mr-2"}}{{.NumComments}} 167 + </a> 166 168 </div> 169 + {{end}} 167 170 </div> 171 + {{end}} 168 172 </li> 169 173 {{end}} 170 174 {{if .IssueIndexerUnavailable}}
+1
web_src/css/helpers.css
··· 197 197 198 198 .gt-content-center { align-content: center !important; } 199 199 200 + .gt-shrink-0 { flex-shrink: 0 !important; } 200 201 .gt-whitespace-nowrap { white-space: nowrap !important; } 201 202 202 203 @media (max-width: 767px) {
+2 -1
web_src/css/repository.css
··· 143 143 144 144 .repository .filter.menu .menu { 145 145 max-height: 500px; 146 - overflow-x: auto; 146 + max-width: 300px; 147 + overflow-x: hidden; 147 148 right: 0 !important; 148 149 left: auto !important; 149 150 }
+1
web_src/css/shared/issuelist.css
··· 84 84 85 85 .issue.list > .item .desc a { 86 86 color: inherit; 87 + word-break: break-word; 87 88 } 88 89 89 90 .issue.list > .item .desc .time-since,