diff --git a/app/views/admin/venues/_form.html.haml b/app/views/admin/venues/_form.html.haml index 7460223c..00f3e501 100644 --- a/app/views/admin/venues/_form.html.haml +++ b/app/views/admin/venues/_form.html.haml @@ -22,8 +22,21 @@ = f.action :submit, as: :button, button_html: { class: 'btn btn-primary' } #commercials-content.tab-pane - - if can? :create, @venue.commercial - - if @venue.commercial + - if can? :create, @venue.commercial and @venue.id + - if @venue.commercial.nil? + .row + .col-md-6 + #resource-content + #resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' } + + .row + .col-md-6 + = semantic_form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| + = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, + hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + %hr + - else - if @venue.commercial.persisted? .col-md-4 .thumbnail @@ -38,18 +51,6 @@ = link_to 'Delete', admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: @venue.commercial.id), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %hr - - else - .row - .col-md-6 - #resource-content - #resource-placeholder{ style: 'background-color:#d3d3d3; float: left; width: 400px; height: 250px; margin: 5px; border-width: 1px; border-style: solid; border-color: rgba(0,0,0,.2);' } - .row - .col-md-6 - = semantic_form_for(Commercial.new,as: :commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title)) do |f| - = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, - hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } - %hr - else - hint: 'First Create Venue, then update commercial' + First Create Venue, then update commercial