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
a3bb9ca1
Commit
a3bb9ca1
authored
Jul 17, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Unassigned Merge Requests
parent
80f2ef2d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
14 deletions
+22
-14
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/observers/mailer_observer.rb
app/observers/mailer_observer.rb
+1
-1
app/views/merge_requests/_form.html.haml
app/views/merge_requests/_form.html.haml
+14
-6
app/views/merge_requests/edit.html.haml
app/views/merge_requests/edit.html.haml
+1
-1
app/views/merge_requests/new.html.haml
app/views/merge_requests/new.html.haml
+1
-1
app/views/merge_requests/show/_mr_box.html.haml
app/views/merge_requests/show/_mr_box.html.haml
+4
-3
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-1
No files found.
app/models/merge_request.rb
View file @
a3bb9ca1
...
...
@@ -22,7 +22,6 @@ class MergeRequest < ActiveRecord::Base
:should_remove_source_branch
validates_presence_of
:project_id
validates_presence_of
:assignee_id
validates_presence_of
:author_id
validates_presence_of
:source_branch
validates_presence_of
:target_branch
...
...
@@ -36,6 +35,7 @@ class MergeRequest < ActiveRecord::Base
delegate
:name
,
:email
,
:to
=>
:assignee
,
:allow_nil
=>
true
,
:prefix
=>
true
validates
:title
,
...
...
app/observers/mailer_observer.rb
View file @
a3bb9ca1
...
...
@@ -43,7 +43,7 @@ class MailerObserver < ActiveRecord::Observer
end
def
new_merge_request
(
merge_request
)
if
merge_request
.
assignee
!=
current_user
if
merge_request
.
assignee
&&
merge_request
.
assignee
!=
current_user
Notify
.
new_merge_request_email
(
merge_request
.
id
).
deliver
end
end
...
...
app/views/merge_requests/_form.html.haml
View file @
a3bb9ca1
...
...
@@ -5,7 +5,8 @@
-
@merge_request
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%h3
.padded.cgray
1. Select Branches
%h4
.cdark
1. Select Branches
%br
.row
.span6
...
...
@@ -30,14 +31,21 @@
.bottom_commit
.mr_target_commit
%h3
.padded.cgray
2. Fill info
%h4
.cdark
2. Fill info
.clearfix
=
f
.
label
:assignee_id
,
"Assign to"
,
:class
=>
"control-label"
.controls
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
},
:style
=>
"width:250px"
)
.main_box
.top_box_content
=
f
.
label
:title
do
%strong
=
"Title *"
.input
=
f
.
text_field
:title
,
:class
=>
"input-xxlarge pad"
,
:maxlength
=>
255
,
:rows
=>
5
.middle_box_content
=
f
.
label
:assignee_id
do
%i
.icon-user
Assign to
.input
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
:include_blank
=>
"Select user"
},
:style
=>
"width:250px"
)
.control-group
=
f
.
label
:title
,
:class
=>
"control-label"
.controls
=
f
.
text_field
:title
,
:class
=>
"input-xxlarge pad"
,
:maxlength
=>
255
,
:rows
=>
5
.form-actions
=
f
.
submit
'Save'
,
:class
=>
"btn-primary btn"
...
...
app/views/merge_requests/edit.html.haml
View file @
a3bb9ca1
%h3
%h3
.page_title
=
"Edit merge request
#{
@merge_request
.
id
}
"
%hr
=
render
'form'
app/views/merge_requests/new.html.haml
View file @
a3bb9ca1
%h3
New Merge Request
%h3
.page_title
New Merge Request
%hr
=
render
'form'
app/views/merge_requests/show/_mr_box.html.haml
View file @
a3bb9ca1
...
...
@@ -13,9 +13,10 @@
=
image_tag
gravatar_icon
(
@merge_request
.
author_email
),
:width
=>
16
,
:class
=>
"lil_av"
%strong
.author
=
link_to_merge_request_author
(
@merge_request
)
%cite
.cgray
and currently assigned to
=
image_tag
gravatar_icon
(
@merge_request
.
assignee_email
),
:width
=>
16
,
:class
=>
"lil_av"
%strong
.author
=
link_to_merge_request_assignee
(
@merge_request
)
-
if
@merge_request
.
assignee
%cite
.cgray
and currently assigned to
=
image_tag
gravatar_icon
(
@merge_request
.
assignee_email
),
:width
=>
16
,
:class
=>
"lil_av"
%strong
.author
=
link_to_merge_request_assignee
(
@merge_request
)
-
if
@merge_request
.
closed
...
...
spec/models/merge_request_spec.rb
View file @
a3bb9ca1
...
...
@@ -13,7 +13,6 @@ describe MergeRequest do
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
validate_presence_of
(
:author_id
)
}
it
{
should
validate_presence_of
(
:project_id
)
}
it
{
should
validate_presence_of
(
:assignee_id
)
}
end
describe
"Scope"
do
...
...
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