summaryrefslogtreecommitdiffstats
path: root/templates/repo/view_file.tmpl
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-28 04:56:41 -0700
committerUnknwon <u@gogs.io>2016-08-28 04:56:41 -0700
commit579e5e4fee59f01f8a438e7ef977f34fa5dba72c (patch)
treeeb949bc9c4a8024067ca1a81f47f1f2c8c48d002 /templates/repo/view_file.tmpl
parentba27d71abea437af2f0612a8960eea651ec2df59 (diff)
downloadgitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.tar.gz
gitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.zip
Web editor: disallow edit mirror repository
Diffstat (limited to 'templates/repo/view_file.tmpl')
-rw-r--r--templates/repo/view_file.tmpl20
1 files changed, 11 insertions, 9 deletions
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
index 5e1faf36ec..d0b793b0e7 100644
--- a/templates/repo/view_file.tmpl
+++ b/templates/repo/view_file.tmpl
@@ -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}}