basic PR feature
This commit is contained in:
parent
6ea28f2a47
commit
953bb06857
15 changed files with 387 additions and 94 deletions
|
@ -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>
|
||||
|
|
|
@ -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 .IsPullReuqestBroken}}
|
||||
<div class="item text red">
|
||||
<span class="octicon octicon-x"></span>
|
||||
{{$.i18n.Tr "repo.pulls.data_borken"}}
|
||||
</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>
|
||||
</div>
|
||||
{{end}}
|
||||
<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"}}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue