Skip to content

Commit 297e619

Browse files
authored
Fix file edit change preview functionality (#5300) (#5311)
1 parent e9b984e commit 297e619

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

templates/repo/editor/diff_preview.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
<div class="file-body file-code code-view code-diff">
44
<table>
55
<tbody>
6-
{{with .File}}
7-
{{template "repo/diff/section_unified" .}}
8-
{{end}}
6+
{{template "repo/diff/section_unified" dict "file" .File "root" $}}
97
</tbody>
108
</table>
119
</div>

templates/repo/editor/edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
3131
<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>
3232
{{if not .IsNewFile}}
33-
<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>
33+
<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>
3434
<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>
3535
{{end}}
3636
</div>

0 commit comments

Comments
 (0)