mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 13:14:03 +00:00
Integrate the splash page into the general layout
* Cleanup the CSS * Fix more views then you have fingers and toes * Introduce position(weight) for sponsor levels * Fix bootstrap/datatable integration
This commit is contained in:
parent
7acd16f923
commit
f2cdea4f1a
56 changed files with 1191 additions and 1266 deletions
|
|
@ -1,22 +1,65 @@
|
|||
module Admin
|
||||
class SponsorshipLevelsController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
authorize_resource through: :conference
|
||||
load_and_authorize_resource through: :conference
|
||||
|
||||
def index
|
||||
authorize! :index, SponsorshipLevel.new(conference_id: @conference.id)
|
||||
end
|
||||
|
||||
def update
|
||||
if @conference.update_attributes(params[:conference])
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship levels were successfully updated.')
|
||||
def edit; end
|
||||
|
||||
def new
|
||||
@sponsorship_level = @conference.sponsorship_levels.new
|
||||
end
|
||||
|
||||
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.')
|
||||
else
|
||||
flash[:error] = "Creating Sponsorship Level failed: #{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
if @sponsorship_level.update_attributes(sponsorship_level_params)
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
alert: 'Sponsorship levels update failed')
|
||||
notice: 'Sponsorship level successfully updated.')
|
||||
else
|
||||
flash[:error] = "Update Sponsorship level failed: #{@sponsorship_level.errors.full_messages.join('. ')}."
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @sponsorship_level.destroy
|
||||
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),
|
||||
error: 'Deleting sponsorship level failed! ' \
|
||||
"#{@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))
|
||||
end
|
||||
|
||||
def down
|
||||
@sponsorship_level.move_lower
|
||||
redirect_to(admin_conference_sponsorship_levels_path(conference_id: @conference.short_title))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sponsorship_level_params
|
||||
params[:sponsorship_level]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue