Sha256: b505d8f0a71a5e2f8ec1dbc7ad04525f06f6c9efd872e0d2116b2663bff7f756

Contents?: true

Size: 1.28 KB

Versions: 53

Compression:

Stored size: 1.28 KB

Contents

module CalendarDateSelect::IncludesHelper
  # returns the selected calendar_date_select stylesheet (not an array)
  def calendar_date_select_stylesheets(options = {})
    options.assert_valid_keys(:style)
    "calendar_date_select/#{options[:style] || "default"}"
  end

  # returns an array of javascripts needed for the selected locale, date_format, and calendar control itself.
  def calendar_date_select_javascripts(options = {})
    options.assert_valid_keys(:locale)
    files = ["calendar_date_select/calendar_date_select"]
    files << "calendar_date_select/locale/#{options[:locale]}" if options[:locale]
    files << "calendar_date_select/#{CalendarDateSelect.format[:javascript_include]}" if CalendarDateSelect.format[:javascript_include]
    files
  end

  # returns html necessary to load javascript and css to make calendar_date_select work
  def calendar_date_select_includes(*args)
    return "" if @cds_already_included
    @cds_already_included=true
    
    options = (Hash === args.last) ? args.pop : {}
    options.assert_valid_keys(:style, :locale)
    options[:style] ||= args.shift
    
    javascript_include_tag(*calendar_date_select_javascripts(:locale => options[:locale])) + "\n" +
    stylesheet_link_tag(*calendar_date_select_stylesheets(:style => options[:style])) + "\n"
  end
end

Version data entries

53 entries across 53 versions & 13 rubygems

Version Path
webroar-0.7.0 src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/includes_helper.rb
calendar_date_select-1.16.3 lib/calendar_date_select/includes_helper.rb
branston-0.6.6 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.6.5 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.6.4 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.6.3 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.6.2 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
calendar_date_select-1.16.2 lib/calendar_date_select/includes_helper.rb
branston-0.6.1 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
ginkel-calendar_date_select-1.16.1.2 lib/calendar_date_select/includes_helper.rb
ginkel-calendar_date_select-1.16.1.1 lib/calendar_date_select/includes_helper.rb
branston-0.6.0 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
calendar_date_select-1.16.1 lib/calendar_date_select/includes_helper.rb
calendar_date_select-1.16 lib/calendar_date_select/includes_helper.rb
branston-0.5.2 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.5.1 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.5.0 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.4.6 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.4.5 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb
branston-0.4.4 lib/branston/vendor/plugins/calendar_date_select-1.15/lib/calendar_date_select/includes_helper.rb