Commit 88b8b15d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve UI for Issue/MR

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7e42084f
...@@ -88,11 +88,15 @@ pre.well-pre { ...@@ -88,11 +88,15 @@ pre.well-pre {
/** Big Labels **/ /** Big Labels **/
.state-label { .state-label {
font-size: 14px; font-size: 14px;
padding: 6px 25px; padding: 9px 25px;
text-align: center; text-align: center;
@include border-radius(4px);
text-shadow: none; text-shadow: none;
margin-left: 10px; margin-right: 20px;
&.state-label-blue {
background: #31708f;
color: #FFF;
}
&.state-label-green { &.state-label-green {
background: #4A4; background: #4A4;
......
...@@ -17,11 +17,10 @@ ...@@ -17,11 +17,10 @@
margin-bottom: 0; margin-bottom: 0;
} }
.creator { .state {
padding: 8px 25px; height: 34px;
background: #eee;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
color: #777; line-height: 32px;
} }
.title { .title {
......
...@@ -84,4 +84,12 @@ module IssuesHelper ...@@ -84,4 +84,12 @@ module IssuesHelper
def milestone_options object def milestone_options object
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)
if issue.closed?
'alert-danger'
else
'alert-success'
end
end
end end
...@@ -41,4 +41,14 @@ module MergeRequestsHelper ...@@ -41,4 +41,14 @@ 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
%h3.page-title %h3.page-title
Issue ##{@issue.iid} Issue ##{@issue.iid}
- if @issue.closed?
%span.state-label.state-label-red Closed
- else
%span.state-label.state-label-green Open
%span.pull-right %span.pull-right
- if can?(current_user, :write_issue, @project) - if can?(current_user, :write_issue, @project)
= link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do = link_to new_project_issue_path(@project), class: "btn grouped", title: "New Issue", id: "new_issue_link" do
...@@ -35,8 +30,14 @@ ...@@ -35,8 +30,14 @@
= @issue.milestone.title = @issue.milestone.title
.issue-box .issue-box
.creator .state{ class: issue_alert_class(@issue) }
Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} - if @issue.closed?
%span.state-label.state-label-red Closed
- else
%span.state-label.state-label-green Open
%span.creator
Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)}
%h4.title %h4.title
= gfm escape_once(@issue.title) = gfm escape_once(@issue.title)
......
.issue-box .issue-box
.creator .state{ class: merge_request_alert_class(@merge_request) }
Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} - if @merge_request.merged?
%span.state-label.state-label-blue
Merged
- elsif @merge_request.closed?
%span.state-label.state-label-red
Closed
- else
%span.state-label.state-label-green
Open
%span.creator
Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)}
%h4.title %h4.title
= gfm escape_once(@merge_request.title) = gfm escape_once(@merge_request.title)
...@@ -16,13 +26,13 @@ ...@@ -16,13 +26,13 @@
= markdown @merge_request.description = markdown @merge_request.description
- if @merge_request.closed? - if @merge_request.closed?
.description.alert-danger .description
%span %span
%i.icon-remove %i.icon-remove
Closed by #{link_to_member(@project, @merge_request.closed_event.author)} Closed by #{link_to_member(@project, @merge_request.closed_event.author)}
#{time_ago_with_tooltip(@merge_request.closed_event.created_at)}. #{time_ago_with_tooltip(@merge_request.closed_event.created_at)}.
- if @merge_request.merged? - if @merge_request.merged?
.description.alert-success .description
%span %span
%i.icon-ok %i.icon-ok
Merged by #{link_to_member(@project, @merge_request.merge_event.author)} Merged by #{link_to_member(@project, @merge_request.merge_event.author)}
......
%h3.page-title %h3.page-title
= "Merge Request ##{@merge_request.iid}" = "Merge Request ##{@merge_request.iid}"
- if @merge_request.merged?
%span.state-label.state-label-green
%i.icon-ok
Merged
- elsif @merge_request.closed?
%span.state-label.state-label-red
Closed
- else
%span.state-label.state-label-green
Open
%span.pull-right %span.pull-right
- if can?(current_user, :modify_merge_request, @merge_request) - if can?(current_user, :modify_merge_request, @merge_request)
- if @merge_request.opened? - if @merge_request.opened?
......
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