module Storefront class Configuration attr_accessor :field, :hint_class, :hint_tag, :label_class, :error_class, :error_tag, :valid_class, :required_class, :required_abbr, :required_title, :optional_class, :optional_abbr, :optional_title, :label_method, :label_attribute, :validation_max_limit, :default_text_field_size, :default_text_area_width, :all_fields_required_by_default, :list_tag, :list_class, :separator, :breadcrumb, :include_blank_for_select_by_default, :collection_label_methods, :i18n_lookups_by_default, :rename_nested_attributes, :inline_validations, :fieldset_class, :field_class, :legend_class, :validate_class, :form_class, :id_enabled_on, :widgets_path, :nav_class, :include_aria, :active_class, :nav_tag, :terms_tag, :term_class, :term_key_class, :term_value_class, :hint_is_popup, :field_list_tag, :list_partial, :definition_list_partial, :page_header_id, :page_title_id, :page_subtitle_id, :widget_class, :header_class, :title_class, :subtitle_class, :content_class, :default_header_level, :term_separator, :rich_input, :submit_fieldset_class, :add_label, :remove_label, :always_include_hint_tag, :always_include_error_tag, :cycle_fields, :require_if_validates_presence, # localization :localize_with_inheritance, :localize_with_namespace, :localize_with_nested_model def initialize @hint_class = "hint" @hint_tag = :figure @label_class = "label" @required_class = "required" @required_abbr = "*" @required_title = "Required" @error_class = "error" @error_tag = :output @valid_class = nil @optional_class = "optional" @optional_abbr = "" @optional_title = "Optional" @label_method = :humanize @label_attribute = :to_label @validation_max_limit = 255 @default_text_field_size = nil @default_text_area_width = 300 @all_fields_required_by_default = true @field_list_tag = :ol @list_class = "field-list" @separator = "-" @breadcrumb = " - " @include_blank_for_select_by_default = true @collection_label_methods = %w(to_label display_name full_name name title to_s) @i18n_lookups_by_default = true @escape_html_entities_in_hints_and_labels = false @rename_nested_attributes = true @inline_validations = true @fieldset_class = "fieldset" @field_class = "field" @validate_class = "validate" @legend_class = "legend" @form_class = "form" @id_enabled_on = [] # %w(field label error hint) @widgets_path = "shared/widgets" @nav_class = "list-item" @include_aria = true @active_class = "active" @nav_tag = :li @terms_tag = :dl @term_class = "term" @term_key_class = "key" @term_value_class = "value" @hint_is_popup = false @list_tag = :ul @page_header_id = "header" @page_title_id = "title" @page_subtitle_id = "subtitle" @widget_class = "widget" @header_class = "header" @title_class = "title" @subtitle_class = "subtitle" @content_class = "content" @default_header_level = 3 @term_separator = ":" @rich_input = true @submit_fieldset_class = "submit-fieldset" @add_label = "+" @remove_label = "-" @cycle_fields = false @always_include_hint_tag = false @always_include_error_tag = true @require_if_validates_presence = true @localize_with_namespace = false @localize_with_nested_model = false @localize_with_inheritance = true end def get(key) send(key).respond_to?(:call) ? send(key).call : send(key) end def current_scope Thread.current[:storefront_config] end def current_scope=(value) Thread.current[:storefront_config] = value end end end