diff options
| author | Xinhui | 2016-10-11 12:04:46 +0200 |
|---|---|---|
| committer | Xinhui | 2016-10-11 12:04:46 +0200 |
| commit | 4655372a601bbdf90d352abe8fefed094b866d69 (patch) | |
| tree | 6aebf15ad738bc26fb8a3f308a0d58f7b95c4861 | |
| parent | 84fffe95839ebc80f99fa14c25e0646cafc11099 (diff) | |
| download | chouette-core-4655372a601bbdf90d352abe8fefed094b866d69.tar.bz2 | |
Remove cancel sync link
| -rw-r--r-- | app/controllers/line_referentials_controller.rb | 7 | ||||
| -rw-r--r-- | app/controllers/stop_area_referentials_controller.rb | 8 | ||||
| -rw-r--r-- | app/models/line_referential_sync.rb | 4 | ||||
| -rw-r--r-- | app/models/stop_area_referential_sync.rb | 4 | ||||
| -rw-r--r-- | app/views/line_referentials/show.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_area_referentials/show.html.slim | 4 | ||||
| -rw-r--r-- | config/routes.rb | 2 |
7 files changed, 1 insertions, 30 deletions
diff --git a/app/controllers/line_referentials_controller.rb b/app/controllers/line_referentials_controller.rb index 4cd11b31b..fc4ab3cf5 100644 --- a/app/controllers/line_referentials_controller.rb +++ b/app/controllers/line_referentials_controller.rb @@ -12,13 +12,6 @@ class LineReferentialsController < BreadcrumbController redirect_to resource end - # Todo - # For testing, remove me - def cancel_sync - resource.last_sync.destroy - redirect_to resource - end - protected def begin_of_chain diff --git a/app/controllers/stop_area_referentials_controller.rb b/app/controllers/stop_area_referentials_controller.rb index 5d66c8e90..5c87be43d 100644 --- a/app/controllers/stop_area_referentials_controller.rb +++ b/app/controllers/stop_area_referentials_controller.rb @@ -11,15 +11,7 @@ class StopAreaReferentialsController < BreadcrumbController redirect_to resource end - # Todo - # For testing, remove me - def cancel_sync - resource.last_sync.destroy - redirect_to resource - end - protected - def begin_of_chain current_organisation end diff --git a/app/models/line_referential_sync.rb b/app/models/line_referential_sync.rb index 7d0c1ba1f..03fea6a97 100644 --- a/app/models/line_referential_sync.rb +++ b/app/models/line_referential_sync.rb @@ -6,10 +6,6 @@ class LineReferentialSync < ActiveRecord::Base after_commit :perform_sync, :on => :create validate :multiple_process_validation, :on => :create - def can_be_canceled? - [:new, :pending].include? self.status.to_sym - end - private def perform_sync create_sync_message :info, :new diff --git a/app/models/stop_area_referential_sync.rb b/app/models/stop_area_referential_sync.rb index 840a159b7..ad99dbb8c 100644 --- a/app/models/stop_area_referential_sync.rb +++ b/app/models/stop_area_referential_sync.rb @@ -6,10 +6,6 @@ class StopAreaReferentialSync < ActiveRecord::Base after_commit :perform_sync, :on => :create validate :multiple_process_validation, :on => :create - def can_be_canceled? - [:new, :pending].include? self.status.to_sym - end - private def perform_sync create_sync_message :info, :new diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 0ad88ecc8..3073c3d5a 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -41,5 +41,3 @@ ul.actions li = link_to t('line_referentials.actions.edit'), edit_line_referential_path(@line_referential), class: 'edit' li = link_to t('line_referentials.actions.sync'), sync_line_referential_path(@line_referential), class: 'sync', method: :post - - if @line_referential.last_sync && @line_referential.last_sync.can_be_canceled? - li = link_to t('line_referentials.actions.cancel_sync'), cancel_sync_line_referential_path(@line_referential), class: 'cancel_sync', method: :post diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index e9fa17fa6..9cceed5e5 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -22,11 +22,9 @@ / [:processing_time] unit conversion - data = log.message_attributs.symbolize_keys! - data[:processing_time] = distance_of_time_in_words(data[:processing_time].to_i) - + = t("stop_area_referential_sync.message.#{log.message_key}", log.message_attributs.symbolize_keys!) - 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 c4f2ce1fd..196e73997 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -55,13 +55,11 @@ 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 resources :line_referentials, :only => [:show, :edit, :update] do post :sync, on: :member - post :cancel_sync, on: :member resources :lines resources :group_of_lines resources :companies |
