diff --git a/.travis.yml b/.travis.yml index 50299bc..453b68d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ before_script: - cp config/database_example.yml config/database.yml - cp config/secrets_example.yml config/secrets.yml + - cp config/branding_example.yml config/branding.yml - cp config/initializers/devise.rb.example config/initializers/devise.rb - cp config/initializers/recaptcha.rb.example config/initializers/recaptcha.rb - cp config/initializers/wicked_pdf.rb.example config/initializers/wicked_pdf.rb diff --git a/app/controllers/phases_controller.rb b/app/controllers/phases_controller.rb index afe9711..0865211 100644 --- a/app/controllers/phases_controller.rb +++ b/app/controllers/phases_controller.rb @@ -150,12 +150,15 @@ def admin_create @phase = Phase.new(params[:phase]) authorize @phase + @phase.description = params["phase-desc"] @phase.modifiable = true if @phase.save redirect_to admin_show_phase_path(id: @phase.id, edit: 'true'), notice: _('Information was successfully created.') else - render action: "admin_show" + flash[:notice] = _('Unable to save your changes.') + @template = @phase.template + render "admin_add" end end @@ -168,7 +171,8 @@ if @phase.update_attributes(params[:phase]) redirect_to admin_show_phase_path(@phase), notice: _('Information was successfully updated.') else - render action: "admin_show" + # Redirecting here because the method loads a lot of stuff. We may lose whatever the user had entered though + redirect_to admin_show_phase_path(id: @phase.id, edit: 'true'), notice: _('Unable to save your changes.') end end