File tree Expand file tree Collapse file tree 4 files changed +37
-23
lines changed
templates/user/notification Expand file tree Collapse file tree 4 files changed +37
-23
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ func (issue *Issue) loadRepo(e Engine) (err error) {
93
93
return nil
94
94
}
95
95
96
+ // GetPullRequest returns the issue pull request
97
+ func (issue * Issue ) GetPullRequest () (pr * PullRequest , err error ) {
98
+ if ! issue .IsPull {
99
+ return nil , fmt .Errorf ("Issue is not a pull request" )
100
+ }
101
+
102
+ pr , err = getPullRequestByIssueID (x , issue .ID )
103
+ return
104
+ }
105
+
96
106
func (issue * Issue ) loadAttributes (e Engine ) (err error ) {
97
107
if err := issue .loadRepo (e ); err != nil {
98
108
return err
@@ -953,9 +963,9 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
953
963
954
964
switch opts .IsPull {
955
965
case util .OptionalBoolTrue :
956
- sess .And ("issue.is_pull=?" ,true )
966
+ sess .And ("issue.is_pull=?" , true )
957
967
case util .OptionalBoolFalse :
958
- sess .And ("issue.is_pull=?" ,false )
968
+ sess .And ("issue.is_pull=?" , false )
959
969
}
960
970
961
971
sortIssuesSession (sess , opts .SortType )
@@ -1780,4 +1790,3 @@ func DeleteMilestoneByRepoID(repoID, id int64) error {
1780
1790
}
1781
1791
return sess .Commit ()
1782
1792
}
1783
-
Original file line number Diff line number Diff line change @@ -2726,17 +2726,16 @@ footer .ui.language .menu {
2726
2726
.user .notification table tr {
2727
2727
cursor : pointer;
2728
2728
}
2729
- .user .notification .octicon-issue-opened ,
2730
- .user .notification .octicon-git-pull-request {
2729
+ .user .notification .octicon .green {
2731
2730
color : # 21ba45 ;
2732
2731
}
2733
- .user .notification .octicon-issue-closed {
2732
+ .user .notification .octicon . red {
2734
2733
color : # d01919 ;
2735
2734
}
2736
- .user .notification .octicon-git-merge {
2735
+ .user .notification .octicon . purple {
2737
2736
color : # a333c8 ;
2738
2737
}
2739
- .user .notification .octicon-pin {
2738
+ .user .notification .octicon . blue {
2740
2739
color : # 2185d0 ;
2741
2740
}
2742
2741
.dashboard {
Original file line number Diff line number Diff line change 99
99
}
100
100
}
101
101
102
- .octicon-issue-opened , .octicon-git-pull-request {
103
- color : #21ba45 ;
104
- }
105
- .octicon-issue-closed {
106
- color : #d01919 ;
107
- }
108
- .octicon-git-merge {
109
- color : #a333c8 ;
110
- }
111
- .octicon-pin {
112
- color : #2185d0 ;
102
+ .octicon {
103
+ & .green {
104
+ color : #21ba45 ;
105
+ }
106
+ & .red {
107
+ color : #d01919 ;
108
+ }
109
+ & .purple {
110
+ color : #a333c8 ;
111
+ }
112
+ & .blue {
113
+ color : #2185d0 ;
114
+ }
113
115
}
114
116
}
115
117
}
Original file line number Diff line number Diff line change 40
40
<i class="blue octicon octicon-pin"></i>
41
41
{{else if $issue.IsPull}}
42
42
{{if $issue.IsClosed}}
43
- <i class="octicon octicon-git-merge"></i>
43
+ {{if $issue.GetPullRequest.HasMerged}}
44
+ <i class="purple octicon octicon-git-merge"></i>
45
+ {{else}}
46
+ <i class="red octicon octicon-git-pull-request"></i>
47
+ {{end}}
44
48
{{else}}
45
- <i class="octicon octicon-git-pull-request"></i>
49
+ <i class="green octicon octicon-git-pull-request"></i>
46
50
{{end}}
47
51
{{else}}
48
52
{{if $issue.IsClosed}}
49
- <i class="octicon octicon-issue-closed"></i>
53
+ <i class="red octicon octicon-issue-closed"></i>
50
54
{{else}}
51
- <i class="octicon octicon-issue-opened"></i>
55
+ <i class="green octicon octicon-issue-opened"></i>
52
56
{{end}}
53
57
{{end}}
54
58
</td>
You can’t perform that action at this time.
0 commit comments