Refactoring venue

This commit is contained in:
chrisbr 2014-11-12 12:12:57 +01:00
parent c0cdf3e6e5
commit 9d08f52636
13 changed files with 108 additions and 57 deletions

View file

@ -24,7 +24,7 @@
%li{'class'=>class_for_todo(conference_progress['venue'])}
%span{'class'=>icon_for_todo(conference_progress['venue'])}
- if can? :update, @conference.venue
= link_to 'Add venue', admin_conference_venue_info_path(conference_progress['short_title'])
= link_to 'Add venue', edit_admin_conference_venue_path(conference_progress['short_title'])
- else
Add venue
%li{'class'=>class_for_todo(conference_progress['rooms'])}

View file

@ -1,11 +0,0 @@
.row
.col-md-8
= semantic_form_for(@venue, :url => admin_conference_venue_update_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :name, :input_html => {:rows => 1}
= f.input :address, :input_html => {:rows => 1}
= f.input :website
= f.input :description, :input_html => { :rows => 10, :cols => 20, data: { provide: "markdown-editable" } }, hint: markdown_hint
- unless @venue.photo.blank?
= image_tag @venue.photo(:thumb)
= f.input :photo
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,9 @@
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.input :name, input_html: { rows: 1 }
= f.input :address, input_html: { rows: 1 }
= f.input :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
- unless @venue.photo.blank?
= image_tag @venue.photo(:thumb)
= f.input :photo
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -0,0 +1,38 @@
.row{'style'=>'padding-top: 15px;'}
.col-md-6
%dl.dl-horizontal
%dt
Name
%dd
= @venue.name
%dt
Address
%dd
= @venue.address
%dt
Website
%dd
= @venue.website
%dt
Description
%dd
- unless @venue.description.blank?
= markdown(@venue.description)
.row.row-flex.row-flex-wrap
.col-md-4
.thumbnail.flex-col
%h3.text-center
Venue Logo
- if @venue.photo
= image_tag(@venue.photo(:large), class: 'img-responsive')
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @venue.photo_file_name
-else
%h4.text-center
Not set!

View file

@ -0,0 +1,16 @@
.row
.col-md-12
%ul.nav.nav-tabs{'role'=>'tablist'}
%li.active
%a{'href'=> '#show', 'role'=>'tab', 'data-toggle'=>'tab'}
Show
%li
%a{'href'=> '#edit', 'role'=>'tab', 'data-toggle'=>'tab'}
Edit
.row
.col-md-8
.tab-content
.tab-pane.active#show
= render partial: 'show'
.tab-pane#edit
= render partial: 'form'