aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/companies_controller.rb8
-rw-r--r--app/views/companies/index.html.slim19
2 files changed, 22 insertions, 5 deletions
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb
index 9d33c6cb8..1596975b8 100644
--- a/app/controllers/companies_controller.rb
+++ b/app/controllers/companies_controller.rb
@@ -15,6 +15,14 @@ class CompaniesController < BreadcrumbController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
+
+ @companies = ModelDecorator.decorate(
+ @companies,
+ with: CompanyDecorator,
+ context: {
+ line_referential: line_referential
+ }
+ )
}
build_breadcrumb :index
end
diff --git a/app/views/companies/index.html.slim b/app/views/companies/index.html.slim
index 8605a213b..ceea385b3 100644
--- a/app/views/companies/index.html.slim
+++ b/app/views/companies/index.html.slim
@@ -22,11 +22,20 @@
- if @companies.any?
.row
.col-lg-12
- = table_builder @companies,
- { 'Oid' => Proc.new { |n| n.try(:objectid).try(:local_id) }, :name => 'name' },
- [:show, :edit, :delete],
- [],
- 'table has-search'
+ = table_builder_2 @companies,
+ [ \
+ TableBuilderHelper::Column.new( \
+ name: 'Oid', \
+ attribute: Proc.new { |n| n.try(:objectid).try(:local_id) }, \
+ sortable: false \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :name, \
+ attribute: 'name' \
+ ) \
+ ],
+ links: [:show, :edit],
+ cls: 'table has-search'
= new_pagination @companies, 'pull-right'