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
226908b8
Commit
226908b8
authored
Dec 18, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue weight selection
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
b4efe44d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+2
-2
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/helpers/issues_helper.rb
View file @
226908b8
...
@@ -121,13 +121,13 @@ module IssuesHelper
...
@@ -121,13 +121,13 @@ module IssuesHelper
end
end
end
end
def
projects_weight_options
def
projects_weight_options
(
selected
=
nil
)
options
=
(
Issue
::
WEIGHT_RANGE
).
map
do
|
i
|
options
=
(
Issue
::
WEIGHT_RANGE
).
map
do
|
i
|
[
i
,
i
]
[
i
,
i
]
end
end
options
.
unshift
([
'Any'
,
nil
])
options
.
unshift
([
'Any'
,
nil
])
options_for_select
(
options
,
params
[
:weight
])
options_for_select
(
options
,
selected
||
params
[
:weight
])
end
end
# Required for Banzai::Filter::IssueReferenceFilter
# Required for Banzai::Filter::IssueReferenceFilter
...
...
app/views/shared/issuable/_form.html.haml
View file @
226908b8
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
=
icon
(
'magnet'
)
=
icon
(
'magnet'
)
Weight
Weight
.col-sm-10
.col-sm-10
=
f
.
select
:weight
,
projects_weight_options
,
{
include_blank:
true
},
=
f
.
select
:weight
,
projects_weight_options
(
issuable
.
weight
)
,
{
include_blank:
true
},
{
class:
'select2 js-select2'
,
data:
{
placeholder:
"Select weight"
}}
{
class:
'select2 js-select2'
,
data:
{
placeholder:
"Select weight"
}}
.form-group
.form-group
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
226908b8
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
-
else
-
else
.light
None
.light
None
.selectbox
.selectbox
=
f
.
select
:weight
,
projects_weight_options
,
{
include_blank:
true
},
=
f
.
select
:weight
,
projects_weight_options
(
issuable
.
weight
)
,
{
include_blank:
true
},
{
class:
'select2 js-select2'
,
data:
{
placeholder:
"Select weight"
}}
{
class:
'select2 js-select2'
,
data:
{
placeholder:
"Select weight"
}}
.block
.block
...
...
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