aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-14 23:02:14 -0700
committerUnknwon <u@gogs.io>2016-08-14 23:52:24 -0700
commitcd89f6c5021ef129ecc4652aa620a3562ae30979 (patch)
treebf476d81479f249d5a1cfb195af2fdee3890d9a1 /templates
parent660e7a178a9d72a03d13f704aca61726b4672232 (diff)
downloadgitea-cd89f6c5021ef129ecc4652aa620a3562ae30979.tar.gz
gitea-cd89f6c5021ef129ecc4652aa620a3562ae30979.zip
Web editor: improve edit file and diff preview
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff_box.tmpl4
-rw-r--r--templates/repo/editor/diff_preview.tmpl (renamed from templates/repo/diff_preview.tmpl)0
-rw-r--r--templates/repo/editor/diff_preview_new.tmpl (renamed from templates/repo/diff_preview_new.tmpl)0
-rw-r--r--templates/repo/editor/edit.tmpl (renamed from templates/repo/edit.tmpl)21
4 files changed, 12 insertions, 13 deletions
diff --git a/templates/repo/diff_box.tmpl b/templates/repo/diff_box.tmpl
index a048ce6084..35af649b0f 100644
--- a/templates/repo/diff_box.tmpl
+++ b/templates/repo/diff_box.tmpl
@@ -71,9 +71,9 @@
{{if not $file.IsSubmodule}}
<div class="ui right">
{{if $file.IsDeleted}}
- <a class="ui basic tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
+ <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.BeforeSourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{else}}
- <a class="ui basic tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
+ <a class="ui basic grey tiny button" rel="nofollow" href="{{EscapePound $.SourcePath}}/{{EscapePound .Name}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
{{end}}
</div>
{{end}}
diff --git a/templates/repo/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl
index 1c4787a33c..1c4787a33c 100644
--- a/templates/repo/diff_preview.tmpl
+++ b/templates/repo/editor/diff_preview.tmpl
diff --git a/templates/repo/diff_preview_new.tmpl b/templates/repo/editor/diff_preview_new.tmpl
index 34abfe1823..34abfe1823 100644
--- a/templates/repo/diff_preview_new.tmpl
+++ b/templates/repo/editor/diff_preview_new.tmpl
diff --git a/templates/repo/edit.tmpl b/templates/repo/editor/edit.tmpl
index 49a3df7842..5e3349eaab 100644
--- a/templates/repo/edit.tmpl
+++ b/templates/repo/editor/edit.tmpl
@@ -2,11 +2,10 @@
<div class="repository file edit">
{{template "repo/header" .}}
<div class="ui container">
- {{.branchName}}
{{template "base/alert" .}}
<form class="ui edit form" action="{{EscapePound $.Link}}" method="post">
{{.CsrfTokenHtml}}
- <input type="hidden" name="last_commit" value="{{.LastCommit}}">
+ <input type="hidden" name="last_commit" value="{{.last_commit}}">
<div class="ui secondary menu">
<div class="item fitted" style="width:100%;">
<div class="ui breadcrumb field{{if .Err_Filename}} error{{end}}">
@@ -31,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="{{.PreviewDiffURL}}" 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}}"
@@ -53,26 +52,26 @@
<div class="commit-form">
<h3>{{.i18n.Tr "repo.commit_changes"}}</h3>
<div class="field">
- <input name="commit_summary" placeholder="{{if .IsNewFile}}{{.i18n.Tr "repo.add"}} '{{.TreeName}}/<filename>'{{else}}{{.i18n.Tr "repo.update"}} '{{.TreeName}}'{{end}}" value="{{.CommitSummary}}">
+ <input name="commit_summary" placeholder="{{if .IsNewFile}}{{.i18n.Tr "repo.add"}} '{{.TreeName}}/<filename>'{{else}}{{.i18n.Tr "repo.update"}} '{{.TreeName}}'{{end}}" value="{{.commit_summary}}">
</div>
<div class="field">
- <textarea name="commit_message" placeholder="{{.i18n.Tr "repo.default_commit_message"}}">{{.CommitMessage}}</textarea>
+ <textarea name="commit_message" placeholder="{{.i18n.Tr "repo.default_commit_message"}}">{{.commit_message}}</textarea>
</div>
- <div class="quick-pull-choice js-quick-pull-choice ">
+ <div class="quick-pull-choice js-quick-pull-choice">
<dl class="form-group">
<dd>
<div class="form-checkbox">
<label>
- <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct"{{if eq .CommitChoice "direct"}} checked="checked"{{end}}>
+ <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct"{{if eq .commit_choice "direct"}} checked="checked"{{end}}>
<i class="octicon octicon-git-commit" height="16" width="14"></i>
- {{.CommitDirectlyToThisBranch | Safe}}
+ {{.i18n.Tr "repo.editor.commit_directly_to_this_branch" .BranchName | Safe}}
</label>
</div>
<div class="form-checkbox">
<label>
- <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch"{{if eq .CommitChoice "commit-to-new-branch"}} checked="checked"{{end}}>
+ <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch"{{if eq .commit_choice "commit-to-new-branch"}} checked="checked"{{end}}>
<i class="octicon octicon-git-pull-request" height="16" width="12"></i>
- {{.CreateNewBranch | Safe}}
+ {{.i18n.Tr "repo.editor.create_new_branch" | Safe}}
</label>
</div>
</dd>
@@ -80,7 +79,7 @@
<div class="quick-pull-branch-name">
<div class="new-branch-name-input{{if .Err_Branchname}} error{{end}}">
<i class="octicon octicon-git-branch quick-pull-new-branch-icon" height="16" width="10"></i>
- <input type="text" name="new_branch_name" value="{{.NewBranchName}}" class="form-control input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="New branch name…">
+ <input type="text" name="new_branch_name" value="{{.new_branch_name}}" class="form-control input-contrast mr-2 js-quick-pull-new-branch-name" placeholder="New branch name…">
<span class="text-muted js-quick-pull-normalization-info"></span>
</div>
</div>