BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3958330e
Unverified
Commit
3958330e
authored
Dec 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added milestone_options and assigne_options helpers
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5c68f4f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
issues_helper.rb
app/helpers/issues_helper.rb
+8
-0
_form.html.haml
app/views/projects/issues/_form.html.haml
+2
-2
_issue_context.html.haml
app/views/projects/issues/_issue_context.html.haml
+2
-2
_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+2
-2
No files found.
app/helpers/issues_helper.rb
View file @
3958330e
...
...
@@ -76,4 +76,12 @@ module IssuesHelper
def
bulk_update_assignee_options
options_for_select
([
"None (unassigned)"
,
nil
])
+
options_from_collection_for_select
(
@project
.
team
.
members
,
"id"
,
"name"
,
params
[
:assignee_id
])
end
def
assignee_options
object
options_from_collection_for_select
(
@project
.
team
.
members
.
sort_by
(
&
:name
),
'id'
,
'name'
,
object
.
assignee_id
)
end
def
milestone_options
object
options_from_collection_for_select
(
@project
.
milestones
.
active
,
'id'
,
'title'
,
object
.
milestone_id
)
end
end
app/views/projects/issues/_form.html.haml
View file @
3958330e
...
...
@@ -21,7 +21,7 @@
Assign to
.controls
.pull-left
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
=
f
.
select
(
:assignee_id
,
assignee_options
(
@issue
)
,
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
.pull-right
=
link_to
'Assign to me'
,
'#'
,
class:
'btn btn-small assign-to-me-link'
...
...
@@ -29,7 +29,7 @@
=
f
.
label
:milestone_id
do
%i
.icon-time
Milestone
.controls
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
collect
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.controls
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
)
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.ui-box-bottom
.control-group
...
...
app/views/projects/issues/_issue_context.html.haml
View file @
3958330e
...
...
@@ -7,7 +7,7 @@
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
link_to
profile_path
(
issue
.
assignee
)
do
=
image_tag
(
avatar_icon
(
issue
.
assignee
.
email
),
class:
'avatar avatar-inline s16 assignee'
)
if
issue
.
assignee
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Assign to user (none):"
},
{
class:
'chosen'
})
=
f
.
select
(
:assignee_id
,
assignee_options
(
@issue
)
,
{
include_blank:
"Assign to user (none):"
},
{
class:
'chosen'
})
-
elsif
issue
.
assignee
=
link_to_member
(
@project
,
@issue
.
assignee
)
...
...
@@ -16,7 +16,7 @@
%cite
.cgray
and attached to milestone
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
all
.
collect
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone (none):"
},
{
class:
'chosen'
})
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
)
,
{
include_blank:
"Select milestone (none):"
},
{
class:
'chosen'
})
=
hidden_field_tag
:issue_context
=
f
.
submit
class:
'btn'
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
3958330e
...
...
@@ -39,12 +39,12 @@
=
f
.
label
:assignee_id
do
%i
.icon-user
Assign to
.controls
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
.controls
=
f
.
select
(
:assignee_id
,
assignee_options
(
@merge_request
)
,
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
.left
=
f
.
label
:milestone_id
do
%i
.icon-time
Milestone
.controls
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
map
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.controls
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
)
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.control-group
=
f
.
label
:description
,
"Description"
.controls
...
...
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