2015-01-08 03:22:50 -05:00
|
|
|
module ApplicationSettingsHelper
|
2015-01-08 17:26:43 -05:00
|
|
|
def gravatar_enabled?
|
|
|
|
current_application_settings.gravatar_enabled?
|
|
|
|
end
|
|
|
|
|
2015-02-13 06:02:17 -05:00
|
|
|
def twitter_sharing_enabled?
|
|
|
|
current_application_settings.twitter_sharing_enabled?
|
|
|
|
end
|
|
|
|
|
2015-01-08 12:53:35 -05:00
|
|
|
def signup_enabled?
|
2015-01-08 17:26:43 -05:00
|
|
|
current_application_settings.signup_enabled?
|
2015-01-08 12:53:35 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def signin_enabled?
|
2015-01-08 17:26:43 -05:00
|
|
|
current_application_settings.signin_enabled?
|
2015-01-08 12:53:35 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def extra_sign_in_text
|
|
|
|
current_application_settings.sign_in_text
|
|
|
|
end
|
2015-03-01 10:06:46 -05:00
|
|
|
|
|
|
|
# Return a group of checkboxes that use Bootstrap's button plugin for a
|
|
|
|
# toggle button effect.
|
|
|
|
def restricted_level_checkboxes(help_block_id)
|
|
|
|
Gitlab::VisibilityLevel.options.map do |name, level|
|
|
|
|
checked = restricted_visibility_levels(true).include?(level)
|
|
|
|
css_class = 'btn btn-primary'
|
|
|
|
css_class += ' active' if checked
|
|
|
|
checkbox_name = 'application_setting[restricted_visibility_levels][]'
|
|
|
|
|
|
|
|
label_tag(checkbox_name, class: css_class) do
|
2015-03-10 20:21:09 -04:00
|
|
|
check_box_tag(checkbox_name, level, checked,
|
|
|
|
autocomplete: 'off',
|
2015-03-01 10:06:46 -05:00
|
|
|
'aria-describedby' => help_block_id) + name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-01-08 03:22:50 -05:00
|
|
|
end
|