app/admin/c80_estate/properties.rb in c80_estate-0.1.0.31 vs app/admin/c80_estate/properties.rb in c80_estate-0.1.0.32
- old
+ new
@@ -49,25 +49,36 @@
link_to prop.title, "/admin/properties/#{prop.id}", title: I18n.t("active_admin.view")
end
column 'Площадей' do |prop|
prop.areas.count
end
+
+ unless (->{ current_admin_user.can_view_statistics?}).call
+ column 'Свободно' do |prop|
+ prop.areas.free_areas.count
+ end
+ end
+
column 'Метраж' do |prop|
"#{prop.square_value.to_s(:rounded, precision: 2)} м.кв."
end
- column '<abbr title="Сумма всех цен площадей">Цена объекта</abbr>'.html_safe do |prop|
- "#{prop.power_price_value.to_s(:rounded, precision: 2)} руб"
+
+ if (->{ current_admin_user.can_view_statistics?}).call
+ column '<abbr title="Сумма всех цен площадей">Цена объекта</abbr>'.html_safe do |prop|
+ "#{prop.power_price_value.to_s(:rounded, precision: 2)} руб"
+ end
+ # column :address
+ # column :gps do |prop|
+ # "#{prop.latitude},#{prop.longitude}"
+ # end
+ column :average_price do |prop|
+ "#{prop.average_price.to_s(:rounded, precision: 2)} руб"
+ end
+ column :average_price_busy do |prop|
+ "#{prop.average_price_busy.to_s(:rounded, precision: 2)} руб"
+ end
end
- # column :address
- # column :gps do |prop|
- # "#{prop.latitude},#{prop.longitude}"
- # end
- column :average_price do |prop|
- "#{prop.average_price.to_s(:rounded, precision: 2)} руб"
- end
- column :average_price_busy do |prop|
- "#{prop.average_price_busy.to_s(:rounded, precision: 2)} руб"
- end
+
column :assigned_person do |prop|
prop.assigned_person_title
end
# column :atype do |prop|
# prop.atype.title
\ No newline at end of file