0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-13 21:42:53 +01:00
discourse-custom-wizard/lib/custom_wizard/field.rb

63 Zeilen
1,1 KiB
Ruby

2017-10-09 07:52:09 +02:00
class CustomWizard::Field
def self.types
@types ||= {
text: {
2020-07-16 09:50:09 +02:00
min_length: nil,
prefill: nil
},
textarea: {
2020-07-16 09:50:09 +02:00
min_length: nil,
prefill: nil
},
composer: {
min_length: nil
},
text_only: {},
2020-07-02 07:25:17 +02:00
date: {},
number: {},
checkbox: {},
url: {
min_length: nil
},
upload: {
file_types: '.jpg,.png'
},
dropdown: {
prefill: nil,
content: nil
},
tag: {
limit: nil,
prefill: nil,
content: nil
},
category: {
limit: 1,
property: 'id',
prefill: nil,
content: nil
},
group: {
prefill: nil,
content: nil
},
user_selector: {}
}
2017-10-09 07:52:09 +02:00
end
def self.require_assets
@require_assets ||= {}
end
def self.add_assets(type, plugin = nil, asset_paths = [], opts={})
2017-10-09 07:52:09 +02:00
if type
types[type] ||= {}
types[type] = opts[:type_opts] if opts[:type_opts].present?
2017-10-09 07:52:09 +02:00
end
if plugin && asset_paths
require_assets[plugin] = asset_paths
end
end
end