VRFS-1670 more session info work

This commit is contained in:
Brian Smith 2014-05-26 14:00:34 -04:00
parent 3078236ef6
commit 304008d693
3 changed files with 53 additions and 4 deletions

View File

@ -324,11 +324,19 @@ module JamRuby
end
def open_slots
# get all slots for this session and perform a set difference with all chosen slots;
# this will return those that are not filled yet
RsvpSlot.find_by_sql(%Q{select rs.*
from rsvp_slots rs
left join rsvp_requests_rsvp_slots rrrs on rrrs.rsvp_slot_id = rs.id
where (rrrs.rsvp_slot_id is null or rrrs.chosen != true)
and rs.music_session_id = '#{self.id}'})
from rsvp_slots rs
rs.music_session_id = '#{self.id}'
except
select distinct rs.*
from rsvp_slots rs
inner join rsvp_requests_rsvp_slots rrrs on rrrs.rsvp_slot_id = rs.id
and rs.music_session_id = '#{self.id}'
and rrrs.chosen = true
}
)
end
def pending_invitations

View File

@ -318,6 +318,10 @@ small, .small {font-size:11px;}
.p25 {padding:25px !important}
.p30 {padding:30px !important}
.h20 { height:20px; line-height:20px; vertical-align:middle}
.h30 { height:30px; line-height:30px; vertical-align:middle }
.h40 { height:40px; line-height:25px; vertical-align:middle }
.border-right {border-right:solid 1px #999;}
.border-left {border-left:solid 1px #999;}
.border-bottom {border-bottom:solid 1px #999;}

View File

@ -79,6 +79,43 @@
.left.ml10
- rsvp["instruments"].each do |i|
%img.instrument-icon{'instrument-id' => i, height:24, width:24}
%br{:clear => "all"}/
%br/
.left.w65.ib
%strong Still Needed
- if @open_slots.blank?
.clearall.left.w65.h20.ib.mb10
All slots are taken
- else
- @open_slots.each do |slot|
.clearall.left.w65.h20.ib.mb10
.ib.h20
%img.instrument-icon{'instrument-id' => slot.instrument_id, height:24, width:24}
.f11.ml10.ib.h20
= slot.instrument_id.capitalize
%br{:clear => "all"}/
%br/
.w65.ib
%strong Invited
%br/
- if @pending_invitations.blank?
None
- @pending_invitations.each_with_index do |invite, index|
- if index == 0
.avatar-tiny
- unless invite.photo_url.blank?
= image_tag "#{invite.photo_url}", alt: ""
- else
= image_tag "shared/avatar_generic.png", alt: ""
- else
.ml10.avatar-tiny
- unless invite.photo_url.blank?
= image_tag "#{invite.photo_url}", alt: ""
- else
= image_tag "shared/avatar_generic.png", alt: ""
- else
.left.f20.teal