aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorLuc Donnet2018-02-20 10:38:45 +0100
committerGitHub2018-02-20 10:38:45 +0100
commitd5ff5c82041a9807dbb8bb9a598b74e99ad538f9 (patch)
tree8386fe81d95460b60c77a62385a8f3e8f2df055f /app/helpers
parentd0163321a875a64b8f1e15a614d18663d013da3c (diff)
parent5404087a961c831b10c3d597f3113f05b6b02102 (diff)
downloadchouette-core-d5ff5c82041a9807dbb8bb9a598b74e99ad538f9.tar.bz2
Merge pull request #294 from af83/5863-use-shallow-urls-for-referentials
5863 Remove workbench id from the querystring
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/referentials_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/referentials_helper.rb b/app/helpers/referentials_helper.rb
index 8251377aa..e464ec8a5 100644
--- a/app/helpers/referentials_helper.rb
+++ b/app/helpers/referentials_helper.rb
@@ -15,4 +15,14 @@ module ReferentialsHelper
service = ReferentialOverview.new referential, self
render partial: "referentials/overview", locals: {referential: referential, overview: service}
end
+
+ def mutual_workbench workbench
+ current_user.organisation.workbenches.where(workgroup_id: workbench.workgroup_id).last
+ end
+
+ def duplicate_workbench_referential_path referential
+ workbench = mutual_workbench referential.workbench
+ raise "Missing workbench for referential #{referential.name}" unless workbench.present?
+ new_workbench_referential_path(workbench, from: referential.id)
+ end
end