From 0ca19ea67a43bc12c5ae6bd67dda70479f4bd17d Mon Sep 17 00:00:00 2001 From: Shriyansh Date: Sat, 9 Apr 2016 02:52:06 +0530 Subject: [PATCH] added views for public view on splashpage,venue_edit,venue --- .../admin/venue_commercials_controller.rb | 10 +++++----- app/views/admin/venues/show.html.haml | 14 ++++++++++---- app/views/conference/_venue.html.haml | 13 +++++++++++-- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/controllers/admin/venue_commercials_controller.rb b/app/controllers/admin/venue_commercials_controller.rb index 3ee1b36e..20117e15 100644 --- a/app/controllers/admin/venue_commercials_controller.rb +++ b/app/controllers/admin/venue_commercials_controller.rb @@ -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 diff --git a/app/views/admin/venues/show.html.haml b/app/views/admin/venues/show.html.haml index 18266ede..48fe9bcd 100644 --- a/app/views/admin/venues/show.html.haml +++ b/app/views/admin/venues/show.html.haml @@ -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 diff --git a/app/views/conference/_venue.html.haml b/app/views/conference/_venue.html.haml index b2b7874b..c0650ca3 100644 --- a/app/views/conference/_venue.html.haml +++ b/app/views/conference/_venue.html.haml @@ -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)