osem-fcy/app/views/admin/venues/_form.html.haml
Shriyansh dc0da8c500 defined ,tabular form
defined ,tabular form
2016-04-10 11:57:30 +05:30

53 lines
2.9 KiB
Text

.row
.col-md-12
.page-header
%h1 Venue
.tabbable
%ul.nav.nav-tabs
%li.active
= link_to 'Details', '#details-content', 'data-toggle' => 'tab'
%li
= link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab'
.tab-content
#details-content.tab-pane.active
.col-md-8
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.inputs :name, :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.inputs :street, :postalcode, :city, :country, :latitude, :longitude
- unless @venue.photo.blank?
= image_tag @venue.photo(:thumb)
= f.input :photo
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
#commercials-content.tab-pane
- if @venue
.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(@venue.create_commercial,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
- @venue.commercial do |commercial|
- if commercial.persisted?
.col-md-4
.thumbnail
.flexvideo{ id: "resource-content-#{commercial.id}"}
= render partial: 'shared/media_item', locals: { commercial: commercial }
.caption
- if can? :update, commercial
= semantic_form_for commercial, url: admin_conference_venue_venue_commercial_path(conference_id: @conference.short_title, id: commercial.id) do |f|
= f.input :url, label: 'URL', as: :string, input_html: { id: "commercial_url_#{commercial.id}", required: 'required' }, hint: 'Just paste the url of your video/photo provider'
= f.action :submit, as: :button, button_html: { class: 'btn btn-success' }, label: 'Update'
- if can? :destroy, commercial
= link_to 'Delete', admin_conference_venue_venue_commercial_path(@conference.short_title, commercial.id),
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
%hr
- else
hint: 'First Create Venue, then update commercial'