Consistent place for state-label across issues, mr, milestones

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-12-19 21:00:44 +02:00
parent 3cdb8f26c9
commit d1aff25ca4
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
5 changed files with 45 additions and 33 deletions

View file

@ -106,13 +106,11 @@ pre.well-pre {
/** Big Labels **/
.state-label {
font-size: 14px;
padding: 5px 15px;
padding: 6px 25px;
text-align: center;
float: right;
position: relative;
top: -5px;
@include border-radius(4px);
text-shadow: none;
margin-left: 10px;
&.state-label-green {
background: #4A4;

View file

@ -5,6 +5,11 @@
created at
= @issue.created_at.stamp("Aug 21, 2011")
- if @issue.closed?
%span.state-label.state-label-red Closed
- else
%span.state-label.state-label-green Open
%span.pull-right
- 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
@ -36,10 +41,6 @@
.ui-box.ui-box-show
.ui-box-head
%h4.box-title
- if @issue.closed?
.state-label.state-label-red Closed
- else
.state-label.state-label-green Open
= gfm escape_once(@issue.title)
.ui-box-body

View file

@ -2,18 +2,11 @@
.ui-box-head
%h4.box-title
= gfm escape_once(@merge_request.title)
- if @merge_request.merged?
.state-label.state-label-green
%i.icon-ok
Merged
- elsif @merge_request.closed?
.state-label.state-label-red
Closed
.ui-box-body
%div
%cite.cgray
Created on #{@merge_request.created_at.stamp("Aug 21, 2011")} by #{link_to_member(@project, @merge_request.author)}.
Created by #{link_to_member(@project, @merge_request.author)}.
- if @merge_request.assignee
Currently assigned to #{link_to_member(@project, @merge_request.assignee)}.
- if @merge_request.milestone

View file

@ -1,16 +1,21 @@
%h3.page-title
= "Merge Request ##{@merge_request.iid}:"
&nbsp;
-if @merge_request.for_fork?
%span.label-branch
%span.label-project= truncate(@merge_request.source_project_path, length: 25)
#{@merge_request.source_branch}
&rarr;
%span.label-branch= @merge_request.target_branch
= "Merge Request ##{@merge_request.iid}"
%small
created at
= @merge_request.created_at.stamp("Aug 21, 2011")
- 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.label-branch= @merge_request.source_branch
&rarr;
%span.label-branch= @merge_request.target_branch
%span.state-label.state-label-green
Open
%span.pull-right
- if can?(current_user, :modify_merge_request, @merge_request)
@ -36,3 +41,16 @@
.back-link
= link_to project_merge_requests_path(@project) do
&larr; To merge requests
%span.prepend-left-20.monospace
-if @merge_request.for_fork?
%span
%strong
#{truncate(@merge_request.source_project_path, length: 25)}:
#{@merge_request.source_branch}
&rarr;
%span= @merge_request.target_branch
- else
%span= @merge_request.source_branch
&rarr;
%spanh= @merge_request.target_branch

View file

@ -3,15 +3,21 @@
Milestone ##{@milestone.iid}
%small
= @milestone.expires_at
- if @milestone.closed?
%span.state-label.state-label-red Closed
- elsif @milestone.expired?
%span.state-label.state-label-red Expired
- else
%span.state-label.state-label-green Open
.pull-right
- if can?(current_user, :admin_milestone, @project)
= link_to edit_project_milestone_path(@project, @milestone), class: "btn grouped" do
%i.icon-edit
Edit
- if @milestone.active?
= link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove"
= link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove grouped"
- else
= link_to 'Reopen Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn"
= link_to 'Reopen Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn grouped"
- if @milestone.issues.any? && @milestone.can_be_closed?
.alert.alert-success
@ -25,10 +31,6 @@
.ui-box.ui-box-show
.ui-box-head
%h4.box-title
- if @milestone.closed?
.state-label.state-label-red Closed
- elsif @milestone.expired?
.state-label.state-label-red Expired
= gfm escape_once(@milestone.title)