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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6f32ccf4
Commit
6f32ccf4
authored
Dec 13, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge_requests restyle with forms
parent
3a50b6ca
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
73 deletions
+130
-73
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+59
-25
app/assets/stylesheets/style.scss
app/assets/stylesheets/style.scss
+1
-1
app/models/project.rb
app/models/project.rb
+4
-0
app/views/merge_requests/_form.html.haml
app/views/merge_requests/_form.html.haml
+44
-34
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+19
-10
spec/requests/merge_requests_spec.rb
spec/requests/merge_requests_spec.rb
+3
-3
No files found.
app/assets/stylesheets/projects.css.scss
View file @
6f32ccf4
...
@@ -555,44 +555,78 @@ h4.middle-panel {
...
@@ -555,44 +555,78 @@ h4.middle-panel {
.merge-tabs
{
.merge-tabs
{
margin
:
0
;
margin
:
0
;
border
:
1px
solid
#ccc
;
border
:
1px
solid
#ccc
;
padding
:
10px
;
padding
:
5px
;
font-size
:
11px
;
font-size
:
12px
;
font-weight
:
bold
;
text-transform
:
uppercase
;
background
:
#F7F7F7
;
background
:
#F7F7F7
;
margin-bottom
:
20px
;
margin-bottom
:
20px
;
height
:
26px
;
a
{
.tab
{
margin-right
:
5px
;
font-weight
:
bold
;
@include
round-borders-all
(
4px
)
;
text-transform
:
uppercase
;
border
:
1px
solid
#ddd
;
border
-right
:
1px
solid
#ddd
;
background
:none
;
background
:none
;
padding
:
4px
10px
;
padding
:
10px
;
width
:
160px
;
width
:
60px
;
float
:left
;
position
:relative
;
top
:
-5px
;
left
:
-5px
;
height
:
16px
;
padding-left
:
34px
;
span
{
width
:
20px
;
height
:
20px
;
display
:
inline-block
;
position
:
absolute
;
left
:
8px
;
top
:
8px
;
}
&
.active
{
&
.active
{
background
:
#eaeaea
;
background
:
#eaeaea
;
}
}
}
}
}
}
.merge-tabs
.reopen-request
{
@include
round-borders-all
(
4px
);
padding
:
2px
4px
;
border
:
1px
solid
#aaa
;
text-shadow
:none
;
background
:
#D12F19
;
color
:white
;
}
.merge-tabs
.close-request
{
.merge-notes-tab
span
{
background
:
url("images.png")
no-repeat
-161px
-1px
;
}
@include
round-borders-all
(
4px
);
.merge-commits-tab
span
{
background
:
url("images.png")
no-repeat
-86px
1px
;
}
padding
:
2px
4px
;
.merge-diffs-tab
span
{
background
:
url("images.png")
no-repeat
-118px
1px
;
}
border
:
1px
solid
#aaa
;
.merge-tabs
.dashboard-loader
{
padding
:
8px
;
}
text-shadow
:none
;
background
:
#44aa22
;
color
:white
;
}
.user-mention
{
.user-mention
{
color
:
#2FA0BB
;
color
:
#2FA0BB
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.author
{
color
:
#999
;
}
.red-button
{
border-radius
:
5px
;
font-size
:
12px
;
font-weight
:
bold
;
padding
:
5px
17px
;
border
:
1px
solid
#999
;
color
:
#666
;
display
:
inline-block
;
box-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,.
3
);
background
:
#D12F19
;
color
:
white
;
}
.positive-button
{
border-radius
:
5px
;
font-size
:
12px
;
font-weight
:
bold
;
padding
:
5px
17px
;
border
:
1px
solid
#999
;
color
:
#666
;
display
:
inline-block
;
box-shadow
:
0
1px
2px
rgba
(
0
,
0
,
0
,.
3
);
background
:
#4A2
;
color
:
white
;
}
app/assets/stylesheets/style.scss
View file @
6f32ccf4
...
@@ -130,7 +130,7 @@ table tr:hover, .listed_items tr.odd:hover{background-color:#FFFFCF}
...
@@ -130,7 +130,7 @@ table tr:hover, .listed_items tr.odd:hover{background-color:#FFFFCF}
border-radius
:
5px
;
border-radius
:
5px
;
font-size
:
12px
;
font-size
:
12px
;
font-weight
:
bold
;
font-weight
:
bold
;
padding
:
6px
20
px
;
padding
:
5px
17
px
;
border
:
1px
solid
#999
;
border
:
1px
solid
#999
;
color
:
#666
;
color
:
#666
;
display
:
inline-block
;
display
:
inline-block
;
...
...
app/models/project.rb
View file @
6f32ccf4
...
@@ -90,6 +90,10 @@ class Project < ActiveRecord::Base
...
@@ -90,6 +90,10 @@ class Project < ActiveRecord::Base
users_projects
.
find_by_user_id
(
user
.
id
)
if
user
users_projects
.
find_by_user_id
(
user
.
id
)
if
user
end
end
def
team_member_by_id
(
user_id
)
users_projects
.
find_by_user_id
(
user_id
)
end
def
fresh_issues
(
n
)
def
fresh_issues
(
n
)
issues
.
includes
(
:project
,
:author
).
order
(
"created_at desc"
).
first
(
n
)
issues
.
includes
(
:project
,
:author
).
order
(
"created_at desc"
).
first
(
n
)
end
end
...
...
app/views/merge_requests/_form.html.haml
View file @
6f32ccf4
%div
.merge-request-form-holder
=
form_for
[
@project
,
@merge_request
]
do
|
f
|
.ui-box.width-100p
%div
%h3
%span
.entity-info
=
@merge_request
.
new_record?
?
"New Merge Request"
:
"Edit Merge Request #
#{
@merge_request
.
id
}
"
-
if
@merge_request
.
new_record?
=
form_for
[
@project
,
@merge_request
]
do
|
f
|
=
link_to
project_merge_requests_path
(
@project
)
do
.data
.entity-button
%table
.no-borders
Back
-
if
@merge_request
.
errors
.
any?
%i
%tr
-
else
%td
Errors
=
link_to
project_merge_request_path
(
@project
,
@merge_request
)
do
%td
.entity-button
#error_explanation
Back
-
@merge_request
.
errors
.
full_messages
.
each
do
|
msg
|
%i
%span
=
msg
%br
%h2
=
@merge_request
.
new_record?
?
"New Merge Request"
:
"Edit Merge Request #
#{
@merge_request
.
id
}
"
%hr
%table
.no-borders
-
if
@merge_request
.
errors
.
any?
%tr
%td
{
:colspan
=>
2
}
#error_explanation
-
@merge_request
.
errors
.
full_messages
.
each
do
|
msg
|
%span
=
msg
%br
%tr
%td
=
f
.
label
:source_branch
,
"From"
%td
=
f
.
select
(
:source_branch
,
@project
.
heads
.
map
(
&
:name
),
{
:include_blank
=>
"Select branch"
},
:style
=>
"width:250px"
)
%tr
%td
=
f
.
label
:target_branch
,
"To"
%td
=
f
.
select
(
:target_branch
,
@project
.
heads
.
map
(
&
:name
),
{
:include_blank
=>
"Select branch"
},
:style
=>
"width:250px"
)
%tr
%td
=
f
.
label
:assignee_id
,
"Assign to"
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
},
:style
=>
"width:250px"
)
=
f
.
text_area
:title
,
:style
=>
"width:718px; height:100px"
,
:maxlength
=>
255
%br
%br
.merge-tabs
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
-
unless
@merge_request
.
new_record?
.right
=
link_to
'Remove'
,
[
@project
,
@merge_request
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button"
%tr
%td
=
f
.
label
:title
%td
=
f
.
text_field
:title
%tr
%td
=
f
.
label
:source_branch
,
"From"
%td
=
f
.
select
(
:source_branch
,
@project
.
heads
.
map
(
&
:name
),
{
:include_blank
=>
"Select branch"
})
%tr
%td
=
f
.
label
:target_branch
,
"To"
%td
=
f
.
select
(
:target_branch
,
@project
.
heads
.
map
(
&
:name
),
{
:include_blank
=>
"Select branch"
})
%tr
%td
=
f
.
label
:assignee_id
,
"Assign to"
%td
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
})
.buttons
=
f
.
submit
'Save'
,
:class
=>
"grey-button"
=
link_to
'Back'
,
project_merge_requests_path
(
@project
),
:class
=>
"grey-button"
-
unless
@merge_request
.
new_record?
.right
=
link_to
'Remove'
,
[
@project
,
@merge_request
],
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"grey-button"
:javascript
:javascript
...
...
app/views/merge_requests/show.html.haml
View file @
6f32ccf4
...
@@ -15,33 +15,42 @@
...
@@ -15,33 +15,42 @@
.tag.commit.inline
=
@merge_request
.
target_branch
.tag.commit.inline
=
@merge_request
.
target_branch
%span
.commit-author
%span
.commit-author
%strong
%strong
=
link_to
project_team_member_path
(
@project
,
@project
.
users_projects
.
fin
d
(
@merge_request
.
author
.
id
))
do
=
link_to
project_team_member_path
(
@project
,
@project
.
team_member_by_i
d
(
@merge_request
.
author
.
id
))
do
=
@merge_request
.
author_name
%span
.author
=
@merge_request
.
author_name
→
→
=
link_to
project_team_member_path
(
@project
,
@project
.
users_projects
.
fin
d
(
@merge_request
.
assignee
.
id
))
do
=
link_to
project_team_member_path
(
@project
,
@project
.
team_member_by_i
d
(
@merge_request
.
assignee
.
id
))
do
=
@merge_request
.
assignee_name
%span
.author
=
@merge_request
.
assignee_name
=
@merge_request
.
created_at
.
stamp
(
"Aug 21, 2011 9:23pm"
)
=
@merge_request
.
created_at
.
stamp
(
"Aug 21, 2011 9:23pm"
)
%hr
%hr
%h3
=
@merge_request
.
title
%br
%h3
=
simple_format
@merge_request
.
title
.clear
.clear
%br
%br
%br
%br
.merge-tabs
.merge-tabs
=
link_to
"Notes"
,
"#notes"
,
:class
=>
"merge-notes-tab active"
=
link_to
"#notes"
,
:class
=>
"merge-notes-tab active tab"
do
=
link_to
"Commits"
,
"#commits"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab"
%span
=
link_to
"Diff"
,
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab"
Notes
=
link_to
"#commits"
,
"data-url"
=>
commits_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-commits-tab tab"
do
%span
Commits
=
link_to
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab tab"
do
%span
Diff
-
if
can?
(
current_user
,
:admin_project
,
@project
)
||
@merge_request
.
author
==
current_user
-
if
can?
(
current_user
,
:admin_project
,
@project
)
||
@merge_request
.
author
==
current_user
.right
.right
-
if
@merge_request
.
closed
-
if
@merge_request
.
closed
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"re
open-request
"
=
link_to
'Reopen'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
false
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"re
d-button
"
-
else
-
else
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"
close-request
"
,
:title
=>
"Close merge request"
=
link_to
'Close'
,
project_merge_request_path
(
@project
,
@merge_request
,
:merge_request
=>
{
:closed
=>
true
},
:status_only
=>
true
),
:method
=>
:put
,
:class
=>
"
positive-button
"
,
:title
=>
"Close merge request"
%img
{
:src
=>
"/assets/ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
}
%img
{
:src
=>
"/assets/ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
}
.merge-request-notes
.merge-request-notes
...
...
spec/requests/merge_requests_spec.rb
View file @
6f32ccf4
...
@@ -42,8 +42,8 @@ describe "MergeRequests" do
...
@@ -42,8 +42,8 @@ describe "MergeRequests" do
it
{
should
have_content
(
@merge_request
.
title
)
}
it
{
should
have_content
(
@merge_request
.
title
)
}
it
"Show page should inform user that merge request closed"
do
it
"Show page should inform user that merge request closed"
do
within
".merge-
request-show-holder h3
"
do
within
".merge-
tabs
"
do
page
.
should
have_content
"
Closed
"
page
.
should
have_content
"
Reopen
"
end
end
end
end
end
end
...
@@ -62,7 +62,7 @@ describe "MergeRequests" do
...
@@ -62,7 +62,7 @@ describe "MergeRequests" do
it
{
current_path
.
should
==
project_merge_request_path
(
project
,
project
.
merge_requests
.
last
)
}
it
{
current_path
.
should
==
project_merge_request_path
(
project
,
project
.
merge_requests
.
last
)
}
it
"should create merge request"
do
it
"should create merge request"
do
page
.
should
have_content
"
Open
"
page
.
should
have_content
"
Close
"
page
.
should
have_content
@user
.
name
page
.
should
have_content
@user
.
name
end
end
end
end
...
...
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