summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-02 09:26:56 -0400
committerUnknwon <u@gogs.io>2015-09-02 09:26:56 -0400
commit953bb06857f59f5c6987f68a08a94cf5a885b456 (patch)
tree196a45fa4e7f8808b35790981eb0e417bbfa1a61 /templates
parent6ea28f2a4759c5192811b12de054e7ad62f080f6 (diff)
downloadgitea-953bb06857f59f5c6987f68a08a94cf5a885b456.tar.gz
gitea-953bb06857f59f5c6987f68a08a94cf5a885b456.zip
basic PR feature
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl4
-rw-r--r--templates/repo/issue/view_content.tmpl60
-rw-r--r--templates/repo/issue/view_title.tmpl14
-rw-r--r--templates/repo/pulls/tab_menu.tmpl8
4 files changed, 53 insertions, 33 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index 72d30fd72e..0be1b84de7 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -11,11 +11,11 @@
<ul id="repo-file-nav" class="clear menu menu-line">
{{if and .IsRepositoryAdmin .Repository.BaseRepo}}
{{ $baseRepo := .Repository.BaseRepo}}
- <!-- <li>
+ <li>
<a href="{{AppSubUrl}}/{{$baseRepo.Owner.Name}}/{{$baseRepo.Name}}/compare/{{$.BaseDefaultBranch}}...{{$.Owner.Name}}:{{$.BranchName}}">
<button class="btn btn-green btn-small btn-radius" id="repo-compare-btn"><i class="octicon octicon-git-compare"></i></button>
</a>
- </li> -->
+ </li>
{{end}}
<li id="repo-branch-switch" class="down drop">
<a>
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 68838a12f5..8307c835b8 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -133,28 +133,40 @@
{{if .Issue.IsPull}}
<div class="comment merge box">
- <a class="avatar text {{if .Issue.IsClosed}}grey{{else if .Issue.CanAutoMerge}}green{{else}}red{{end}}">
+ <a class="avatar text {{if .Issue.HasMerged}}purple{{else if .Issue.IsClosed}}grey{{else if and .Issue.CanAutoMerge (not .IsPullReuqestBroken)}}green{{else}}red{{end}}">
<span class="mega-octicon octicon-git-merge"></span>
</a>
<div class="content">
<div class="ui merge segment">
- {{if .Issue.IsClosed}}
+ {{if .Issue.HasMerged}}
+ <div class="item text purple">
+ {{$.i18n.Tr "repo.pulls.has_merged"}}
+ </div>
+ {{else if .Issue.IsClosed}}
<div class="item text grey">
{{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
</div>
- {{else if .Issue.CanAutoMerge}}
- <div class="item text green">
- <span class="octicon octicon-check"></span>
- {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}}
- </div>
- {{if .IsRepositoryAdmin}}
- <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>
+ {{else if .IsPullReuqestBroken}}
+ <div class="item text red">
+ <span class="octicon octicon-x"></span>
+ {{$.i18n.Tr "repo.pulls.data_borken"}}
</div>
- {{end}}
+ {{else if .Issue.CanAutoMerge}}
+ <div class="item text green">
+ <span class="octicon octicon-check"></span>
+ {{$.i18n.Tr "repo.pulls.can_auto_merge_desc"}}
+ </div>
+ {{if .IsRepositoryAdmin}}
+ <div class="ui divider"></div>
+ <div>
+ <form class="ui form" action="{{.Link}}/merge" method="post">
+ {{.CsrfTokenHtml}}
+ <button class="ui green button">
+ <span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}}
+ </button>
+ </form>
+ </div>
+ {{end}}
{{else}}
<div class="item text red">
<span class="octicon octicon-x"></span>
@@ -181,16 +193,16 @@
{{.CsrfTokenHtml}}
<input id="status" name="status" type="hidden">
<div class="text right">
- {{if .IsIssueOwner}}
- {{if .Issue.IsClosed}}
- <div id="status-button" class="ui green basic button" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
- {{.i18n.Tr "repo.issues.reopen_issue"}}
- </div>
- {{else}}
- <div id="status-button" class="ui red basic button" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
- {{.i18n.Tr "repo.issues.close_issue"}}
- </div>
- {{end}}
+ {{if and .IsIssueOwner (not .DisableStatusChange)}}
+ {{if .Issue.IsClosed}}
+ <div id="status-button" class="ui green basic button" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
+ {{.i18n.Tr "repo.issues.reopen_issue"}}
+ </div>
+ {{else}}
+ <div id="status-button" class="ui red basic button" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
+ {{.i18n.Tr "repo.issues.close_issue"}}
+ </div>
+ {{end}}
{{end}}
<button class="ui green button">
{{.i18n.Tr "repo.issues.create_comment"}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index 27ce4d6c60..ef6e4f8c1c 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -16,15 +16,23 @@
</div>
{{end}}
</div>
- {{if .Issue.IsClosed}}
+ {{if .HasMerged}}
+ <div class="ui purple large label"><i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls.merged"}}</div>
+ {{else if .Issue.IsClosed}}
<div class="ui red large label"><i class="octicon octicon-issue-closed"></i> {{.i18n.Tr "repo.issues.closed_title"}}</div>
{{else}}
<div class="ui green large label"><i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues.open_title"}}</div>
{{end}}
{{if .Issue.IsPull}}
- <a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
- <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>
+ {{if .Issue.HasMerged}}
+ {{ $mergedStr:= TimeSince .Issue.Merged $.Lang }}
+ <a {{if gt .Issue.Merger.Id 0}}href="{{.Issue.Merger.HomeLink}}"{{end}}>{{.Issue.Merger.Name}}</a>
+ <span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span>
+ {{else}}
+ <a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
+ <span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>
+ {{end}}
{{else}}
{{ $createdStr:= TimeSince .Issue.Created $.Lang }}
<span class="time-desc">
diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl
index 92453640cb..0023cd29e4 100644
--- a/templates/repo/pulls/tab_menu.tmpl
+++ b/templates/repo/pulls/tab_menu.tmpl
@@ -4,14 +4,14 @@
{{$.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">
+ <a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.RepoLink}}/pulls/{{.Issue.Index}}/commits"{{end}}>
<span class="octicon octicon-git-commit"></span>
{{$.i18n.Tr "repo.pulls.tab_commits"}}
- <span class="ui label">{{.NumCommits}}</span>
+ <span class="ui label">{{if .NumCommits}}{{.NumCommits}}{{else}}N/A{{end}}</span>
</a>
- <a class="item {{if .PageIsPullFiles}}active{{end}}" href="{{.RepoLink}}/pulls/{{.Issue.Index}}/files">
+ <a class="item {{if .PageIsPullFiles}}active{{end}}" {{if .NumFiles}}href="{{.RepoLink}}/pulls/{{.Issue.Index}}/files"{{end}}>
<span class="octicon octicon-diff"></span>
{{$.i18n.Tr "repo.pulls.tab_files"}}
- <span class="ui label">{{.NumFiles}}</span>
+ <span class="ui label">{{if .NumFiles}}{{.NumFiles}}{{else}}N/A{{end}}</span>
</a>
</div> \ No newline at end of file