mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-18 12:17:19 +01:00
Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (#36384)
This commit is contained in:
parent
65422fde4d
commit
393c854f7b
@ -105,7 +105,7 @@
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.zip?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "ZIP"}}</a>
|
||||
<a class="item muted archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefFullName.ShortName}}.tar.gz?path={{PathEscapeSegments .TreePath}}" rel="nofollow">{{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "TAR.GZ"}}</a>
|
||||
{{end}}
|
||||
{{if and (.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (not .Repository.IsArchived) (not $isTreePathRoot)}}
|
||||
{{if and (.Repository.CanContentChange) (not $isTreePathRoot)}}
|
||||
<div class="divider"></div>
|
||||
<a class="item tw-text-danger" href="{{.RepoLink}}/_delete/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
|
||||
{{svg "octicon-trash" 16}}{{ctx.Locale.Tr "repo.editor.delete_this_directory"}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user