diff options
author | Unknwon <u@gogs.io> | 2015-09-02 04:08:05 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-02 04:08:05 -0400 |
commit | 37e0cee8770fc4f14857e16eabe83ab7e93a0646 (patch) | |
tree | 2eacd8816cb783f208b2afd061d6162cfeafca0e /templates/repo | |
parent | 65e73c4ac63b4d8cb5cd1ec6077fa6085e46895c (diff) | |
download | gitea-37e0cee8770fc4f14857e16eabe83ab7e93a0646.tar.gz gitea-37e0cee8770fc4f14857e16eabe83ab7e93a0646.zip |
finish PR UI
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/view.tmpl | 18 | ||||
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 37 | ||||
-rw-r--r-- | templates/repo/pulls/commits.tmpl | 19 | ||||
-rw-r--r-- | templates/repo/pulls/compare.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/pulls/files.tmpl | 19 | ||||
-rw-r--r-- | templates/repo/pulls/tab_menu.tmpl | 17 |
6 files changed, 98 insertions, 22 deletions
diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index fe735ae106..dff8910b88 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -11,23 +11,7 @@ <div class="ui divider"></div> {{if .Issue.IsPull}} {{template "repo/issue/view_title" .}} - <div class="ui top attached pull tabular menu"> - <a class="item active" href="{{.RepoLink}}/pulls/{{.Issue.Index}}"> - <span class="octicon octicon-comment-discussion"></span> - {{$.i18n.Tr "repo.pulls.tab_conversation"}} - <span class="ui label">{{.Issue.NumComments}}</span> - </a> - <a class="item" href="{{.RepoLink}}/pulls/{{.Issue.Index}}/commits"> - <span class="octicon octicon-git-commit"></span> - {{$.i18n.Tr "repo.pulls.tab_commits"}} - <span class="ui label">{{.NumCommits}}</span> - </a> - <a class="item" href="{{.RepoLink}}/pulls/{{.Issue.Index}}/files"> - <span class="octicon octicon-diff"></span> - {{$.i18n.Tr "repo.pulls.tab_files"}} - <span class="ui label">{{.NumFiles}}</span> - </a> - </div> + {{template "repo/pulls/tab_menu" .}} <div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}"> {{template "repo/issue/view_content" .}} </div> diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 4ed7240d36..25811522b4 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -131,6 +131,43 @@ {{end}} + {{if .Issue.IsPull}} + <div class="comment merge box"> + <a class="avatar text {{if .Issue.IsClosed}}grey{{else if .Issue.PullRepo.CanAutoMerge}}green{{else}}red{{end}}"> + <span class="mega-octicon octicon-git-merge"></span> + </a> + <div class="content"> + <div class="ui merge segment"> + {{if .Issue.IsClosed}} + <div class="item text grey"> + {{$.i18n.Tr "repo.pulls.reopen_to_merge"}} + </div> + {{else if .Issue.PullRepo.CanAutoMerge}} + <div class="item text green"> + <span class="octicon octicon-check"></span> + {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}} + </div> + <div class="ui divider"></div> + <div> + <button class="ui green button"> + <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}} + </button> + </div> + {{else}} + <div class="item text red"> + <span class="octicon octicon-x"></span> + {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}} + </div> + <div class="item text grey"> + <span class="octicon octicon-info"></span> + {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}} + </div> + {{end}} + </div> + </div> + </div> + {{end}} + {{if .IsSigned}} <div class="comment form"> <a class="avatar" href="{{.SignedUser.HomeLink}}"> diff --git a/templates/repo/pulls/commits.tmpl b/templates/repo/pulls/commits.tmpl new file mode 100644 index 0000000000..851880383e --- /dev/null +++ b/templates/repo/pulls/commits.tmpl @@ -0,0 +1,19 @@ +{{template "base/head" .}} +<div class="repository view issue pull commits"> + {{template "repo/header" .}} + <div class="ui container"> + <div class="navbar"> + {{template "repo/issue/navbar" .}} + <div class="ui right"> + <a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + </div> + </div> + <div class="ui divider"></div> + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + <div class="ui bottom attached tab pull segment active"> + {{template "repo/commits_table" .}} + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index 219fe3a4e1..79f15730c8 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -1,5 +1,5 @@ {{template "base/head" .}} -<div class="repository compare pull"> +<div class="repository compare pull diff"> {{template "repo/header" .}} <div class="ui container"> <div class="sixteen wide column page grid"> @@ -11,13 +11,13 @@ <span class="octicon octicon-git-compare"></span> <div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}"> <div class="ui basic small button"> - <span class="text">base: {{$.BaseBranch}}</span> + <span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseBranch}}</span> <i class="dropdown icon"></i> </div> <div class="menu"> <div class="ui icon search input"> <i class="filter icon"></i> - <input name="search" placeholder="Filter branch..."> + <input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}..."> </div> <div class="scrolling menu"> {{range .Branches}} @@ -29,13 +29,13 @@ ... <div class="ui floating filter dropdown"> <div class="ui basic small button"> - <span class="text">compare: {{$.HeadBranch}}</span> + <span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadBranch}}</span> <i class="dropdown icon"></i> </div> <div class="menu"> <div class="ui icon search input"> <i class="filter icon"></i> - <input name="search" placeholder="Filter branch..."> + <input name="search" placeholder="{{.i18n.Tr "repo.pulls.filter_branch"}}..."> </div> <div class="scrolling menu"> {{range .HeadBranches}} diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl new file mode 100644 index 0000000000..1226944b41 --- /dev/null +++ b/templates/repo/pulls/files.tmpl @@ -0,0 +1,19 @@ +{{template "base/head" .}} +<div class="repository view issue pull files diff"> + {{template "repo/header" .}} + <div class="ui container"> + <div class="navbar"> + {{template "repo/issue/navbar" .}} + <div class="ui right"> + <a class="ui green button" href="{{$.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a> + </div> + </div> + <div class="ui divider"></div> + {{template "repo/issue/view_title" .}} + {{template "repo/pulls/tab_menu" .}} + <div class="ui bottom attached tab pull segment active"> + {{template "repo/diff_box" .}} + </div> + </div> +</div> +{{template "base/footer" .}}
\ No newline at end of file diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl new file mode 100644 index 0000000000..92453640cb --- /dev/null +++ b/templates/repo/pulls/tab_menu.tmpl @@ -0,0 +1,17 @@ +<div class="ui top attached pull tabular menu"> + <a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.RepoLink}}/pulls/{{.Issue.Index}}"> + <span class="octicon octicon-comment-discussion"></span> + {{$.i18n.Tr "repo.pulls.tab_conversation"}} + <span class="ui label">{{.Issue.NumComments}}</span> + </a> + <a class="item {{if .PageIsPullCommits}}active{{end}}" href="{{.RepoLink}}/pulls/{{.Issue.Index}}/commits"> + <span class="octicon octicon-git-commit"></span> + {{$.i18n.Tr "repo.pulls.tab_commits"}} + <span class="ui label">{{.NumCommits}}</span> + </a> + <a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.RepoLink}}/pulls/{{.Issue.Index}}/files"> + <span class="octicon octicon-diff"></span> + {{$.i18n.Tr "repo.pulls.tab_files"}} + <span class="ui label">{{.NumFiles}}</span> + </a> +</div>
\ No newline at end of file |