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.

Improve file history UI and fix URL escaping bug (#27531)

Follow #27354

Major changes:

1. The `right aligned` in `<th class="one wide right aligned">` is a
no-op because it doesn't have any content
2. The `gt-df` in `<td class="sha gt-df">` was wrong, it causes UI
misalignment, a table cell shouldn't be "flex"
3. Use `gt-py-0` for `gt-pt-0 gt-pb-0`
4. Simplify the layout for buttons, because the `text right aligned` is
widely used and good enough, it doesn't make sense to introduce the
`<div class="gt-df gt-je">`
5. Escape the `$.FileName` correctly


Before:


![image](https://github.com/go-gitea/gitea/assets/2114189/eb2ced3f-1dad-4149-9ed2-aee4c0663621)

After:


![image](https://github.com/go-gitea/gitea/assets/2114189/08244b61-416b-4279-b495-029bc0a96f67)

authored by

wxiaoguang and committed by
GitHub
d1527dac 43632d9d

+7 -7
+7 -7
templates/repo/commits_list.tmpl
··· 6 6 <th class="two wide sha">SHA1</th> 7 7 <th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th> 8 8 <th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th> 9 - <th class="one wide right aligned"></th> 9 + <th class="one wide"></th> 10 10 </tr> 11 11 </thead> 12 12 <tbody class="commit-list"> ··· 25 25 {{$userName}} 26 26 {{end}} 27 27 </td> 28 - <td class="sha gt-df"> 28 + <td class="sha"> 29 29 {{$class := "ui sha label"}} 30 30 {{if .Signature}} 31 31 {{$class = (print $class " isSigned")}} ··· 76 76 {{else}} 77 77 <td class="text right aligned">{{TimeSince .Author.When ctx.Locale}}</td> 78 78 {{end}} 79 - <td class="gt-pt-0 gt-pb-0"> 80 - <div class="gt-df gt-je"> 81 - <button class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button> 82 - {{if $.FileName}}<a class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) $.FileName}}">{{svg "octicon-file-code"}}</a>{{end}} 83 - </div> 79 + <td class="text right aligned gt-py-0"> 80 + <button class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button> 81 + {{if $.FileName}} 82 + <a class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) (PathEscapeSegments $.FileName)}}">{{svg "octicon-file-code"}}</a> 83 + {{end}} 84 84 </td> 85 85 </tr> 86 86 {{end}}