aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2018-03-05 21:47:50 +0100
committerAlban Peignier2018-03-05 21:50:13 +0100
commit4a9b3e5868e379fa41b214b35d3ded60d8464a64 (patch)
tree237646af446f390c97b506cec2e23e36f1c86b84
parent1733f285e673131f869c60330e25808bb56fc8d7 (diff)
downloadchouette-core-4a9b3e5868e379fa41b214b35d3ded60d8464a64.tar.bz2
Use Workbench#calendars in STIF::Dashboard. Refs #6064
-rw-r--r--app/views/stif/dashboards/_dashboard.html.slim2
-rw-r--r--lib/stif/dashboard.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/stif/dashboards/_dashboard.html.slim b/app/views/stif/dashboards/_dashboard.html.slim
index 83a2106bb..e0f754fd4 100644
--- a/app/views/stif/dashboards/_dashboard.html.slim
+++ b/app/views/stif/dashboards/_dashboard.html.slim
@@ -57,7 +57,7 @@
.panel-heading
h3.panel-title.with_actions
= I18n.t("calendars.index.title")
- span.badge.ml-xs = @dashboard.calendars.count if @dashboard.calendars.present?
+ span.badge.ml-xs = @dashboard.workbench.calendars.count if @dashboard.calendars.present?
div
= link_to '', workgroup_calendars_path(@dashboard.workbench.workgroup), class: ' fa fa-chevron-right pull-right', title: t('.see')
diff --git a/lib/stif/dashboard.rb b/lib/stif/dashboard.rb
index 2f5792547..f558b79fb 100644
--- a/lib/stif/dashboard.rb
+++ b/lib/stif/dashboard.rb
@@ -13,7 +13,7 @@ module Stif
end
def calendars
- @calendars ||= Calendar.where('(organisation_id = ? OR shared = ?) AND workgroup_id = ?', current_organisation.id, true, workgroup.id)
+ workbench.calendars
end
end
end