0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-06-01 08:52:26 +02:00

Optimize Layout Styles of Filelist (#33920)

Align items

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Kerwin Bryant 2025-03-19 00:59:33 +08:00 committed by GitHub
parent 1b4adc0255
commit dcbf6c2d13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 9 deletions

View File

@ -14,19 +14,21 @@
{{$entry := $item.Entry}} {{$entry := $item.Entry}}
{{$commit := $item.Commit}} {{$commit := $item.Commit}}
{{$submoduleFile := $item.SubmoduleFile}} {{$submoduleFile := $item.SubmoduleFile}}
<div class="repo-file-cell name {{if not $commit}}notready{{end}}"> <div class="repo-file-cell name muted-links {{if not $commit}}notready{{end}}">
{{ctx.RenderUtils.RenderFileIcon $entry}} {{ctx.RenderUtils.RenderFileIcon $entry}}
{{if $entry.IsSubModule}} {{if $entry.IsSubModule}}
{{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}} {{$submoduleLink := $submoduleFile.SubmoduleWebLink ctx}}
{{if $submoduleLink}} {{if $submoduleLink}}
<a class="muted" href="{{$submoduleLink.RepoWebLink}}">{{$entry.Name}}</a> <span class="at">@</span> <a href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a> <a class="entry-name" href="{{$submoduleLink.RepoWebLink}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
@ <a class="text primary" href="{{$submoduleLink.CommitWebLink}}">{{ShortSha $submoduleFile.RefID}}</a>
{{else}} {{else}}
{{$entry.Name}} <span class="at">@</span> {{ShortSha $submoduleFile.RefID}} <span class="entry-name" title="{{$entry.Name}}">{{$entry.Name}}</span>
@ {{ShortSha $submoduleFile.RefID}}
{{end}} {{end}}
{{else}} {{else}}
{{if $entry.IsDir}} {{if $entry.IsDir}}
{{$subJumpablePathName := $entry.GetSubJumpablePathName}} {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
<a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}"> <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
{{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}} {{$subJumpablePathFields := StringUtils.Split $subJumpablePathName "/"}}
{{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}} {{$subJumpablePathFieldLast := (Eval (len $subJumpablePathFields) "-" 1)}}
{{if eq $subJumpablePathFieldLast 0}} {{if eq $subJumpablePathFieldLast 0}}
@ -37,7 +39,7 @@
{{end}} {{end}}
</a> </a>
{{else}} {{else}}
<a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a> <a class="entry-name" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
{{end}} {{end}}
{{end}} {{end}}
</div> </div>

View File

@ -14,10 +14,6 @@
} }
} }
#repo-files-table .repo-file-cell.name .svg {
margin-right: 2px;
}
#repo-files-table .svg.octicon-file-directory-fill, #repo-files-table .svg.octicon-file-directory-fill,
#repo-files-table .svg.octicon-file-submodule { #repo-files-table .svg.octicon-file-submodule {
color: var(--color-primary); color: var(--color-primary);
@ -70,11 +66,25 @@
} }
#repo-files-table .repo-file-cell.name { #repo-files-table .repo-file-cell.name {
display: flex;
align-items: center;
gap: 0.5em;
overflow: hidden;
}
#repo-files-table .repo-file-cell.name > a,
#repo-files-table .repo-file-cell.name > span {
flex-shrink: 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
#repo-files-table .repo-file-cell.name .entry-name {
flex-shrink: 1;
min-width: 3em;
}
@media (max-width: 767.98px) { @media (max-width: 767.98px) {
#repo-files-table .repo-file-cell.name { #repo-files-table .repo-file-cell.name {
max-width: 35vw; max-width: 35vw;