Sha256: b2a52828e7bbed2f62aa56c8999c4105cecd1893d5f201e04ccc44a49625ba3d

Contents?: true

Size: 1.22 KB

Versions: 14

Compression:

Stored size: 1.22 KB

Contents

ActiveAdmin.register C80Estate::Pstat, as: 'Pstat' do

  # scope_to :current_admin_user, association_method: :sites_list

  menu label: 'Статистика', priority: 6
  menu :label => "Объекты", :parent => 'Статистика', if: proc{ current_admin_user.can_view_statistics? }

  config.sort_order = 'id_asc'

  filter :property_id,
         :as => :select,
         :collection => -> { C80Estate::Property.all.map { |p| ["#{p.title}", p.id] } },
         :input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}

  filter :atype_id,
         :as => :select,
         :collection => -> { C80Estate::Atype.all.map { |p| ["#{p.title}", p.id] } },
         :input_html => {:class => 'selectpicker', 'data-size' => "10", 'data-width' => '100%'}

  filter :created_at

  index do
    selectable_column
    column :property do |ptype|
      ptype.property_title
    end
    column :atype do |ptype|
      ptype.atype_title
    end
    column :free_areas
    column :busy_areas
    column :coef_busy do |pst|
      pst.coef_busy.to_s(:rounded, :precision => 2)
    end
    column :coef_busy_sq do |pst|
      pst.coef_busy_sq.to_s(:rounded, :precision => 2)
    end
    column :created_at
    actions
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
c80_estate-0.1.0.39 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.38 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.37 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.36 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.35 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.34 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.33 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.32 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.31 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.30 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.29 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.28 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.27 app/admin/c80_estate/pstats.rb
c80_estate-0.1.0.26 app/admin/c80_estate/pstats.rb