forked from forgejo/forgejo
Web editor: disallow edit mirror repository
This commit is contained in:
parent
ba27d71abe
commit
579e5e4fee
7 changed files with 36 additions and 25 deletions
|
@ -1 +1 @@
|
|||
0.9.91.0828
|
||||
0.9.92.0828
|
|
@ -33,18 +33,22 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="right fitted item">
|
||||
<div id="file-buttons" class="ui tiny buttons">
|
||||
{{if .CanAddFile}}
|
||||
<a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
|
||||
{{.i18n.Tr "repo.editor.new_file"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .UploadFileLink}}
|
||||
<!-- <a href="{{EscapePound .UploadFileLink}}" class="ui button nowrap">
|
||||
<i class="upload icon"></i> {{.i18n.Tr "repo.upload_file"}}
|
||||
</a> -->
|
||||
{{end}}
|
||||
</div>
|
||||
{{if .Repository.CanEnableEditor}}
|
||||
<div id="file-buttons" class="ui tiny buttons">
|
||||
{{if .CanAddFile}}
|
||||
<a href="{{.RepoLink}}/_new/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}" class="ui button">
|
||||
{{.i18n.Tr "repo.editor.new_file"}}
|
||||
</a>
|
||||
{{end}}
|
||||
{{if .UploadFileLink}}
|
||||
<!-- <a href="{{EscapePound .UploadFileLink}}" class="ui button nowrap">
|
||||
<i class="upload icon"></i> {{.i18n.Tr "repo.upload_file"}}
|
||||
</a> -->
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- Only show colne panel in repository home page -->
|
||||
{{if eq $n 0}}
|
||||
<div class="ui action small input" id="clone-panel">
|
||||
<button class="ui basic clone button" id="repo-clone-https" data-link="{{.CloneLink.HTTPS}}">
|
||||
|
|
|
@ -20,15 +20,17 @@
|
|||
<a class="ui button" href="{{.RepoLink}}/commits/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}">{{.i18n.Tr "repo.file_history"}}</a>
|
||||
<a class="ui button" href="{{EscapePound .FileLink}}">{{.i18n.Tr "repo.file_raw"}}</a>
|
||||
</div>
|
||||
{{if .CanEditFile}}
|
||||
<a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-pencil btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
||||
{{else}}
|
||||
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
{{end}}
|
||||
{{if .CanDeleteFile}}
|
||||
<a href="{{.RepoLink}}/_delete/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-trashcan btn-octicon btn-octicon-danger poping up" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
||||
{{else}}
|
||||
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
{{if .Repository.CanEnableEditor}}
|
||||
{{if .CanEditFile}}
|
||||
<a href="{{.RepoLink}}/_edit/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-pencil btn-octicon poping up" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
||||
{{else}}
|
||||
<i class="octicon octicon-pencil btn-octicon poping up disabled" data-content="{{.EditFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
{{end}}
|
||||
{{if .CanDeleteFile}}
|
||||
<a href="{{.RepoLink}}/_delete/{{EscapePound .BranchName}}/{{EscapePound .TreePath}}"><i class="octicon octicon-trashcan btn-octicon btn-octicon-danger poping up" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i></a>
|
||||
{{else}}
|
||||
<i class="octicon octicon-trashcan btn-octicon poping up disabled" data-content="{{.DeleteFileTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue