Rooms belong to venue

This commit is contained in:
Stella Rouzi 2015-11-07 11:43:36 +02:00 committed by Henne Vogelsang
parent feabbfbc99
commit f840f2b3f0
31 changed files with 221 additions and 166 deletions

View file

@ -32,8 +32,8 @@
Add venue
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['rooms'])}"}
%span{'class'=>icon_for_todo(conference_progress['rooms'])}
- if can? :update, @conference.program.rooms.build
= link_to 'Add rooms', admin_conference_program_rooms_path(conference_progress['short_title'])
- if @conference.venue && (can? :update, @conference.venue.rooms.build)
= link_to 'Add rooms', admin_conference_venue_rooms_path(conference_progress['short_title'])
- else
Add rooms
%li{'class'=>"list-group-item #{class_for_todo(conference_progress['tracks'])}"}

View file

@ -8,8 +8,8 @@
= @room.name
.row
.col-md-8
= semantic_form_for(@room, :url => (@room.new_record? ? admin_conference_program_rooms_path : admin_conference_program_room_path(@conference.short_title, @room))) do |f|
= f.input :name
= semantic_form_for(@room, :url => (@room.new_record? ? admin_conference_venue_rooms_path : admin_conference_venue_room_path(@conference.short_title, @room))) do |f|
= f.input :name, input_html: { autofocus: true}
= f.input :size, :input_html => {:size => 5}
%p.text-right
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -5,7 +5,7 @@
%p.text-muted
The rooms of your conference venue
- if @conference.program.rooms.any?
- if @rooms.any?
.row
.col-md-12
%table.table.table-hover#rooms
@ -14,18 +14,18 @@
%th Size
%th Actions
%tbody
- @conference.program.rooms.each_with_index do |room, index|
- @rooms.each_with_index do |room, index|
%tr
%td
= room.name
%td
= room.size
%td
= link_to 'Edit', edit_admin_conference_program_room_path(@conference.short_title, room.id),
= link_to 'Edit', edit_admin_conference_venue_room_path(@conference.short_title, room.id),
method: :get, class: 'btn btn-primary'
= link_to 'Delete', admin_conference_program_room_path(@conference.short_title, room.id),
= link_to 'Delete', admin_conference_venue_room_path(@conference.short_title, room.id),
method: :delete, class: 'btn btn-danger',
data: { confirm: "Do you really want to delete #{room.name}? Attention: This room will be removed from all Events that have it set"}
.row
.col-md-12.text-right
= link_to 'Add Room', new_admin_conference_program_room_path(@conference.short_title), class: 'btn btn-primary'
= link_to 'Add Room', new_admin_conference_venue_room_path(@conference.short_title), class: 'btn btn-primary'

View file

@ -20,9 +20,12 @@
= @venue.country_name
.row
.col-md-12
= link_to 'Edit Venue', edit_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary', disabled: !(can? :edit, @conference.venue)
= link_to 'Delete Venue', admin_conference_venue_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', disabled: !(can? :edit, @conference.venue)
= link_to(edit_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary', disabled: !(can? :update, @venue) ) do
Edit Venue
= link_to(admin_conference_venue_path(@conference.short_title), method: 'delete', class: 'btn btn-danger', disabled: !(can? :destroy, @venue)) do
Delete Venue
-else
.row
.col-md-12.text-right
= link_to 'Create Venue', new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary', disabled: !(can? :edit, @conference.venue)
= link_to(new_admin_conference_venue_path(@conference.short_title), class: 'btn btn-primary') do
Create Venue