diff options
| author | Xinhui | 2016-10-11 14:32:48 +0200 |
|---|---|---|
| committer | Xinhui | 2016-10-11 14:32:48 +0200 |
| commit | 3c585b26cf7705b371f7798061df7c6c225f381f (patch) | |
| tree | 105d2c834595a7b8f6eb0ebb4c16060d571a36dc | |
| parent | 4655372a601bbdf90d352abe8fefed094b866d69 (diff) | |
| download | chouette-core-3c585b26cf7705b371f7798061df7c6c225f381f.tar.bz2 | |
Reflex:sync - restore cancel button for testing
| -rw-r--r-- | app/controllers/stop_area_referentials_controller.rb | 5 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 2 | ||||
| -rw-r--r-- | config/routes.rb | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/stop_area_referentials_controller.rb b/app/controllers/stop_area_referentials_controller.rb index 5c87be43d..f8c4d0d06 100644 --- a/app/controllers/stop_area_referentials_controller.rb +++ b/app/controllers/stop_area_referentials_controller.rb @@ -11,6 +11,11 @@ class StopAreaReferentialsController < BreadcrumbController redirect_to resource end + def cancel_sync + resource.last_sync.destroy + redirect_to resource + end + protected def begin_of_chain current_organisation diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 9cceed5e5..584f53410 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -28,3 +28,5 @@ - content_for :sidebar do ul.actions li = link_to t('stop_area_referentials.actions.sync'), sync_stop_area_referential_path(@stop_area_referential), class: 'sync', method: :post + - if @stop_area_referential.last_sync + li = link_to t('stop_area_referentials.actions.cancel_sync'), cancel_sync_stop_area_referential_path(@stop_area_referential), class: 'cancel_sync', method: :post diff --git a/config/routes.rb b/config/routes.rb index 196e73997..d60331a4f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -55,6 +55,7 @@ ChouetteIhm::Application.routes.draw do resources :stop_area_referentials, :only => [:show] do post :sync, on: :member + post :cancel_sync, on: :member resources :stop_areas end |
