diff options
author | Unknwon <u@gogs.io> | 2016-08-14 23:38:35 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-14 23:52:24 -0700 |
commit | 54e0ada9d53c28543a436d266dc73e759cc7658b (patch) | |
tree | adafc14fd67620258077d94e96579f47111e87b1 /templates/repo | |
parent | cd89f6c5021ef129ecc4652aa620a3562ae30979 (diff) | |
download | gitea-54e0ada9d53c28543a436d266dc73e759cc7658b.tar.gz gitea-54e0ada9d53c28543a436d266dc73e759cc7658b.zip |
Web editor: improve delete file
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/editor/edit.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/view_file.tmpl | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 5e3349eaab..f6e16ae7f7 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -30,7 +30,7 @@ <div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff"> <a class="active item" data-tab="write"><i class="octicon octicon-code"></i> {{.i18n.Tr "repo.edit_file"}}</a> <a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "repo.release.preview"}}</a> - <a class="item" data-tab="diff" data-url="{{.RepoLink}}/preview/{{.BranchName}}/{{.TreeName}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.preview_changes"}}</a> + <a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName}}/{{.TreeName}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.preview_changes"}}</a> </div> <div class="ui bottom attached active tab segment" data-tab="write"> <textarea id="edit_area" name="content" data-id="repo-{{.Repository.Name}}-{{.TreeName}}" diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0321dbd09b..5ddc3768fb 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -25,8 +25,8 @@ {{else}} <i class="octicon btn-octicon octicon-pencil poping up disabled" data-content="{{.FileEditLinkTooltip}}" data-position="bottom center" data-variation="tiny inverted"></i> {{end}} - {{if .FileDeleteLink}} - <form id="delete-file-form" class="ui form inline-form" action="{{EscapePound $.FileDeleteLink}}" method="post"> + {{if and .IsViewBranch .IsRepositoryWriter}} + <form id="delete-file-form" class="ui form inline-form" action="{{.RepoLink}}/_delete/{{EscapePound .BranchName}}/{{.TreeName}}" method="post"> {{.CsrfTokenHtml}} <button onclick="submitDeleteForm()" class="octicon octicon-trashcan btn-octicon btn-octicon-danger poping up" type="button" data-content="{{.FileDeleteLinkTooltip}}" data-position="bottom center" data-variation="tiny inverted"></button> <input type="hidden" id="delete-message" name="commit_message" value=""> |