mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
77b24fdbd1
commit
5f69067d35
3 changed files with 10 additions and 2 deletions
|
@ -16,6 +16,8 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
helper_method :registrant_request?, :registrar_request?, :admin_request?, :current_root_url
|
helper_method :registrant_request?, :registrar_request?, :admin_request?, :current_root_url
|
||||||
|
helper_method :available_languages
|
||||||
|
|
||||||
def registrant_request?
|
def registrant_request?
|
||||||
request.path.match(/^\/registrant/)
|
request.path.match(/^\/registrant/)
|
||||||
end
|
end
|
||||||
|
@ -79,4 +81,10 @@ class ApplicationController < ActionController::Base
|
||||||
return if params[parent_key][key].blank?
|
return if params[parent_key][key].blank?
|
||||||
params[parent_key][key].sub!(/,/, '.')
|
params[parent_key][key].sub!(/,/, '.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def available_languages
|
||||||
|
{ en: 'English', et: 'Estonian' }.invert
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ module FormHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def language_select(object, method, choices = nil, options = {}, html_options = {}, &block)
|
def language_select(object, method, choices = nil, options = {}, html_options = {}, &block)
|
||||||
choices = options_for_select({ en: 'English', et: 'Estonian' }.invert, options[:selected])
|
choices = options_for_select(available_languages, options[:selected])
|
||||||
select(object, method, choices, options, html_options, &block)
|
select(object, method, choices, options, html_options, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
%td.col-md-6= label_tag :default_language
|
%td.col-md-6= label_tag :default_language
|
||||||
%td.col-md-6
|
%td.col-md-6
|
||||||
= select_tag '[settings][default_language]',
|
= select_tag '[settings][default_language]',
|
||||||
options_for_select({ en: 'English', et: 'Estonian' }.invert, Setting.default_language),
|
options_for_select(available_languages, Setting.default_language),
|
||||||
class: 'form-control'
|
class: 'form-control'
|
||||||
|
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue