diff options
| author | Luc Donnet | 2017-07-21 09:58:02 +0200 |
|---|---|---|
| committer | Luc Donnet | 2017-07-21 09:58:02 +0200 |
| commit | 7b297ba1410e82ea3d38f2be3c2d34596e52306a (patch) | |
| tree | 273c08c8339a6a10d2c85025bffbdd9d7b755088 | |
| parent | 91bfabc3b46973409de4279063804e0edaea1c27 (diff) | |
| download | chouette-core-7b297ba1410e82ea3d38f2be3c2d34596e52306a.tar.bz2 | |
Fix referentials count in homepage Refs #4136 @1
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 1 | ||||
| -rw-r--r-- | app/views/workbenches/index.html.slim | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb index 171db6a07..19af28a98 100644 --- a/app/controllers/workbenches_controller.rb +++ b/app/controllers/workbenches_controller.rb @@ -7,6 +7,7 @@ class WorkbenchesController < BreadcrumbController def index # Only display Wb with selected name, according to #4108 @workbench = current_organisation.workbenches.find_by(name: "Gestion de l'offre") + @referentials = @workbench.all_referentials @calendars = Calendar.where('organisation_id = ? OR shared = ?', current_organisation.id, true) end diff --git a/app/views/workbenches/index.html.slim b/app/views/workbenches/index.html.slim index 1bd116a85..ca61d439d 100644 --- a/app/views/workbenches/index.html.slim +++ b/app/views/workbenches/index.html.slim @@ -33,14 +33,14 @@ h3.panel-title.with_actions div = t('.offers.referentials') - span.badge.ml-xs = @workbench.referentials.count if @workbench.all_referentials.any? + span.badge.ml-xs = @referentials.count if @referentials.any? div = link_to '', workbench_path(@workbench), class: ' fa fa-chevron-right pull-right', title: t('.offers.see') - - if @workbench.all_referentials.any? + - if @referentials.any? .list-group - - @workbench.all_referentials.each_with_index do |referential, i| + - @referentials.each_with_index do |referential, i| = link_to referential.name, referential_path(referential), class: 'list-group-item' if i < 6 - else |
