mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-15 23:40:58 +02:00
Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission
This commit is contained in:
parent
4a9ac53862
commit
43ed2000f5
@ -100,9 +100,9 @@
|
||||
<a class="item" data-clipboard-text="{{.Repository.Link}}/src/commit/{{.CommitID}}/{{PathEscapeSegments .TreePath}}" data-clipboard-text-type="url">
|
||||
{{svg "octicon-link" 16}}{{ctx.Locale.Tr "repo.file_copy_permalink"}}
|
||||
</a>
|
||||
{{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}}">
|
||||
<a class="item tw-text-danger{{if not (.Permission.CanWrite ctx.Consts.RepoUnitTypeCode)}} disabled{{end}}" href="{{.RepoLink}}/_delete/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
|
||||
{{svg "octicon-trash" 16}}{{ctx.Locale.Tr "repo.editor.delete_this_directory"}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user