aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/referential_companies_controller.rb8
-rw-r--r--app/views/referential_companies/index.html.slim32
2 files changed, 34 insertions, 6 deletions
diff --git a/app/controllers/referential_companies_controller.rb b/app/controllers/referential_companies_controller.rb
index e8b104d14..09167009a 100644
--- a/app/controllers/referential_companies_controller.rb
+++ b/app/controllers/referential_companies_controller.rb
@@ -13,6 +13,14 @@ class ReferentialCompaniesController < ChouetteController
if collection.out_of_bounds?
redirect_to params.merge(:page => 1)
end
+
+ @companies = ModelDecorator.decorate(
+ @companies,
+ with: CompanyDecorator,
+ context: {
+ line_referential: referential
+ }
+ )
}
build_breadcrumb :index
end
diff --git a/app/views/referential_companies/index.html.slim b/app/views/referential_companies/index.html.slim
index 85d1d416d..23eea40ce 100644
--- a/app/views/referential_companies/index.html.slim
+++ b/app/views/referential_companies/index.html.slim
@@ -22,12 +22,32 @@
- if @companies.any?
.row
.col-lg-12
- = table_builder @companies,
- { 'ID Codifligne' => Proc.new { |n| n.try(:objectid).try(:local_id) },
- :name => 'name', :phone => 'phone', :email => 'email', :url => 'url' },
- [:show, :edit, :delete],
- [],
- 'table has-search'
+ = table_builder_2 @companies,
+ [ \
+ TableBuilderHelper::Column.new( \
+ name: 'ID Codifligne', \
+ attribute: Proc.new { |n| n.try(:objectid).try(:local_id) }, \
+ sortable: false \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :name, \
+ attribute: 'name' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :phone, \
+ attribute: 'phone' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :email, \
+ attribute: 'email' \
+ ), \
+ TableBuilderHelper::Column.new( \
+ key: :url, \
+ attribute: 'url' \
+ ) \
+ ],
+ links: [:show, :edit],
+ cls: 'table has-search'
= new_pagination @companies, 'pull-right'