app/admin/c80_push/dealers.rb in c80_push-0.1.0.2 vs app/admin/c80_push/dealers.rb in c80_push-0.1.0.3
- old
+ new
@@ -6,10 +6,11 @@
permit_params :title,
:ord,
:site,
:email,
+ :preset_ids => [],
:region_ids => [],
:offices_attributes => [
:id,
:ord,
:title,
@@ -47,12 +48,12 @@
form(:html => {:multipart => true}) do |f|
f.inputs 'Свойства' do
f.input :title
f.input :ord
- f.input :site, hint: I18n.t('c80_push.active_admin.hints.site')
- f.input :email, hint: I18n.t('c80_push.active_admin.hints.email')
+ f.input :site, hint: I18n.t('c80_push.active_admin.hints.dealer.site')
+ f.input :email, hint: I18n.t('c80_push.active_admin.hints.dealer.email')
f.input :regions,
:as => :select,
:input_html => {
:title => '',
:class => 'selectpicker',
@@ -61,20 +62,38 @@
:width => '600px'
},
:multiple => false
},
:include_blank => true
+ f.input :presets,
+ :as => :select,
+ :collection => C80Push::Preset.all.map {|p| [p.title, p.id]},
+ # :collection => C80Push::Preset.all.map { |p|
+ # "<option value='#{p.id}'>#{p.title}</option>".html_safe
+ # },
+ # :collection => "<option></option>",
+ :input_html => {
+ :title => '',
+ :class => 'selectpicker',
+ :data => {
+ :size => 10,
+ :width => '600px'
+ },
+ :multiple => false
+ },
+ :include_blank => true,
+ :hint => "<a href='https://tech.yandex.ru/maps/doc/jsapi/2.1/ref/reference/option.presetStorage-docpage/' target='_blank'>Справка по цветам</a>".html_safe
f.has_many :offices,
:allow_destroy => true,
:heading => I18n.t('activerecord.models.office.other') do |office|
office.input :title
office.input :ord
office.input :addr
office.input :gps
- office.input :tel, hint: I18n.t('c80_push.active_admin.hints.tel')
- office.input :site, hint: I18n.t('c80_push.active_admin.hints.site')
- office.input :email, hint: I18n.t('c80_push.active_admin.hints.email')
+ office.input :tel, hint: I18n.t('c80_push.active_admin.hints.office.tel')
+ office.input :site, hint: I18n.t('c80_push.active_admin.hints.office.site')
+ office.input :email, hint: I18n.t('c80_push.active_admin.hints.office.email')
office.input :regions,
:as => :select,
:input_html => {
:title => '',
:class => 'selectpicker',
\ No newline at end of file