mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Change all redirect_to(path) to redirect path for uniformity
This commit is contained in:
parent
434eb90b76
commit
19c54bd935
23 changed files with 128 additions and 125 deletions
|
|
@ -34,8 +34,8 @@ module Admin
|
|||
if @cfp.update_attributes(call_for_paper_params)
|
||||
Mailbot.delay.send_on_call_for_papers_dates_updated(@conference) if send_mail_on_cfp_dates_updated
|
||||
Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
|
||||
redirect_to(admin_conference_call_for_paper_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.')
|
||||
redirect_to admin_conference_call_for_paper_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.'
|
||||
else
|
||||
flash[:error] = "Updating call for papers failed. #{@cfp.errors.to_a.join('. ')}."
|
||||
render :new
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ module Admin
|
|||
@campaign.attributes = campaign_params
|
||||
|
||||
if @conference.save
|
||||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: 'Campaign successfully created.')
|
||||
redirect_to admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: 'Campaign successfully created.'
|
||||
else
|
||||
flash[:error] = 'Campaign creation failed. ' + @campaign.errors.full_messages.to_sentence
|
||||
render action: 'new'
|
||||
|
|
@ -26,8 +26,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @campaign.update_attributes(campaign_params)
|
||||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: "Campaign '#{@campaign.name}' successfully updated.")
|
||||
redirect_to admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: "Campaign '#{@campaign.name}' successfully updated."
|
||||
else
|
||||
flash[:error] = "Campaign update failed. #{@campaign.errors.full_messages.to_sentence}"
|
||||
render action: 'edit'
|
||||
|
|
@ -36,12 +36,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @campaign.destroy
|
||||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: "Campaign '#{@campaign.name}' successfully deleted.")
|
||||
redirect_to admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
notice: "Campaign '#{@campaign.name}' successfully deleted."
|
||||
else
|
||||
redirect_to(admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_campaigns_path(conference_id: @conference.short_title),
|
||||
error: "Delete of Campaign for #{@conference.short_title} failed."\
|
||||
"#{@campaign.errors.full_messages.join('. ')}.")
|
||||
"#{@campaign.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ module Admin
|
|||
|
||||
if @cfp.update_attributes(cfp_params)
|
||||
Mailbot.delay.send_on_cfps_dates_updates(@conference) if send_mail_on_cfp_dates_updates
|
||||
redirect_to(admin_conference_program_cfp_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.')
|
||||
redirect_to admin_conference_program_cfp_path(@conference.short_title),
|
||||
notice: 'Call for papers successfully updated.'
|
||||
else
|
||||
flash[:error] = "Updating call for papers failed. #{@cfp.errors.to_a.join('. ')}."
|
||||
render :new
|
||||
|
|
|
|||
|
|
@ -86,12 +86,12 @@ module Admin
|
|||
|
||||
if @conference.update_attributes(conference_params)
|
||||
Mailbot.delay.conference_date_update_mail(@conference) if send_mail_on_conf_update
|
||||
redirect_to(edit_admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.')
|
||||
redirect_to edit_admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully updated.'
|
||||
else
|
||||
redirect_to(edit_admin_conference_path(id: short_title),
|
||||
redirect_to edit_admin_conference_path(id: short_title),
|
||||
alert: 'Updating conference failed. ' \
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
"#{@conference.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ module Admin
|
|||
def create
|
||||
@difficulty_level = @conference.program.difficulty_levels.new(difficulty_level_params)
|
||||
if @difficulty_level.save
|
||||
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully created.')
|
||||
redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating difficulty level failed: #{@difficulty_level.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -27,8 +27,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @difficulty_level.update_attributes(difficulty_level_params)
|
||||
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully updated.')
|
||||
redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update difficulty level failed: #{@difficulty_level.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -37,12 +37,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @difficulty_level.destroy
|
||||
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully deleted.')
|
||||
redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Difficulty level successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
|
||||
error: 'Deleting difficulty level type failed! '\
|
||||
"#{@difficulty_level.errors.full_messages.join('. ')}.")
|
||||
"#{@difficulty_level.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ module Admin
|
|||
|
||||
def update
|
||||
@conference.email_settings.update_attributes(email_params)
|
||||
redirect_to(admin_conference_emails_path(
|
||||
redirect_to admin_conference_emails_path(
|
||||
@conference.short_title),
|
||||
notice: 'Settings have been successfully updated.')
|
||||
notice: 'Settings have been successfully updated.'
|
||||
end
|
||||
|
||||
def index
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ module Admin
|
|||
def create
|
||||
@event_type = @conference.program.event_types.new(event_type_params)
|
||||
if @event_type.save
|
||||
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully created.')
|
||||
redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating event type failed: #{@event_type.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -25,8 +25,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @event_type.update_attributes(event_type_params)
|
||||
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully updated.')
|
||||
redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update event type failed: #{@event_type.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -35,12 +35,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @event_type.destroy
|
||||
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully deleted.')
|
||||
redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
notice: 'Event type successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
|
||||
error: 'Destroying event type failed! '\
|
||||
"#{@event_type.errors.full_messages.join('. ')}.")
|
||||
"#{@event_type.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -182,8 +182,9 @@ module Admin
|
|||
def get_event
|
||||
@event = @conference.program.events.find(params[:id])
|
||||
if !@event
|
||||
redirect_to(admin_conference_program_events_path(conference_id: @conference.short_title),
|
||||
alert: 'Error! Could not find event!') && return
|
||||
redirect_to admin_conference_program_events_path(conference_id: @conference.short_title),
|
||||
alert: 'Error! Could not find event!'
|
||||
return
|
||||
end
|
||||
@event
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ module Admin
|
|||
def create
|
||||
@lodging = @conference.lodgings.new(lodging_params)
|
||||
if @lodging.save
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully created.')
|
||||
redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating Lodging failed: #{@lodging.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -25,8 +25,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @lodging.update_attributes(lodging_params)
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully updated.')
|
||||
redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update Lodging failed: #{@lodging.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -35,12 +35,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @lodging.destroy
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully deleted.')
|
||||
redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
notice: 'Lodging successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
|
||||
error: 'Deleting lodging failed.' \
|
||||
"#{@lodging.errors.full_messages.join('. ')}.")
|
||||
"#{@lodging.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ module Admin
|
|||
|
||||
if @program.update_attributes(program_params)
|
||||
# Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
|
||||
redirect_to(admin_conference_program_path(@conference.short_title),
|
||||
notice: 'The program was successfully updated.')
|
||||
redirect_to admin_conference_program_path(@conference.short_title),
|
||||
notice: 'The program was successfully updated.'
|
||||
else
|
||||
flash[:error] = "Updating program failed. #{@program.errors.to_a.join('. ')}."
|
||||
render :new
|
||||
|
|
|
|||
|
|
@ -40,16 +40,16 @@ module Admin
|
|||
# GET questions/1/edit
|
||||
def edit
|
||||
if @question.global
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), alert: 'Sorry, you cannot edit global questions. Create a new one.')
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), alert: 'Sorry, you cannot edit global questions. Create a new one.'
|
||||
end
|
||||
end
|
||||
|
||||
# PUT questions/1
|
||||
def update
|
||||
if @question.update_attributes(question_params)
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated.")
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Question '#{@question.title}' for #{@conference.short_title} successfully updated."
|
||||
else
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed. #{@question.errors.full_messages.join('. ')}")
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed. #{@question.errors.full_messages.join('. ')}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ module Admin
|
|||
def update_conference
|
||||
authorize! :update, Question.new(conference_id: @conference.id)
|
||||
if @conference.update_attributes(conference_params)
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated.")
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Questions for #{@conference.short_title} successfully updated."
|
||||
else
|
||||
redirect_to(admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed.")
|
||||
redirect_to admin_conference_questions_path(conference_id: @conference.short_title), notice: "Update of questions for #{@conference.short_title} failed."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ module Admin
|
|||
redirect_to admin_conference_registrations_path(@conference.short_title),
|
||||
notice: "Deleted registration for #{@user.name}!"
|
||||
else
|
||||
redirect_to(admin_conference_registrations_path(@conference.short_title),
|
||||
error: 'You must be an admin to delete a registration.')
|
||||
redirect_to admin_conference_registrations_path(@conference.short_title),
|
||||
error: 'You must be an admin to delete a registration.'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -35,14 +35,16 @@ module Admin
|
|||
state = user_params[:state]
|
||||
|
||||
unless user
|
||||
redirect_to(admin_conference_role_path(@conference.short_title, @role.name),
|
||||
error: 'Could not find user. Please provide a valid email!') && return
|
||||
redirect_to admin_conference_role_path(@conference.short_title, @role.name),
|
||||
error: 'Could not find user. Please provide a valid email!'
|
||||
return
|
||||
end
|
||||
|
||||
# The conference must have at least 1 organizer
|
||||
if @role.name == 'organizer' && state == 'false' && @role.users.count == 1
|
||||
redirect_to(admin_conference_role_path(@conference.short_title, @role.name),
|
||||
error: 'The conference must have at least 1 organizer!') && return
|
||||
redirect_to admin_conference_role_path(@conference.short_title, @role.name),
|
||||
error: 'The conference must have at least 1 organizer!'
|
||||
return
|
||||
end
|
||||
|
||||
# Remove user
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ module Admin
|
|||
def create
|
||||
@room = @venue.rooms.new(room_params)
|
||||
if @room.save
|
||||
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully created.')
|
||||
redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating Room failed: #{@room.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -25,8 +25,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @room.update_attributes(room_params)
|
||||
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully updated.')
|
||||
redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update Room failed: #{@room.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -35,11 +35,11 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @room.destroy
|
||||
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully deleted.')
|
||||
redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
notice: 'Room successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
error: "Destroying room failed! #{@room.errors.full_messages.join('. ')}.")
|
||||
redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
|
||||
error: "Destroying room failed! #{@room.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module Admin
|
|||
def create
|
||||
@sponsor = @conference.sponsors.new(sponsor_params)
|
||||
if @sponsor.save
|
||||
redirect_to(admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully created.')
|
||||
redirect_to admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating sponsor failed: #{@sponsor.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -26,9 +26,9 @@ module Admin
|
|||
|
||||
def update
|
||||
if @sponsor.update_attributes(sponsor_params)
|
||||
redirect_to(admin_conference_sponsors_path(
|
||||
redirect_to admin_conference_sponsors_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully updated.')
|
||||
notice: 'Sponsor successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update sponsor failed: #{@sponsor.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -37,12 +37,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @sponsor.destroy
|
||||
redirect_to(admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully deleted.')
|
||||
redirect_to admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsor successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_sponsors_path(conference_id: @conference.short_title),
|
||||
error: 'Deleting sponsor failed! ' \
|
||||
"#{@sponsor.errors.full_messages.join('. ')}.")
|
||||
"#{@sponsor.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ module Admin
|
|||
def create
|
||||
@sponsorship_level = @conference.sponsorship_levels.new(sponsorship_level_params)
|
||||
if @sponsorship_level.save
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully created.')
|
||||
redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating Sponsorship Level failed: #{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -26,9 +26,9 @@ module Admin
|
|||
|
||||
def update
|
||||
if @sponsorship_level.update_attributes(sponsorship_level_params)
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
redirect_to admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully updated.')
|
||||
notice: 'Sponsorship level successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update Sponsorship level failed: #{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -37,23 +37,23 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @sponsorship_level.destroy
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully deleted.')
|
||||
redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship level successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
|
||||
error: 'Deleting sponsorship level failed! ' \
|
||||
"#{@sponsorship_level.errors.full_messages.join('. ')}.")
|
||||
"#{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
def up
|
||||
@sponsorship_level.move_higher
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title))
|
||||
redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title)
|
||||
end
|
||||
|
||||
def down
|
||||
@sponsorship_level.move_lower
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title))
|
||||
redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ module Admin
|
|||
def create
|
||||
@target = @conference.targets.new(target_params)
|
||||
if @target.save(target_params)
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully created.')
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating target failed: #{@target.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -24,8 +24,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @target.update_attributes(target_params)
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully updated.')
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully updated.'
|
||||
else
|
||||
flash[:error] = "Target update failed: #{@target.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -34,8 +34,8 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @target.destroy
|
||||
redirect_to(admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully destroyed.')
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
notice: 'Target successfully destroyed.'
|
||||
else
|
||||
redirect_to admin_conference_targets_path(conference_id: @conference.short_title),
|
||||
error: "Could not delete target for #{@conference.title}: "\
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ module Admin
|
|||
def create
|
||||
@ticket = @conference.tickets.new(ticket_params)
|
||||
if @ticket.save(ticket_params)
|
||||
redirect_to(admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully created.')
|
||||
redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating Ticket failed: #{@ticket.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -26,8 +26,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @ticket.update_attributes(ticket_params)
|
||||
redirect_to(admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully updated.')
|
||||
redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully updated.'
|
||||
else
|
||||
flash[:error] = "Ticket update failed: #{@ticket.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -36,12 +36,12 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @ticket.destroy
|
||||
redirect_to(admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully destroyed.')
|
||||
redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
notice: 'Ticket successfully destroyed.'
|
||||
else
|
||||
redirect_to(admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
|
||||
error: 'Ticket was successfully destroyed.' \
|
||||
"#{@ticket.errors.full_messages.join('. ')}.")
|
||||
"#{@ticket.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ module Admin
|
|||
def create
|
||||
@track = @program.tracks.new(track_params)
|
||||
if @track.save
|
||||
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully created.')
|
||||
redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully created.'
|
||||
else
|
||||
flash[:error] = "Creating Track failed: #{@track.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
|
|
@ -32,8 +32,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @track.update_attributes(track_params)
|
||||
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully updated.')
|
||||
redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully updated.'
|
||||
else
|
||||
flash[:error] = "Track update failed: #{@track.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
@ -42,11 +42,11 @@ module Admin
|
|||
|
||||
def destroy
|
||||
if @track.destroy
|
||||
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully deleted.')
|
||||
redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
notice: 'Track successfully deleted.'
|
||||
else
|
||||
redirect_to(admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
error: "Track couldn't be deleted. #{@track.errors.full_messages.join('. ')}.")
|
||||
redirect_to admin_conference_program_tracks_path(conference_id: @conference.short_title),
|
||||
error: "Track couldn't be deleted. #{@track.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ module Admin
|
|||
|
||||
def update
|
||||
if @venue.update_attributes(venue_params)
|
||||
redirect_to(admin_conference_venue_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.')
|
||||
redirect_to admin_conference_venue_path(conference_id: @conference.short_title),
|
||||
notice: 'Venue was successfully updated.'
|
||||
else
|
||||
flash[:error] = "Update venue failed: #{@venue.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ module Admin
|
|||
|
||||
def update
|
||||
if @conference.update_attributes(conference_params)
|
||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: 'Volunteering options were successfully updated.')
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), notice: 'Volunteering options were successfully updated.'
|
||||
else
|
||||
redirect_to(admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}")
|
||||
redirect_to admin_conference_volunteers_info_path(conference_id: params[:conference_id]), alert: "Volunteering options update failed: #{@conference.errors.full_messages.join '. '}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue