Commit 9114cfbb0a27c57d38c520384976cd9f770947df
Exists in
spb-stable
and in
3 other branches
Merge branch 'issue-improve-ui' into 'master'
Issue Improve Ui
Showing
6 changed files
with
83 additions
and
51 deletions
Show diff stats
app/assets/stylesheets/generic/issue_box.scss
... | ... | @@ -10,9 +10,61 @@ |
10 | 10 | .issue-box { |
11 | 11 | color: #666; |
12 | 12 | margin:20px 0; |
13 | - background: #FAFAFA; | |
13 | + background: #FFF; | |
14 | 14 | border: 1px solid #EEE; |
15 | 15 | |
16 | + &.issue-box-closed { | |
17 | + border-color: #DA4E49; | |
18 | + .state { | |
19 | + background-color: #f2dede; | |
20 | + border-color: #ebccd1; | |
21 | + color: #a94442; | |
22 | + .state-label { | |
23 | + background: #DA4E49; | |
24 | + color: #FFF; | |
25 | + } | |
26 | + } | |
27 | + } | |
28 | + | |
29 | + &.issue-box-merged { | |
30 | + border-color: #31708f; | |
31 | + .state { | |
32 | + background-color: #d9edf7; | |
33 | + border-color: #bce8f1; | |
34 | + color: #31708f; | |
35 | + .state-label { | |
36 | + background: #31708f; | |
37 | + color: #FFF; | |
38 | + } | |
39 | + } | |
40 | + } | |
41 | + | |
42 | + &.issue-box-open { | |
43 | + border-color: #4A4; | |
44 | + .state { | |
45 | + background-color: #dff0d8; | |
46 | + border-color: #d6e9c6; | |
47 | + color: #3c763d; | |
48 | + .state-label { | |
49 | + background: #4A4; | |
50 | + color: #FFF; | |
51 | + } | |
52 | + } | |
53 | + } | |
54 | + | |
55 | + &.issue-box-expired { | |
56 | + border-color: #cea61b; | |
57 | + .state { | |
58 | + background-color: #fcf8e3; | |
59 | + border-color: #faebcc; | |
60 | + color: #8a6d3b; | |
61 | + .state-label { | |
62 | + background: #cea61b; | |
63 | + color: #FFF; | |
64 | + } | |
65 | + } | |
66 | + } | |
67 | + | |
16 | 68 | .control-group { |
17 | 69 | margin-bottom: 0; |
18 | 70 | } |
... | ... | @@ -55,20 +107,5 @@ |
55 | 107 | text-align: center; |
56 | 108 | text-shadow: none; |
57 | 109 | margin-right: 20px; |
58 | - | |
59 | - &.state-label-blue { | |
60 | - background: #31708f; | |
61 | - color: #FFF; | |
62 | - } | |
63 | - | |
64 | - &.state-label-green { | |
65 | - background: #4A4; | |
66 | - color: #FFF; | |
67 | - } | |
68 | - | |
69 | - &.state-label-red { | |
70 | - background: #DA4E49; | |
71 | - color: #FFF; | |
72 | - } | |
73 | 110 | } |
74 | 111 | } | ... | ... |
app/helpers/issues_helper.rb
... | ... | @@ -85,11 +85,15 @@ module IssuesHelper |
85 | 85 | options_from_collection_for_select(@project.milestones.active, 'id', 'title', object.milestone_id) |
86 | 86 | end |
87 | 87 | |
88 | - def issue_alert_class(issue) | |
89 | - if issue.closed? | |
90 | - 'alert-danger' | |
88 | + def issue_box_class(item) | |
89 | + if item.respond_to?(:expired?) && item.expired? | |
90 | + 'issue-box-expired' | |
91 | + elsif item.respond_to?(:merged?) && item.merged? | |
92 | + 'issue-box-merged' | |
93 | + elsif item.closed? | |
94 | + 'issue-box-closed' | |
91 | 95 | else |
92 | - 'alert-success' | |
96 | + 'issue-box-open' | |
93 | 97 | end |
94 | 98 | end |
95 | 99 | end | ... | ... |
app/helpers/merge_requests_helper.rb
... | ... | @@ -42,14 +42,4 @@ module MergeRequestsHelper |
42 | 42 | "Branches: #{@merge_request.source_branch} #{separator} #{@merge_request.target_branch}" |
43 | 43 | end |
44 | 44 | end |
45 | - | |
46 | - def merge_request_alert_class(merge_request) | |
47 | - if merge_request.merged? | |
48 | - 'alert-info' | |
49 | - elsif merge_request.closed? | |
50 | - 'alert-danger' | |
51 | - else | |
52 | - 'alert-success' | |
53 | - end | |
54 | - end | |
55 | 45 | end | ... | ... |
app/views/projects/issues/show.html.haml
... | ... | @@ -29,12 +29,13 @@ |
29 | 29 | = link_to project_milestone_path(@project, @issue.milestone) do |
30 | 30 | = @issue.milestone.title |
31 | 31 | |
32 | -.issue-box | |
33 | - .state{ class: issue_alert_class(@issue) } | |
34 | - - if @issue.closed? | |
35 | - %span.state-label.state-label-red Closed | |
36 | - - else | |
37 | - %span.state-label.state-label-green Open | |
32 | +.issue-box{ class: issue_box_class(@issue) } | |
33 | + .state | |
34 | + %span.state-label | |
35 | + - if @issue.closed? | |
36 | + Closed | |
37 | + - else | |
38 | + Open | |
38 | 39 | |
39 | 40 | %span.creator |
40 | 41 | Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} | ... | ... |
app/views/projects/merge_requests/show/_mr_box.html.haml
1 | -.issue-box | |
2 | - .state{ class: merge_request_alert_class(@merge_request) } | |
3 | - - if @merge_request.merged? | |
4 | - %span.state-label.state-label-blue | |
1 | +.issue-box{ class: issue_box_class(@merge_request) } | |
2 | + .state | |
3 | + %span.state-label | |
4 | + - if @merge_request.merged? | |
5 | 5 | Merged |
6 | - - elsif @merge_request.closed? | |
7 | - %span.state-label.state-label-red | |
6 | + - elsif @merge_request.closed? | |
8 | 7 | Closed |
9 | - - else | |
10 | - %span.state-label.state-label-green | |
8 | + - else | |
11 | 9 | Open |
10 | + | |
12 | 11 | %span.creator |
13 | 12 | Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} |
14 | 13 | ... | ... |
app/views/projects/milestones/show.html.haml
... | ... | @@ -22,14 +22,15 @@ |
22 | 22 | ← To milestones list |
23 | 23 | |
24 | 24 | |
25 | -.issue-box | |
25 | +.issue-box{ class: issue_box_class(@milestone) } | |
26 | 26 | .state |
27 | - - if @milestone.closed? | |
28 | - %span.state-label.state-label-red Closed | |
29 | - - elsif @milestone.expired? | |
30 | - %span.state-label.state-label-red Expired | |
31 | - - else | |
32 | - %span.state-label.state-label-green Open | |
27 | + %span.state-label | |
28 | + - if @milestone.closed? | |
29 | + Closed | |
30 | + - elsif @milestone.expired? | |
31 | + Expired | |
32 | + - else | |
33 | + Open | |
33 | 34 | |
34 | 35 | %h4.title |
35 | 36 | = gfm escape_once(@milestone.title) | ... | ... |