0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-03-18 01:21:35 -05:00

fix(ui): improvements around folder download ()

Followup to 3c68399eb0.

* remove unneeded copy-pasted classes
* fix border radius
* avoid misuse of `.clone-panel` by extending the rule

Preview:
![](https://codeberg.org/attachments/f2add100-6f7c-4b84-bcab-be0fe19bb110)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7036
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
0ko 2025-02-23 18:46:55 +00:00
parent 1dd7b08f63
commit 8d8275caa8
2 changed files with 11 additions and 9 deletions
templates/repo
web_src/css

View file

@ -141,20 +141,20 @@
{{template "repo/cite/cite_modal" .}} {{template "repo/cite/cite_modal" .}}
{{end}} {{end}}
{{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}} {{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
<a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}"> <div class="button-row folder-actions">
{{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}} <a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
</a> {{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}}
{{if not $.DisableDownloadSourceArchives}} </a>
<div class="clone-panel ui action tiny input"> {{if not $.DisableDownloadSourceArchives}}
<button class="ui small jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}"> <button class="ui jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}">
{{svg "octicon-kebab-horizontal"}} {{svg "octicon-kebab-horizontal"}}
<div class="menu"> <div class="menu">
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments (printf "%s:%s" $.RefName .TreePath)}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_zip"}}</a> <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments (printf "%s:%s" $.RefName .TreePath)}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_zip"}}</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments (printf "%s:%s" $.RefName .TreePath)}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_tar"}}</a> <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments (printf "%s:%s" $.RefName .TreePath)}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.download_tar"}}</a>
</div> </div>
</button> </button>
</div> {{end}}
{{end}} </div>
{{end}} {{end}}
</div> </div>
</div> </div>

View file

@ -153,7 +153,9 @@
border-radius: 0 var(--border-radius) var(--border-radius) 0 !important; border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
} }
.repository .clone-panel .dropdown .menu { /* Dropdown alignment */
.repository .clone-panel .dropdown .menu,
.repository .folder-actions .dropdown .menu {
right: 0 !important; right: 0 !important;
left: auto !important; left: auto !important;
} }