diff options
author | Lauris BH <lauris@nix.lv> | 2018-11-10 16:12:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-10 16:12:58 +0200 |
commit | 297e619074d8578866d207b44f00771d0bfc0bc0 (patch) | |
tree | 0ad471a5e03b90aef23eb3c6d2e82aafdc6e5664 /templates | |
parent | e9b984e1620317339c9ef6c29785fc50819e3e09 (diff) | |
download | gitea-297e619074d8578866d207b44f00771d0bfc0bc0.tar.gz gitea-297e619074d8578866d207b44f00771d0bfc0bc0.zip |
Fix file edit change preview functionality (#5300) (#5311)
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/editor/diff_preview.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/editor/edit.tmpl | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl index 06b4a2e830..b663e4e93d 100644 --- a/templates/repo/editor/diff_preview.tmpl +++ b/templates/repo/editor/diff_preview.tmpl @@ -3,9 +3,7 @@ <div class="file-body file-code code-view code-diff"> <table> <tbody> - {{with .File}} - {{template "repo/diff/section_unified" .}} - {{end}} + {{template "repo/diff/section_unified" dict "file" .File "root" $}} </tbody> </table> </div> diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index b08838cac8..82656d6557 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> {{if .IsNewFile}}{{.i18n.Tr "repo.editor.new_file"}}{{else}}{{.i18n.Tr "repo.editor.edit_file"}}{{end}}</a> {{if not .IsNewFile}} - <a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL | EscapePound}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "repo.release.preview"}}</a> + <a class="item" data-tab="preview" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL | EscapePound}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "preview"}}</a> <a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | EscapePound}}/{{.TreePath | EscapePound}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.editor.preview_changes"}}</a> {{end}} </div> |