added views for public view on splashpage,venue_edit,venue
This commit is contained in:
parent
3bcdbe7469
commit
0ca19ea67a
3 changed files with 26 additions and 11 deletions
|
|
@ -9,10 +9,10 @@ module Admin
|
||||||
authorize! :create, @commercial
|
authorize! :create, @commercial
|
||||||
|
|
||||||
if @commercial.save
|
if @commercial.save
|
||||||
redirect_to edit_admin_conference_venue_path,
|
redirect_to admin_conference_venue_path,
|
||||||
notice: 'Commercial was successfully created.'
|
notice: 'Commercial was successfully created.'
|
||||||
else
|
else
|
||||||
redirect_to edit_admin_conference_venue_path,
|
redirect_to admin_conference_venue_path,
|
||||||
error: 'An error prohibited this Commercial from being saved: '\
|
error: 'An error prohibited this Commercial from being saved: '\
|
||||||
"#{@commercial.errors.full_messages.join('. ')}."
|
"#{@commercial.errors.full_messages.join('. ')}."
|
||||||
|
|
||||||
|
|
@ -21,10 +21,10 @@ module Admin
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if @commercial.update(commercial_params)
|
if @commercial.update(commercial_params)
|
||||||
redirect_to edit_admin_conference_venue_path,
|
redirect_to admin_conference_venue_path,
|
||||||
notice: 'Commercial was successfully updated.'
|
notice: 'Commercial was successfully updated.'
|
||||||
else
|
else
|
||||||
redirect_to edit_admin_conference_venue_path,
|
redirect_to admin_conference_venue_path,
|
||||||
error: 'An error prohibited this Commercial from being saved: '\
|
error: 'An error prohibited this Commercial from being saved: '\
|
||||||
"#{@commercial.errors.full_messages.join('. ')}."
|
"#{@commercial.errors.full_messages.join('. ')}."
|
||||||
end
|
end
|
||||||
|
|
@ -32,7 +32,7 @@ module Admin
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@commercial.destroy
|
@commercial.destroy
|
||||||
redirect_to edit_admin_conference_venue_path, notice: 'Commercial was successfully destroyed.'
|
redirect_to admin_conference_venue_path, notice: 'Commercial was successfully destroyed.'
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_commercial
|
def render_commercial
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,16 @@
|
||||||
.col-md-6
|
.col-md-6
|
||||||
- if @conference.venue.location?
|
- if @conference.venue.location?
|
||||||
= render 'conference/venue_map'
|
= render 'conference/venue_map'
|
||||||
- elsif @conference.venue.photo.blank?
|
-else
|
||||||
%img{ "data-src" => "holder.js/300x200?text=No Image Set", class: 'img-responsive img-rounded' }
|
- if @venue.commercial.nil?
|
||||||
- elsif !@conference.venue.photo.blank?
|
.row
|
||||||
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded')
|
%img{ "data-src" => "holder.js/500x300?text=No Commercial Set", class: 'img-responsive img-rounded' }
|
||||||
|
- else
|
||||||
|
- if @venue.commercial.persisted?
|
||||||
|
.thumbnail
|
||||||
|
.flexvideo{ id: "resource-content-#{@venue.commercial.id}"}
|
||||||
|
= render partial: 'shared/media_item', locals: { commercial: @venue.commercial }
|
||||||
|
|
||||||
.col-md-6
|
.col-md-6
|
||||||
%address
|
%address
|
||||||
%strong
|
%strong
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,21 @@
|
||||||
-else
|
-else
|
||||||
.container
|
.container
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
- if @conference.venue.commercial.nil?
|
||||||
|
.col-md-6
|
||||||
|
%img{ "data-src" => "holder.js/500x300?text=No Commercial Set", class: 'img-responsive img-rounded' }
|
||||||
|
|
||||||
|
-else @conference.venue.commercial.persisted?
|
||||||
|
.col-md-5
|
||||||
|
.thumbnail
|
||||||
|
.flexvideo{ id: "resource-content-#{@conference.venue.commercial.id}"}
|
||||||
|
= render partial: 'shared/media_item', locals: { commercial: @conference.venue.commercial }
|
||||||
|
|
||||||
|
.col-md-6
|
||||||
%h2.text-center
|
%h2.text-center
|
||||||
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
|
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
|
||||||
.col-md-6
|
.col-md-6
|
||||||
.thumbnail
|
.thumbnail
|
||||||
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded') unless @conference.venue.photo.blank?
|
|
||||||
.caption
|
.caption
|
||||||
- unless @conference.venue.description.blank?
|
- unless @conference.venue.description.blank?
|
||||||
= markdown(@conference.venue.description)
|
= markdown(@conference.venue.description)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue