aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/referential_stop_areas
diff options
context:
space:
mode:
authorTeddy Wing2017-07-11 19:21:10 +0200
committerTeddy Wing2017-07-12 11:11:14 +0200
commit9fed0c184323de9e5e0bcfe83465cb4e2b153590 (patch)
tree6aba8417d8671f749b2945da018754b7dd60e298 /app/views/referential_stop_areas
parent0970ba4be6b152e1f3aea0f10e8471e68dc60c4b (diff)
downloadchouette-core-9fed0c184323de9e5e0bcfe83465cb4e2b153590.tar.bz2
ReferentialStopAreas#show: Render header buttons from decorator
Since we already have the decorator available, get the links from there for better code reuse. Refs #3479
Diffstat (limited to 'app/views/referential_stop_areas')
-rw-r--r--app/views/referential_stop_areas/show.html.slim14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim
index 7932b6c2e..d594665f7 100644
--- a/app/views/referential_stop_areas/show.html.slim
+++ b/app/views/referential_stop_areas/show.html.slim
@@ -5,14 +5,12 @@
.row
.col-lg-12.text-right.mb-sm
- - if policy(Chouette::StopArea).new?
- = link_to t('stop_areas.actions.new'), new_stop_area_referential_stop_area_path(@stop_area_referential), class: 'btn btn-primary'
- - if policy(@stop_area).update?
- = link_to t('stop_areas.actions.edit'), edit_stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), class: 'btn btn-primary'
- - if policy(@stop_area).destroy?
- = link_to stop_area_referential_stop_area_path(@stop_area_referential, @stop_area), method: :delete, data: {confirm: t('stop_areas.actions.destroy_confirm')}, class: 'btn btn-primary' do
- span.fa.fa-trash
- span = t('stop_areas.actions.destroy')
+ - @stop_area.action_links.each do |link|
+ = link_to link.href,
+ method: link.method,
+ data: link.data,
+ class: 'btn btn-primary' do
+ = link.content
/ PageContent
.page_content