From a7f270bac47c3cb4b30245ab35bfa363b390d14a Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Mon, 17 Jul 2017 12:26:16 +0200 Subject: [PATCH] Follow: user new dossier follow controller instead of backoffice --- app/views/backoffice/dossiers/_list.html.haml | 4 ++-- .../_navbar_backoffice_dossierscontroller_show.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/backoffice/dossiers/_list.html.haml b/app/views/backoffice/dossiers/_list.html.haml index e0de9c639..5b284ffbd 100644 --- a/app/views/backoffice/dossiers/_list.html.haml +++ b/app/views/backoffice/dossiers/_list.html.haml @@ -53,9 +53,9 @@ %td.center - if current_gestionnaire.follow?(dossier) - = link_to('Quitter', backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-danger', id: "suivre_dossier_#{dossier.id}") + = link_to('Quitter', unfollow_dossier_path(dossier.procedure, dossier), method: :patch, class: 'btn-sm btn-danger', id: "suivre_dossier_#{dossier.id}") - else - = link_to('Suivre', backoffice_dossier_follow_path(dossier_id: dossier.id), 'data-method' => :put, class: 'btn-sm btn-primary', id: "suivre_dossier_#{dossier.id}") + = link_to('Suivre', follow_dossier_path(dossier.procedure, dossier), method: :patch, class: 'btn-sm btn-primary', id: "suivre_dossier_#{dossier.id}") %td.center{ style: "color: #{dossier.total_follow == 0 ? 'red' : ''}" } = dossier.total_follow diff --git a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml index e8a675677..378fe9421 100644 --- a/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml +++ b/app/views/layouts/navbars/_navbar_backoffice_dossierscontroller_show.html.haml @@ -5,11 +5,11 @@ .row .col-xs-12 - if current_gestionnaire.follow?(@facade.dossier) - = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), "data-method" => :put, class: "button-navbar-action", id: "suivre_dossier_#{@facade.dossier.id}" do + = link_to unfollow_dossier_path(@facade.dossier.procedure, @facade.dossier), method: :patch, class: "button-navbar-action", id: "suivre_dossier_#{@facade.dossier.id}" do %i.fa.fa-user-times Ne plus suivre - else - = link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'button-navbar-action', id: "suivre_dossier_#{@facade.dossier.id}" do + = link_to follow_dossier_path(@facade.dossier.procedure, @facade.dossier), method: :patch, class: 'button-navbar-action', id: "suivre_dossier_#{@facade.dossier.id}" do %i.fa.fa-user-plus Suivre le dossier .row