Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
6a18fd98
Commit
6a18fd98
authored
Feb 19, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'restyle/issue' into 'master'
Improve UI for Issue#show, MR#show pages
parents
b09610b5
ededfd2d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
112 additions
and
88 deletions
+112
-88
app/assets/stylesheets/generic/common.scss
app/assets/stylesheets/generic/common.scss
+7
-3
app/assets/stylesheets/generic/issue_box.scss
app/assets/stylesheets/generic/issue_box.scss
+10
-3
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+8
-0
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+10
-0
app/views/projects/issues/_issue_context.html.haml
app/views/projects/issues/_issue_context.html.haml
+9
-10
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+13
-12
app/views/projects/merge_requests/show/_context.html.haml
app/views/projects/merge_requests/show/_context.html.haml
+9
-10
app/views/projects/merge_requests/show/_mr_box.html.haml
app/views/projects/merge_requests/show/_mr_box.html.haml
+36
-23
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+0
-15
features/steps/project/project_merge_requests.rb
features/steps/project/project_merge_requests.rb
+4
-2
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+6
-10
No files found.
app/assets/stylesheets/generic/common.scss
View file @
6a18fd98
...
@@ -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
:
6
px
25px
;
padding
:
9
px
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
;
...
...
app/assets/stylesheets/generic/issue_box.scss
View file @
6a18fd98
...
@@ -17,26 +17,33 @@
...
@@ -17,26 +17,33 @@
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
.state
{
height
:
34px
;
border-bottom
:
1px
solid
#DDD
;
line-height
:
32px
;
}
.title
{
.title
{
font-size
:
22px
;
font-size
:
22px
;
font-weight
:
500
;
font-weight
:
500
;
line-height
:
1
.5
;
line-height
:
1
.5
;
margin
:
0
;
margin
:
0
;
color
:
#333
;
color
:
#333
;
padding-bottom
:
0
;
padding
:
15px
25px
;
}
}
.context
{
.context
{
border
:
none
;
border
:
none
;
border-top
:
1px
solid
#eee
;
border-top
:
1px
solid
#eee
;
padding
:
15px
25px
;
}
}
.description
{
.description
{
border-top
:
1px
solid
#eee
;
padding
:
0
25px
15px
25px
;
}
}
.title
,
.context
,
.description
{
.title
,
.context
,
.description
{
padding
:
15px
25px
;
.clearfix
{
.clearfix
{
margin
:
0
;
margin
:
0
;
}
}
...
...
app/helpers/issues_helper.rb
View file @
6a18fd98
...
@@ -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
app/helpers/merge_requests_helper.rb
View file @
6a18fd98
...
@@ -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
app/views/projects/issues/_issue_context.html.haml
View file @
6a18fd98
=
form_for
[
@project
,
@issue
],
remote:
true
,
html:
{
class:
'edit-issue inline-update'
}
do
|
f
|
=
form_for
[
@project
,
@issue
],
remote:
true
,
html:
{
class:
'edit-issue inline-update'
}
do
|
f
|
Created by
#{
link_to_member
(
@project
,
issue
.
author
)
}
%strong
.append-right-10
-
if
issue
.
assignee
Assignee:
\ and currently assigned to
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
project_users_select_tag
(
'issue[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
selected:
@issue
.
assignee_id
)
=
project_users_select_tag
(
'issue[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
selected:
@issue
.
assignee_id
)
-
elsif
issue
.
assignee
-
elsif
issue
.
assignee
=
link_to_member
(
@project
,
@issue
.
assignee
)
=
link_to_member
(
@project
,
@issue
.
assignee
)
-
else
None
.pull-right
.pull-right.hidden-sm.hidden-xs
%strong
.append-right-10
-
if
issue
.
milestone
Milestone:
-
milestone
=
issue
.
milestone
%cite
.cgray
Attached to milestone
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
),
{
include_blank:
"Select milestone (none):"
},
{
class:
'select2 select2-compact'
})
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
),
{
include_blank:
"Select milestone (none):"
},
{
class:
'select2 select2-compact'
})
=
hidden_field_tag
:issue_context
=
hidden_field_tag
:issue_context
=
f
.
submit
class:
'btn'
=
f
.
submit
class:
'btn'
-
elsif
issue
.
milestone
-
elsif
issue
.
milestone
=
link_to
issue
.
milestone
.
title
,
project_milestone_path
=
link_to
issue
.
milestone
.
title
,
project_milestone_path
-
else
None
app/views/projects/issues/show.html.haml
View file @
6a18fd98
%h3
.page-title
%h3
.page-title
Issue ##{@issue.iid}
Issue ##{@issue.iid}
%small
created
#{
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
.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
...
@@ -38,18 +30,27 @@
...
@@ -38,18 +30,27 @@
=
@issue
.
milestone
.
title
=
@issue
.
milestone
.
title
.issue-box
.issue-box
.state
{
class:
issue_alert_class
(
@issue
)
}
-
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
)
.context
%cite
.cgray
=
render
partial:
'issue_context'
,
locals:
{
issue:
@issue
}
-
if
@issue
.
description
.
present?
-
if
@issue
.
description
.
present?
.description
.description
.wiki
.wiki
=
preserve
do
=
preserve
do
=
markdown
@issue
.
description
=
markdown
@issue
.
description
.context
%cite
.cgray
=
render
partial:
'issue_context'
,
locals:
{
issue:
@issue
}
-
content_for
:note_actions
do
-
content_for
:note_actions
do
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
...
...
app/views/projects/merge_requests/show/_context.html.haml
View file @
6a18fd98
=
form_for
[
@project
,
@merge_request
],
remote:
true
,
html:
{
class:
'edit-merge_request inline-update'
}
do
|
f
|
=
form_for
[
@project
,
@merge_request
],
remote:
true
,
html:
{
class:
'edit-merge_request inline-update'
}
do
|
f
|
Created by
#{
link_to_member
(
@project
,
merge_request
.
author
)
}
%strong
.append-right-10
-
if
merge_request
.
assignee
Assignee:
\ and currently assigned to
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
=
project_users_select_tag
(
'merge_request[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
selected:
@merge_request
.
assignee_id
)
=
project_users_select_tag
(
'merge_request[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control'
,
selected:
@merge_request
.
assignee_id
)
-
elsif
merge_request
.
assignee
-
elsif
merge_request
.
assignee
=
link_to_member
(
@project
,
@merge_request
.
assignee
)
=
link_to_member
(
@project
,
@merge_request
.
assignee
)
-
else
None
.pull-right
.pull-right.hidden-sm.hidden-xs
%strong
.append-right-10
-
if
merge_request
.
milestone
Milestone:
-
milestone
=
merge_request
.
milestone
%cite
.cgray
Attached to milestone
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
),
{
include_blank:
"Select milestone (none):"
},
{
class:
'select2 select2-compact'
})
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
),
{
include_blank:
"Select milestone (none):"
},
{
class:
'select2 select2-compact'
})
=
hidden_field_tag
:merge_request_context
=
hidden_field_tag
:merge_request_context
=
f
.
submit
class:
'btn'
=
f
.
submit
class:
'btn'
-
elsif
merge_request
.
milestone
-
elsif
merge_request
.
milestone
=
link_to
merge_request
.
milestone
.
title
,
project_milestone_path
=
link_to
merge_request
.
milestone
.
title
,
project_milestone_path
-
else
None
app/views/projects/merge_requests/show/_mr_box.html.haml
View file @
6a18fd98
.issue-box
.issue-box
.state
{
class:
merge_request_alert_class
(
@merge_request
)
}
-
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
)
.context
%cite
.cgray
=
render
partial:
'projects/merge_requests/show/context'
,
locals:
{
merge_request:
@merge_request
}
-
if
@merge_request
.
description
.
present?
-
if
@merge_request
.
description
.
present?
.description
.description
.wiki
.wiki
=
preserve
do
=
preserve
do
=
markdown
@merge_request
.
description
=
markdown
@merge_request
.
description
-
if
@merge_request
.
closed?
.context
.description.alert-danger
%cite
.cgray
%span
=
render
partial:
'projects/merge_requests/show/context'
,
locals:
{
merge_request:
@merge_request
}
%i
.icon-remove
Closed by
#{
link_to_member
(
@project
,
@merge_request
.
closed_event
.
author
)
}
-
if
@merge_request
.
closed?
#{
time_ago_with_tooltip
(
@merge_request
.
closed_event
.
created_at
)
}
.
.alert.alert-info
-
if
@merge_request
.
merged?
%span
.description.alert-success
%i
.icon-remove
%span
Closed by
#{
link_to_member
(
@project
,
@merge_request
.
closed_event
.
author
)
}
%i
.icon-ok
#{
time_ago_with_tooltip
(
@merge_request
.
closed_event
.
created_at
)
}
.
Merged by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
)
}
-
if
@merge_request
.
merged?
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
.
.alert.alert-info
-
if
!
@closes_issues
.
empty?
&&
@merge_request
.
opened?
%span
.description.alert-info
%i
.icon-ok
%span
Merged by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
)
}
%i
.icon-ok
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
.
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
-
if
!
@closes_issues
.
empty?
&&
@merge_request
.
opened?
=
succeed
'.'
do
.alert.alert-info.alert-info
!=
gfm
(
@closes_issues
.
map
{
|
i
|
"#
#{
i
.
iid
}
"
}.
to_sentence
)
%span
%i
.icon-ok
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
=
succeed
'.'
do
!=
gfm
(
@closes_issues
.
map
{
|
i
|
"#
#{
i
.
iid
}
"
}.
to_sentence
)
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
6a18fd98
%h3
.page-title
%h3
.page-title
=
"Merge Request #
#{
@merge_request
.
iid
}
"
=
"Merge Request #
#{
@merge_request
.
iid
}
"
%small
created
#{
time_ago_with_tooltip
(
@merge_request
.
created_at
)
}
-
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
)
...
...
features/steps/project/project_merge_requests.rb
View file @
6a18fd98
...
@@ -55,7 +55,9 @@ class ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -55,7 +55,9 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I click link "Close"'
do
step
'I click link "Close"'
do
click_link
"Close"
within
'.page-title'
do
click_link
"Close"
end
end
end
step
'I submit new merge request "Wiki Feature"'
do
step
'I submit new merge request "Wiki Feature"'
do
...
@@ -163,7 +165,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
...
@@ -163,7 +165,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
end
step
'I should see merged request'
do
step
'I should see merged request'
do
within
'.
page-title
'
do
within
'.
issue-box
'
do
page
.
should
have_content
"Merged"
page
.
should
have_content
"Merged"
end
end
end
end
...
...
spec/features/issues_spec.rb
View file @
6a18fd98
...
@@ -186,7 +186,7 @@ describe "Issues" do
...
@@ -186,7 +186,7 @@ describe "Issues" do
find
(
'.edit-issue.inline-update #issue_assignee_id'
).
set
project
.
team
.
members
.
first
.
id
find
(
'.edit-issue.inline-update #issue_assignee_id'
).
set
project
.
team
.
members
.
first
.
id
click_button
'Update Issue'
click_button
'Update Issue'
page
.
should
have_content
"
currently assigned to
"
page
.
should
have_content
"
Assignee:
"
page
.
has_select?
(
'issue_assignee_id'
,
:selected
=>
project
.
team
.
members
.
first
.
name
)
page
.
has_select?
(
'issue_assignee_id'
,
:selected
=>
project
.
team
.
members
.
first
.
name
)
end
end
end
end
...
@@ -206,11 +206,9 @@ describe "Issues" do
...
@@ -206,11 +206,9 @@ describe "Issues" do
login_with
guest
login_with
guest
visit
project_issue_path
(
project
,
issue
)
visit
project_issue_path
(
project
,
issue
)
page
.
should
have_content
"currently assigned to
#{
issue
.
assignee
.
name
}
"
page
.
should
have_content
issue
.
assignee
.
name
end
end
end
end
end
end
describe
'update milestone from issue#show'
do
describe
'update milestone from issue#show'
do
...
@@ -225,17 +223,16 @@ describe "Issues" do
...
@@ -225,17 +223,16 @@ describe "Issues" do
find
(
'.edit-issue.inline-update'
).
select
(
milestone
.
title
,
from:
'issue_milestone_id'
)
find
(
'.edit-issue.inline-update'
).
select
(
milestone
.
title
,
from:
'issue_milestone_id'
)
click_button
'Update Issue'
click_button
'Update Issue'
page
.
should
have_content
"
Attached to m
ilestone"
page
.
should
have_content
"
M
ilestone"
page
.
has_select?
(
'issue_assignee_id'
,
:selected
=>
milestone
.
title
)
page
.
has_select?
(
'issue_assignee_id'
,
:selected
=>
milestone
.
title
)
end
end
end
end
context
'by unauthorized user'
do
context
'by unauthorized user'
do
let
(
:guest
)
{
create
(
:user
)
}
let
(
:guest
)
{
create
(
:user
)
}
before
:each
do
before
:each
do
project
.
team
<<
[
[
guest
]
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
issue
.
milestone
=
milestone
issue
.
milestone
=
milestone
issue
.
save
issue
.
save
end
end
...
@@ -245,8 +242,7 @@ describe "Issues" do
...
@@ -245,8 +242,7 @@ describe "Issues" do
login_with
guest
login_with
guest
visit
project_issue_path
(
project
,
issue
)
visit
project_issue_path
(
project
,
issue
)
page
.
should
have_content
milestone
.
title
page
.
should
have_content
"Attached to milestone
#{
milestone
.
title
}
"
end
end
end
end
end
end
...
@@ -258,4 +254,4 @@ describe "Issues" do
...
@@ -258,4 +254,4 @@ describe "Issues" do
def
last_issue
def
last_issue
all
(
"ul.issues-list li"
).
last
.
text
all
(
"ul.issues-list li"
).
last
.
text
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment