This commit is contained in:
Christian Bruckmayer 2014-08-01 11:35:26 +00:00
commit 31b9c0ca1a
26 changed files with 352 additions and 130 deletions

View file

@ -14,7 +14,7 @@
= link_to 'Set up call for papers', admin_conference_callforpapers_path(conference_progress['short_title'])
%li{'class'=>class_for_todo(conference_progress['venue'])}
%span{'class'=>icon_for_todo(conference_progress['venue'])}
= link_to 'Add venue', admin_conference_venue_info_path(conference_progress['short_title'])
= link_to 'Add venues', edit_admin_conference_venue_path(conference_progress['short_title'])
%li{'class'=>class_for_todo(conference_progress['rooms'])}
%span{'class'=>icon_for_todo(conference_progress['rooms'])}
= link_to 'Add rooms', admin_conference_rooms_path(conference_progress['short_title'])

View file

@ -0,0 +1,8 @@
= f.inputs do
= f.input :name
= f.input :description, :input_html => {:rows => 2, data: { provide: "markdown-editable" } }, hint: markdown_hint("Write about the hotel/place, of what they are offering, about types of rooms, prices and address.")
= image_tag f.object.photo(:thumb) if !f.object.photo.blank?
= f.input :photo
= f.input :website_link
.actions
= f.button 'Save Lodging', class: 'btn btn-primary'

View file

@ -1,10 +0,0 @@
<div class="nested-fields">
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :description, :input_html => {:rows => 2, data: { provide: "markdown-editable" } }, hint: markdown_hint("Write about the hotel/place, of what they are offering, about types of rooms, prices and address.") %>
<%= image_tag f.object.photo(:thumb) if !f.object.photo.blank? %>
<%= f.input :photo %>
<%= f.input :website_link %>
<%= remove_association_link :lodging, f %>
<% end %>
</div>

View file

@ -0,0 +1,6 @@
%h1 Editing Lodging
= semantic_form_for @lodging, url: admin_conference_lodging_path(conference_id: @conference.short_title, id: @lodging.id) do |f|
= render 'form', f: f
= link_to 'Back', admin_conference_lodgings_path

View file

@ -1,6 +1,37 @@
.row
.col-md-8
= semantic_form_for(@venue, :url => admin_conference_lodging_path(@conference.short_title, @conference.venue.lodgings), :html => {:multipart => true}) do |f|
= semantic_form_for(@venue, :url => admin_conference_venue_path(@conference.short_title, @conference.venue)) do |f|
= f.input :include_lodgings_in_splash, hint: 'On setting this true you will enable the lodgings to be displayed on the splash page'
= dynamic_association :lodgings, "Lodgings", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
%hr
- @venue.lodgings.each_slice(3) do |slice|
.row.row-flex.row-flex-wrap
- slice.each do |lodging|
.col-md-4
.thumbnail.flex-col
%h3.text-center
= lodging.name
- unless lodging.photo.blank?
= image_tag(lodging.photo(:large), class: 'img-responsive')
-else
%h4.text-center
Not set!
.caption.flex-grow
.caption
%p
%dl.dl-horizontal
%dt
Description
%dd
= markdown(lodging.description) unless lodging.description.blank?
%dt
Website
%dd
= lodging.website_link
%p
= link_to 'Edit', edit_admin_conference_lodging_path(@conference.short_title, lodging.id), class: 'btn btn-primary'
= link_to 'Delete', admin_conference_lodging_path(@conference.short_title, lodging.id),
method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
= link_to 'New Lodging', new_admin_conference_lodging_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -0,0 +1,6 @@
%h1 New Lodging
= semantic_form_for @lodging, url: admin_conference_lodgings_path(conference_id: @conference.short_title) do |f|
= render 'form', f: f
= link_to 'Back', admin_conference_lodgings_path

View file

@ -0,0 +1,6 @@
= f.inputs do
= f.input :name
= f.input :size, input_html: { size: 5 }
= f.input :public, as: :boolean
.actions
= f.button 'Save Room', class: 'btn btn-primary'

View file

@ -1,8 +0,0 @@
<div class="nested-fields">
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :size, :input_html => {:size => 5} %>
<%= f.input :public, :as => :boolean %>
<%= remove_association_link :room, f %>
<% end %>
</div>

View file

@ -0,0 +1,6 @@
%h1 Editing Room
= semantic_form_for @room, url: admin_conference_room_path(conference_id: @conference.short_title, id: @room.id) do |f|
= render 'form', f: f
= link_to 'Back', admin_conference_rooms_path

View file

@ -1,5 +1,23 @@
.row
.col-md-8
= semantic_form_for(@conference, :url => admin_conference_room_path(@conference.short_title, @conference.rooms)) do |f|
= dynamic_association :rooms, "Rooms", f
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
%h1 Rooms
%table.table
%thead
%tr
%th Name
%th Size
%th Public
%th Delete
- @rooms.each do |room|
%tr
%td= link_to room.name, edit_admin_conference_room_path(@conference.short_title, room.id)
%td= room.size
%td
- if room.public
%span.fa.fa-check{'style'=>'color: green;'}
-else
%span.fa.fa-times{'style'=>'color: red;'}
%td= link_to 'Delete', admin_conference_room_path(@conference.short_title, room.id),
method: :delete, data: { confirm: 'Are you sure?' }
= link_to 'New Room', new_admin_conference_room_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -0,0 +1,6 @@
%h1 New Room
= semantic_form_for @room, url: admin_conference_rooms_path(conference_id: @conference.short_title) do |f|
= render 'form', f: f
= link_to 'Back', admin_conference_rooms_path

View file

@ -1,6 +1,6 @@
.row
.col-md-8
= semantic_form_for(@venue, :url => admin_conference_venue_update_path(@conference.short_title),:html => {:multipart => true}) do |f|
= semantic_form_for(@venue, :url => admin_conference_venue_path(@conference.short_title),:html => {:multipart => true}) do |f|
= f.input :include_venue_in_splash, hint: 'On setting this true you will enable the venue to be displayed on the splash page'
= f.input :name, :input_html => {:rows => 1}
= f.input :address, :input_html => {:rows => 1}

View file

@ -0,0 +1,44 @@
%dl.dl-horizontal
%dt
Name
%dd
- unless @conference.venue.name.blank?
= @conference.venue.name
- else
Not set!
%dt
Address
%dd
- unless @conference.venue.name.blank?
= @conference.venue.address
- else
Not set!
%dt
Website
%dd
- unless @conference.venue.name.blank?
= @conference.venue.website
- else
Not set!
%dt
Description
%dd
- unless @conference.venue.name.blank?
= markdown(@conference.venue.description)
- else
Not set!
.thumbnail
%h3.text-center
Venue Photo
- if @conference.venue.photo?
= image_tag(@conference.venue.photo(:large), class: 'img-responsive')
.caption
%p
%dl.dl-horizontal
%dt
Filename
%dd
= @conference.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-12
.tab-content
.tab-pane.active#show
= render partial: 'show'
.tab-pane#edit
= render partial: 'edit'