Commit 6dcfc104 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Issue box restyle

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 27c3d529
...@@ -10,9 +10,61 @@ ...@@ -10,9 +10,61 @@
.issue-box { .issue-box {
color: #666; color: #666;
margin:20px 0; margin:20px 0;
background: #FAFAFA; background: #FFF;
border: 1px solid #EEE; border: 1px solid #EEE;
&.issue-box-closed {
border-color: #DA4E49;
.state {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
.state-label {
background: #DA4E49;
color: #FFF;
}
}
}
&.issue-box-merged {
border-color: #31708f;
.state {
background-color: #d9edf7;
border-color: #bce8f1;
color: #31708f;
.state-label {
background: #31708f;
color: #FFF;
}
}
}
&.issue-box-open {
border-color: #4A4;
.state {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
.state-label {
background: #4A4;
color: #FFF;
}
}
}
&.issue-box-expired {
border-color: #cea61b;
.state {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
.state-label {
background: #cea61b;
color: #FFF;
}
}
}
.control-group { .control-group {
margin-bottom: 0; margin-bottom: 0;
} }
...@@ -55,20 +107,5 @@ ...@@ -55,20 +107,5 @@
text-align: center; text-align: center;
text-shadow: none; text-shadow: none;
margin-right: 20px; margin-right: 20px;
&.state-label-blue {
background: #31708f;
color: #FFF;
}
&.state-label-green {
background: #4A4;
color: #FFF;
}
&.state-label-red {
background: #DA4E49;
color: #FFF;
}
} }
} }
...@@ -85,11 +85,15 @@ module IssuesHelper ...@@ -85,11 +85,15 @@ module IssuesHelper
options_from_collection_for_select(@project.milestones.active, 'id', 'title', object.milestone_id) options_from_collection_for_select(@project.milestones.active, 'id', 'title', object.milestone_id)
end end
def issue_alert_class(issue) def issue_box_class(item)
if issue.closed? if item.respond_to?(:expired?) && item.expired?
'alert-danger' 'issue-box-expired'
elsif item.respond_to?(:merged?) && item.merged?
'issue-box-merged'
elsif item.closed?
'issue-box-closed'
else else
'alert-success' 'issue-box-open'
end end
end end
end end
...@@ -42,14 +42,4 @@ module MergeRequestsHelper ...@@ -42,14 +42,4 @@ module MergeRequestsHelper
"Branches: #{@merge_request.source_branch} #{separator} #{@merge_request.target_branch}" "Branches: #{@merge_request.source_branch} #{separator} #{@merge_request.target_branch}"
end end
end end
def merge_request_alert_class(merge_request)
if merge_request.merged?
'alert-info'
elsif merge_request.closed?
'alert-danger'
else
'alert-success'
end
end
end end
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
= link_to project_milestone_path(@project, @issue.milestone) do = link_to project_milestone_path(@project, @issue.milestone) do
= @issue.milestone.title = @issue.milestone.title
.issue-box .issue-box{ class: issue_box_class(@issue) }
.state{ class: issue_alert_class(@issue) } .state
%span.state-label
- if @issue.closed? - if @issue.closed?
%span.state-label.state-label-red Closed Closed
- else - else
%span.state-label.state-label-green Open Open
%span.creator %span.creator
Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)}
......
.issue-box .issue-box{ class: issue_box_class(@merge_request) }
.state{ class: merge_request_alert_class(@merge_request) } .state
%span.state-label
- if @merge_request.merged? - if @merge_request.merged?
%span.state-label.state-label-blue
Merged Merged
- elsif @merge_request.closed? - elsif @merge_request.closed?
%span.state-label.state-label-red
Closed Closed
- else - else
%span.state-label.state-label-green
Open Open
%span.creator %span.creator
Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)}
......
...@@ -22,14 +22,15 @@ ...@@ -22,14 +22,15 @@
&larr; To milestones list &larr; To milestones list
.issue-box .issue-box{ class: issue_box_class(@milestone) }
.state .state
%span.state-label
- if @milestone.closed? - if @milestone.closed?
%span.state-label.state-label-red Closed Closed
- elsif @milestone.expired? - elsif @milestone.expired?
%span.state-label.state-label-red Expired Expired
- else - else
%span.state-label.state-label-green Open Open
%h4.title %h4.title
= gfm escape_once(@milestone.title) = gfm escape_once(@milestone.title)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment