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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
adec8c77
Commit
adec8c77
authored
Nov 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor select2 tags
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
da26fd3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+0
-9
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+14
-2
No files found.
app/helpers/namespaces_helper.rb
View file @
adec8c77
...
@@ -17,15 +17,6 @@ module NamespacesHelper
...
@@ -17,15 +17,6 @@ module NamespacesHelper
grouped_options_for_select
(
options
,
selected
)
grouped_options_for_select
(
options
,
selected
)
end
end
def
namespace_select_tag
(
id
,
opts
=
{})
css_class
=
"ajax-namespace-select "
css_class
<<
"multiselect "
if
opts
[
:multiple
]
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
hidden_field_tag
(
id
,
value
,
class:
css_class
)
end
def
namespace_icon
(
namespace
,
size
=
40
)
def
namespace_icon
(
namespace
,
size
=
40
)
if
namespace
.
kind_of?
(
Group
)
if
namespace
.
kind_of?
(
Group
)
group_icon
(
namespace
)
group_icon
(
namespace
)
...
...
app/helpers/selects_helper.rb
View file @
adec8c77
...
@@ -35,8 +35,20 @@ module SelectsHelper
...
@@ -35,8 +35,20 @@ module SelectsHelper
end
end
def
groups_select_tag
(
id
,
opts
=
{})
def
groups_select_tag
(
id
,
opts
=
{})
css_class
=
"ajax-groups-select "
opts
[
:class
]
||=
''
css_class
<<
"multiselect "
if
opts
[
:multiple
]
opts
[
:class
]
<<
' ajax-groups-select'
select2_tag
(
id
,
opts
)
end
def
namespace_select_tag
(
id
,
opts
=
{})
opts
[
:class
]
||=
''
opts
[
:class
]
<<
' ajax-namespace-select'
select2_tag
(
id
,
opts
)
end
def
select2_tag
(
id
,
opts
=
{})
css_class
=
''
css_class
<<
'multiselect '
if
opts
[
:multiple
]
css_class
<<
(
opts
[
:class
]
||
''
)
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
value
=
opts
[
:selected
]
||
''
...
...
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