diff options
| author | Luc Donnet | 2016-11-18 18:22:54 +0100 |
|---|---|---|
| committer | Luc Donnet | 2016-11-18 18:22:54 +0100 |
| commit | 129d7bfe13a2b7e92ec696ef91bfa9211a6ff07e (patch) | |
| tree | b079c2e55c6ad1b0a53f3f781dd63360f65d34ee /app/controllers | |
| parent | d4f49e51d138050a6c27fef2573649e607d56381 (diff) | |
| parent | a6f8318aa267e3723eb4c10647447ff08cd5fdca (diff) | |
| download | chouette-core-129d7bfe13a2b7e92ec696ef91bfa9211a6ff07e.tar.bz2 | |
Merge branch 'master' of github.com:AF83/stif-boiv
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/lines_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/referential_lines_controller.rb | 4 | ||||
| -rw-r--r-- | app/controllers/referentials_controller.rb | 18 | ||||
| -rw-r--r-- | app/controllers/vehicle_journey_frequencies_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/vehicle_journeys_controller.rb | 2 | ||||
| -rw-r--r-- | app/controllers/workbenches_controller.rb | 2 |
6 files changed, 19 insertions, 13 deletions
diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 1a5c30787..eb38352be 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -73,7 +73,7 @@ class LinesController < BreadcrumbController end def collection - %w(network_id company_id group_of_lines_id comment_id transport_mode_name).each do |filter| + %w(network_id company_id group_of_lines_id comment_id transport_mode).each do |filter| if params[:q] && params[:q]["#{filter}_eq"] == '-1' params[:q]["#{filter}_eq"] = '' params[:q]["#{filter}_blank"] = '1' @@ -91,7 +91,7 @@ class LinesController < BreadcrumbController end def line_params - params.require(:line).permit( :transport_mode, :network_id, :company_id, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :transport_mode_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs, :flexible_service, :group_of_lines, :group_of_line_ids, :group_of_line_tokens, :url, :color, :text_color, :stable_id, { footnotes_attributes: [ :code, :label, :_destroy, :id ] } ) + params.require(:line).permit( :transport_mode, :network_id, :company_id, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :transport_mode, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs, :flexible_service, :group_of_lines, :group_of_line_ids, :group_of_line_tokens, :url, :color, :text_color, :stable_id, { footnotes_attributes: [ :code, :label, :_destroy, :id ] } ) end end diff --git a/app/controllers/referential_lines_controller.rb b/app/controllers/referential_lines_controller.rb index c53819dd2..d767cb151 100644 --- a/app/controllers/referential_lines_controller.rb +++ b/app/controllers/referential_lines_controller.rb @@ -67,7 +67,7 @@ class ReferentialLinesController < ChouetteController end def collection - %w(network_id company_id group_of_lines_id comment_id transport_mode_name).each do |filter| + %w(network_id company_id group_of_lines_id comment_id transport_mode).each do |filter| if params[:q] && params[:q]["#{filter}_eq"] == '-1' params[:q]["#{filter}_eq"] = '' params[:q]["#{filter}_blank"] = '1' @@ -92,7 +92,7 @@ class ReferentialLinesController < ChouetteController :creator_id, :name, :number, :published_name, - :transport_mode_name, + :transport_mode, :registration_number, :comment, :mobility_restricted_suitability, diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index ab494ac2e..74eb36aa6 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -15,10 +15,9 @@ class ReferentialsController < BreadcrumbController end end - def create - - create! - end + # def create + # create! + # end def show resource.switch @@ -34,13 +33,20 @@ class ReferentialsController < BreadcrumbController end end + def destroy + workbench = referential.workbench_id + + referential.destroy! + redirect_to workbench_path(workbench), notice: t('notice.referential.deleted') + end + def archive referential.archive! - redirect_to referential_path, notice: t('notice.referential.archived') + redirect_to workbench_path(referential.workbench_id), notice: t('notice.referential.archived') end def unarchive referential.unarchive! - redirect_to referential_path, notice: t('notice.referential.unarchived') + redirect_to workbench_path(referential.workbench_id), notice: t('notice.referential.unarchived') end protected diff --git a/app/controllers/vehicle_journey_frequencies_controller.rb b/app/controllers/vehicle_journey_frequencies_controller.rb index 683bd6d5a..9626bd36d 100644 --- a/app/controllers/vehicle_journey_frequencies_controller.rb +++ b/app/controllers/vehicle_journey_frequencies_controller.rb @@ -12,7 +12,7 @@ class VehicleJourneyFrequenciesController < VehicleJourneysController def vehicle_journey_frequency_params params.require(:vehicle_journey_frequency).permit( { footnote_ids: [] } , :journey_pattern_id, :number, :published_journey_name, - :published_journey_identifier, :comment, :transport_mode_name, + :published_journey_identifier, :comment, :transport_mode, :mobility_restricted_suitability, :flexible_service, :status_value, :facility, :vehicle_type_identifier, :objectid, :time_table_tokens, { date: [ :hour, :minute ] }, :button, :referential_id, :line_id, diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb index 036816b21..d1c54827b 100644 --- a/app/controllers/vehicle_journeys_controller.rb +++ b/app/controllers/vehicle_journeys_controller.rb @@ -81,7 +81,7 @@ class VehicleJourneysController < ChouetteController def vehicle_journey_params params.require(:vehicle_journey).permit( { footnote_ids: [] } , :journey_pattern_id, :number, :published_journey_name, - :published_journey_identifier, :comment, :transport_mode_name, + :published_journey_identifier, :comment, :transport_mode, :mobility_restricted_suitability, :flexible_service, :status_value, :facility, :vehicle_type_identifier, :objectid, :time_table_tokens, { date: [ :hour, :minute ] }, :button, :referential_id, :line_id, diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb index b23e9202e..b2bf5eab8 100644 --- a/app/controllers/workbenches_controller.rb +++ b/app/controllers/workbenches_controller.rb @@ -4,7 +4,7 @@ class WorkbenchesController < BreadcrumbController respond_to :html, :only => [:show] def show - @wbench_refs = Workbench.find(params[:id]).referentials.paginate(page: params[:page], per_page: 2) + @wbench_refs = Workbench.find(params[:id]).referentials.paginate(page: params[:page], per_page: 20) show! do build_breadcrumb :show |
