Refactoring Venue, Lodgings und Rooms

#385
This commit is contained in:
Chrisbr 2014-07-31 12:20:04 +02:00
parent 518e1cc62b
commit 5fe99dd041
26 changed files with 352 additions and 130 deletions

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