added views for public view on splashpage,venue_edit,venue

This commit is contained in:
Shriyansh 2016-04-09 02:52:06 +05:30
parent 3bcdbe7469
commit 0ca19ea67a
3 changed files with 26 additions and 11 deletions

View file

@ -9,10 +9,10 @@ module Admin
authorize! :create, @commercial
if @commercial.save
redirect_to edit_admin_conference_venue_path,
redirect_to admin_conference_venue_path,
notice: 'Commercial was successfully created.'
else
redirect_to edit_admin_conference_venue_path,
redirect_to admin_conference_venue_path,
error: 'An error prohibited this Commercial from being saved: '\
"#{@commercial.errors.full_messages.join('. ')}."
@ -21,10 +21,10 @@ module Admin
def update
if @commercial.update(commercial_params)
redirect_to edit_admin_conference_venue_path,
redirect_to admin_conference_venue_path,
notice: 'Commercial was successfully updated.'
else
redirect_to edit_admin_conference_venue_path,
redirect_to admin_conference_venue_path,
error: 'An error prohibited this Commercial from being saved: '\
"#{@commercial.errors.full_messages.join('. ')}."
end
@ -32,7 +32,7 @@ module Admin
def 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
def render_commercial

View file

@ -9,10 +9,16 @@
.col-md-6
- if @conference.venue.location?
= render 'conference/venue_map'
- elsif @conference.venue.photo.blank?
%img{ "data-src" => "holder.js/300x200?text=No Image Set", class: 'img-responsive img-rounded' }
- elsif !@conference.venue.photo.blank?
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded')
-else
- if @venue.commercial.nil?
.row
%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
%address
%strong

View file

@ -6,12 +6,21 @@
-else
.container
.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
= "#{@conference.venue.city} / #{@conference.venue.country_name}"
.col-md-6
.thumbnail
=image_tag(@conference.venue.photo, class: 'img-responsive img-rounded') unless @conference.venue.photo.blank?
.caption
- unless @conference.venue.description.blank?
= markdown(@conference.venue.description)