forked from spen/seminar
add new custom field type(file upload)
This commit is contained in:
parent
f6decf3770
commit
d4aba5c2cb
|
@ -182,6 +182,19 @@ module Admin::SeminarsFieldHelper
|
|||
end
|
||||
end
|
||||
|
||||
def render_file_field
|
||||
a = control_group_wrapper_for_sm do |key,value|
|
||||
add_more_blank = can_add_more ? "[]" : ""
|
||||
key_field = can_muti_lang_input? ? "[#{key}]" : ""
|
||||
field_name = [get_field_name_base,add_more_blank,key_field].join
|
||||
file_required =@require ? 'required="required"' : ''
|
||||
"<div class=\"file-selector\"><label class=\"ui-button\">
|
||||
<input style=\"position: absolute;width:0.1em;opacity: 0;padding: 0;border: 0;opacity: 0;left: 50%;top: 0;\" class=\"upload\" name=\"#{field_name}\" #{file_required} type=\"file\" />
|
||||
<i class=\"fa fa-file\"></i> #{I18n.t('file.upload')}
|
||||
</label><div class=\"filename\"></div></div>#{value}".html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def date_is_range?
|
||||
is_range = "false"
|
||||
data = get_data
|
||||
|
|
Loading…
Reference in New Issue