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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1965ff3e
Commit
1965ff3e
authored
Apr 19, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport select_helper from EE
parent
55380e69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
15 deletions
+12
-15
.rubocop.yml
.rubocop.yml
+1
-1
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+11
-14
No files found.
.rubocop.yml
View file @
1965ff3e
...
@@ -728,7 +728,7 @@ Metrics/ParameterLists:
...
@@ -728,7 +728,7 @@ Metrics/ParameterLists:
# A complexity metric geared towards measuring complexity for a human reader.
# A complexity metric geared towards measuring complexity for a human reader.
Metrics/PerceivedComplexity
:
Metrics/PerceivedComplexity
:
Enabled
:
true
Enabled
:
true
Max
:
1
7
Max
:
1
8
#################### Lint ################################
#################### Lint ################################
...
...
app/helpers/selects_helper.rb
View file @
1965ff3e
...
@@ -2,32 +2,29 @@ module SelectsHelper
...
@@ -2,32 +2,29 @@ module SelectsHelper
def
users_select_tag
(
id
,
opts
=
{})
def
users_select_tag
(
id
,
opts
=
{})
css_class
=
"ajax-users-select "
css_class
=
"ajax-users-select "
css_class
<<
"multiselect "
if
opts
[
:multiple
]
css_class
<<
"multiselect "
if
opts
[
:multiple
]
css_class
<<
"skip_ldap "
if
opts
[
:skip_ldap
]
css_class
<<
(
opts
[
:class
]
||
''
)
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
value
=
opts
[
:selected
]
||
''
placeholder
=
opts
[
:placeholder
]
||
'Search for a user'
null_user
=
opts
[
:null_user
]
||
false
any_user
=
opts
[
:any_user
]
||
false
email_user
=
opts
[
:email_user
]
||
false
first_user
=
opts
[
:first_user
]
&&
current_user
?
current_user
.
username
:
false
first_user
=
opts
[
:first_user
]
&&
current_user
?
current_user
.
username
:
false
current_user
=
opts
[
:current_user
]
||
false
author_id
=
opts
[
:author_id
]
||
''
project
=
opts
[
:project
]
||
@project
html
=
{
html
=
{
class:
css_class
,
class:
css_class
,
data:
{
data:
{
placeholder:
placeholder
,
placeholder:
opts
[
:placeholder
]
||
'Search for a user'
,
null_user:
null_user
,
null_user:
opts
[
:null_user
]
||
false
,
any_user:
any_user
,
any_user:
opts
[
:any_user
]
||
false
,
email_user:
email_user
,
email_user:
opts
[
:email_user
]
||
false
,
first_user:
first_user
,
first_user:
first_user
,
current_user:
current_user
,
current_user:
opts
[
:current_user
]
||
false
,
author_id:
author_id
"push-code-to-protected-branches"
=>
opts
[
:push_code_to_protected_branches
],
author_id:
opts
[
:author_id
]
||
''
}
}
}
}
unless
opts
[
:scope
]
==
:all
unless
opts
[
:scope
]
==
:all
project
=
opts
[
:project
]
||
@project
if
project
if
project
html
[
'data-project-id'
]
=
project
.
id
html
[
'data-project-id'
]
=
project
.
id
elsif
@group
elsif
@group
...
...
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