mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Fix color: closed PR was showing as purple instead of red
This commit is contained in:
parent
27d30f1a61
commit
5348e8b71a
4 changed files with 37 additions and 23 deletions
|
@ -93,6 +93,16 @@ func (issue *Issue) loadRepo(e Engine) (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
// GetPullRequest returns the issue pull request
|
||||
func (issue *Issue) GetPullRequest() (pr *PullRequest, err error) {
|
||||
if !issue.IsPull {
|
||||
return nil, fmt.Errorf("Issue is not a pull request")
|
||||
}
|
||||
|
||||
pr, err = getPullRequestByIssueID(x, issue.ID)
|
||||
return
|
||||
}
|
||||
|
||||
func (issue *Issue) loadAttributes(e Engine) (err error) {
|
||||
if err := issue.loadRepo(e); err != nil {
|
||||
return err
|
||||
|
@ -953,9 +963,9 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
|||
|
||||
switch opts.IsPull {
|
||||
case util.OptionalBoolTrue:
|
||||
sess.And("issue.is_pull=?",true)
|
||||
sess.And("issue.is_pull=?", true)
|
||||
case util.OptionalBoolFalse:
|
||||
sess.And("issue.is_pull=?",false)
|
||||
sess.And("issue.is_pull=?", false)
|
||||
}
|
||||
|
||||
sortIssuesSession(sess, opts.SortType)
|
||||
|
@ -1780,4 +1790,3 @@ func DeleteMilestoneByRepoID(repoID, id int64) error {
|
|||
}
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
|
|
|
@ -2726,17 +2726,16 @@ footer .ui.language .menu {
|
|||
.user.notification table tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
.user.notification .octicon-issue-opened,
|
||||
.user.notification .octicon-git-pull-request {
|
||||
.user.notification .octicon.green {
|
||||
color: #21ba45;
|
||||
}
|
||||
.user.notification .octicon-issue-closed {
|
||||
.user.notification .octicon.red {
|
||||
color: #d01919;
|
||||
}
|
||||
.user.notification .octicon-git-merge {
|
||||
.user.notification .octicon.purple {
|
||||
color: #a333c8;
|
||||
}
|
||||
.user.notification .octicon-pin {
|
||||
.user.notification .octicon.blue {
|
||||
color: #2185d0;
|
||||
}
|
||||
.dashboard {
|
||||
|
|
|
@ -99,17 +99,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
.octicon-issue-opened, .octicon-git-pull-request {
|
||||
color: #21ba45;
|
||||
}
|
||||
.octicon-issue-closed {
|
||||
color: #d01919;
|
||||
}
|
||||
.octicon-git-merge {
|
||||
color: #a333c8;
|
||||
}
|
||||
.octicon-pin {
|
||||
color: #2185d0;
|
||||
.octicon {
|
||||
&.green {
|
||||
color: #21ba45;
|
||||
}
|
||||
&.red {
|
||||
color: #d01919;
|
||||
}
|
||||
&.purple {
|
||||
color: #a333c8;
|
||||
}
|
||||
&.blue {
|
||||
color: #2185d0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,15 +40,19 @@
|
|||
<i class="blue octicon octicon-pin"></i>
|
||||
{{else if $issue.IsPull}}
|
||||
{{if $issue.IsClosed}}
|
||||
<i class="octicon octicon-git-merge"></i>
|
||||
{{if $issue.GetPullRequest.HasMerged}}
|
||||
<i class="purple octicon octicon-git-merge"></i>
|
||||
{{else}}
|
||||
<i class="red octicon octicon-git-pull-request"></i>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<i class="octicon octicon-git-pull-request"></i>
|
||||
<i class="green octicon octicon-git-pull-request"></i>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{if $issue.IsClosed}}
|
||||
<i class="octicon octicon-issue-closed"></i>
|
||||
<i class="red octicon octicon-issue-closed"></i>
|
||||
{{else}}
|
||||
<i class="octicon octicon-issue-opened"></i>
|
||||
<i class="green octicon octicon-issue-opened"></i>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</td>
|
||||
|
|
Loading…
Reference in a new issue