diff options
author | Unknwon <u@gogs.io> | 2016-08-28 04:31:42 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-28 04:31:42 -0700 |
commit | ba27d71abea437af2f0612a8960eea651ec2df59 (patch) | |
tree | 2e0d34def64d5eb4c91aebf5e9b6a8003138193b /routers | |
parent | 7115e3a4d578ec024f9acbc043e38326bff4117e (diff) | |
download | gitea-ba27d71abea437af2f0612a8960eea651ec2df59.tar.gz gitea-ba27d71abea437af2f0612a8960eea651ec2df59.zip |
Web editor: improve edit file
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/commit.go | 2 | ||||
-rw-r--r-- | routers/repo/editor.go | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index dca7b1f9f8..b9ced49ed2 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -20,7 +20,7 @@ import ( const ( COMMITS base.TplName = "repo/commits" - DIFF base.TplName = "repo/diff" + DIFF base.TplName = "repo/diff/page" ) func RefCommits(ctx *context.Context) { diff --git a/routers/repo/editor.go b/routers/repo/editor.go index e30b06c63f..4a82f291e8 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -22,7 +22,6 @@ import ( const ( EDIT_FILE base.TplName = "repo/editor/edit" EDIT_DIFF_PREVIEW base.TplName = "repo/editor/diff_preview" - NEW_DIFF_PREVIEW base.TplName = "repo/editor/diff_preview_new" DELETE_FILE base.TplName = "repo/editor/delete" ) @@ -289,15 +288,9 @@ func DiffPreviewPost(ctx *context.Context, form auth.EditPreviewDiffForm) { entry, err := ctx.Repo.Commit.GetTreeEntryByPath(treePath) if err != nil { - if git.IsErrNotExist(err) { - ctx.Data["FileContent"] = content - ctx.HTML(200, NEW_DIFF_PREVIEW) - } else { - ctx.Error(500, "GetTreeEntryByPath: "+err.Error()) - } + ctx.Error(500, "GetTreeEntryByPath: "+err.Error()) return - } - if entry.IsDir() { + } else if entry.IsDir() { ctx.Error(422) return } |