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
ccc07601
Commit
ccc07601
authored
Jun 04, 2018
by
tauriedavis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add form-check-input class to checkbox input for visibility levels and import sources in admin area
parent
3571b97e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+4
-2
app/views/admin/application_settings/_visibility_and_access.html.haml
...min/application_settings/_visibility_and_access.html.haml
+2
-2
No files found.
app/helpers/application_settings_helper.rb
View file @
ccc07601
...
...
@@ -36,7 +36,7 @@ module ApplicationSettingsHelper
# Return a group of checkboxes that use Bootstrap's button plugin for a
# toggle button effect.
def
restricted_level_checkboxes
(
help_block_id
,
checkbox_name
)
def
restricted_level_checkboxes
(
help_block_id
,
checkbox_name
,
options
=
{}
)
Gitlab
::
VisibilityLevel
.
values
.
map
do
|
level
|
checked
=
restricted_visibility_levels
(
true
).
include?
(
level
)
css_class
=
checked
?
'active'
:
''
...
...
@@ -46,6 +46,7 @@ module ApplicationSettingsHelper
check_box_tag
(
checkbox_name
,
level
,
checked
,
autocomplete:
'off'
,
'aria-describedby'
=>
help_block_id
,
'class'
=>
options
[
:class
],
id:
tag_name
)
+
visibility_level_icon
(
level
)
+
visibility_level_label
(
level
)
end
end
...
...
@@ -53,7 +54,7 @@ module ApplicationSettingsHelper
# Return a group of checkboxes that use Bootstrap's button plugin for a
# toggle button effect.
def
import_sources_checkboxes
(
help_block_id
)
def
import_sources_checkboxes
(
help_block_id
,
options
=
{}
)
Gitlab
::
ImportSources
.
options
.
map
do
|
name
,
source
|
checked
=
Gitlab
::
CurrentSettings
.
import_sources
.
include?
(
source
)
css_class
=
checked
?
'active'
:
''
...
...
@@ -63,6 +64,7 @@ module ApplicationSettingsHelper
check_box_tag
(
checkbox_name
,
source
,
checked
,
autocomplete:
'off'
,
'aria-describedby'
=>
help_block_id
,
'class'
=>
options
[
:class
],
id:
name
.
tr
(
' '
,
'_'
))
+
name
end
end
...
...
app/views/admin/application_settings/_visibility_and_access.html.haml
View file @
ccc07601
...
...
@@ -23,7 +23,7 @@
.col-sm-10
-
checkbox_name
=
'application_setting[restricted_visibility_levels][]'
=
hidden_field_tag
(
checkbox_name
)
-
restricted_level_checkboxes
(
'restricted-visibility-help'
,
checkbox_name
).
each
do
|
level
|
-
restricted_level_checkboxes
(
'restricted-visibility-help'
,
checkbox_name
,
class:
'form-check-input'
).
each
do
|
level
|
.form-check
=
level
%span
.form-text.text-muted
#restricted-visibility-help
...
...
@@ -33,7 +33,7 @@
=
f
.
label
:import_sources
,
class:
'col-form-label col-sm-2'
.col-sm-10
=
hidden_field_tag
'application_setting[import_sources][]'
-
import_sources_checkboxes
(
'import-sources-help'
).
each
do
|
source
|
-
import_sources_checkboxes
(
'import-sources-help'
,
class:
'form-check-input'
).
each
do
|
source
|
.form-check
=
source
%span
.form-text.text-muted
#import-sources-help
Enabled sources for code import during project creation. OmniAuth must be configured for GitHub
...
...
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