Sha256: e4458c0b252932322b952e850e12d1567368d621186f85e9f25195877a0d173f

Contents?: true

Size: 1.37 KB

Versions: 19

Compression:

Stored size: 1.37 KB

Contents

ActiveAdmin.register C80MapFloors::MapBuilding, as: 'MapBuilding' do

  menu :label => 'Полигоны зданий', :parent => 'Карта'#, :if => proc { current_admin_user.email == 'tz007@mail.ru' }

  before_filter :skip_sidebar!, :only => :index

  permit_params :img, 
                :coords, 
                :coords_img,
                :tag,
                :title

  config.sort_order = 'id_asc'

  index do
    column :id
    column :tag
    column :title
    column :building_representator
    column :coords do |mp|
      d = mp.coords
      "<div style='width:100px;overflow:hidden;'>#{d}</div>".html_safe
    end
    column :coords_img do |mp|
      d = mp.coords_img
      "<div style='width:70px;overflow:hidden;'>#{d}</div>".html_safe
    end
    column :created_at
    column :updated_at
    # column 'img' do |sp|
    #   "#{ link_to image_tag(sp.img.thumb.url, :style => 'background-color: #cfcfcf;'), sp.img.url, :target => '_blank' }<br>
    #   ".html_safe
    # end
    actions
  end

  form(:html => {:multipart => true}) do |f|

    f.inputs 'Свойства' do
      f.input :tag
      f.input :title
      f.input :coords, :input_html => {:style => 'height:50px'}
      f.input :coords_img, :input_html => {:style => 'height:50px'}
      # f.input :img, :hint => "#{image_tag(f.object.img.thumb.url) if f.object.img.present?}".html_safe
    end

    f.actions
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
c80_map_floors-0.2.2 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.1 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.8 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.7 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.6 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.5 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.4 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.3 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.2 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.1 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.2.0.0 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.25 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.24 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.23 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.22 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.21 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.20 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.19 app/admin/c80_map_floors/map_buildings.rb
c80_map_floors-0.1.0.18 app/admin/c80_map_floors/map_buildings.rb