From bf37e97d8a86814b1bc2f844cbcff86ab0a43266 Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 3 Oct 2014 14:37:12 +0200 Subject: duplicate calendar will open new form and not edit form , Mantis 29110 --- app/assets/stylesheets/main/time_tables.css.scss | 2 +- app/controllers/time_tables_controller.rb | 6 +++--- app/views/time_tables/_form.erb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/main/time_tables.css.scss b/app/assets/stylesheets/main/time_tables.css.scss index 9161f03ab..bc1f48810 100644 --- a/app/assets/stylesheets/main/time_tables.css.scss +++ b/app/assets/stylesheets/main/time_tables.css.scss @@ -79,7 +79,7 @@ } } -#workspace.time_tables.edit,#workspace.time_tables.new,#workspace.time_tables.create,#workspace.time_tables.update +#workspace.time_tables.edit,#workspace.time_tables.new,#workspace.time_tables.create,#workspace.time_tables.update,#workspace.time_tables.duplicate { fieldset.inputs{ overflow: visible !important; diff --git a/app/controllers/time_tables_controller.rb b/app/controllers/time_tables_controller.rb index 54b0a3bac..be1738060 100644 --- a/app/controllers/time_tables_controller.rb +++ b/app/controllers/time_tables_controller.rb @@ -46,10 +46,10 @@ class TimeTablesController < ChouetteController def duplicate @time_table = Chouette::TimeTable.find params[:id] + # prepare breadcrumb before prepare data for new timetable + build_breadcrumb :edit @time_table = @time_table.duplicate - @time_table.save - flash[:notice] = I18n.translate("time_tables.duplicate_success") - redirect_to edit_referential_time_table_path(@referential, @time_table) + render :new end def tags diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb index 003bfb09f..7dceab747 100644 --- a/app/views/time_tables/_form.erb +++ b/app/views/time_tables/_form.erb @@ -33,7 +33,7 @@