aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-02-27 08:26:40 +0100
committerZog2018-02-27 08:27:12 +0100
commit1b0d2b5c591e9b4a5b56ae6f133cd93cc033f765 (patch)
treed2a8c46c25541d65630e2be1eceb2955c33520dc
parent206bf218e1b84dbe53683ec2e3f983cd30f7ded1 (diff)
downloadchouette-core-1b0d2b5c591e9b4a5b56ae6f133cd93cc033f765.tar.bz2
Refs #5940; Add missing flash after Calendar creation5940-add-missing-flash
-rw-r--r--app/controllers/calendars_controller.rb11
-rw-r--r--app/views/calendars/_form_advanced.html.slim2
2 files changed, 7 insertions, 6 deletions
diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb
index 75d4cbd09..cc7570d65 100644
--- a/app/controllers/calendars_controller.rb
+++ b/app/controllers/calendars_controller.rb
@@ -31,10 +31,11 @@ class CalendarsController < ChouetteController
end
def create
- create! do
- if @calendar.valid? && has_feature?('application_days_on_calendars')
- redirect_to([:edit, @calendar])
- return
+ create! do |success, failure|
+ if has_feature?('application_days_on_calendars')
+ success.html do
+ redirect_to([:edit, @workgroup, @calendar])
+ end
end
end
end
@@ -125,4 +126,4 @@ class CalendarsController < ChouetteController
scope
end
-end \ No newline at end of file
+end
diff --git a/app/views/calendars/_form_advanced.html.slim b/app/views/calendars/_form_advanced.html.slim
index e796e2e36..aa4fd4e40 100644
--- a/app/views/calendars/_form_advanced.html.slim
+++ b/app/views/calendars/_form_advanced.html.slim
@@ -3,6 +3,6 @@
= javascript_tag do
| window.actionType = "#{raw params[:action]}";
// | window.I18n = #{(I18n.backend.send(:translations)[I18n.locale].to_json).html_safe};
- | window.timetablesUrl = "#{calendar_url(@calendar).html_safe}";
+ | window.timetablesUrl = "#{workgroup_calendar_url(@workgroup, @calendar).html_safe}";
= javascript_pack_tag 'calendars/edit.js'