- | SESSION |
- MUSICIANS |
- ACTIONS |
+ SESSION |
+ MUSICIANS |
+ ACTIONS |
{results}
diff --git a/web/app/assets/javascripts/react-components/FindSessionRow.js.jsx.coffee b/web/app/assets/javascripts/react-components/FindSessionRow.js.jsx.coffee
index 2cc6f3584..e0a582cad 100644
--- a/web/app/assets/javascripts/react-components/FindSessionRow.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/FindSessionRow.js.jsx.coffee
@@ -8,13 +8,11 @@ logger = context.JK.logger
instruments = []
existingTracks = []
- for j in [0 .. participant.tracks.length]
-
- track = participant.tracks[j]
+ logger.debug("Find:Finding instruments. Participant tracks:", participant.tracks)
+ for track in participant.tracks
if existingTracks.indexOf(track.instrument_id) < 0
existingTracks.push(track.instrument_id)
- logger.debug("Find:Finding instruments. Participant tracks:", participant.tracks)
inst = context.JK.getInstrumentIcon24(track.instrument_id)
instruments.push(`

`)
@@ -50,8 +48,24 @@ logger = context.JK.logger
createOpenSlot:(slot) ->
+ inst = context.JK.getInstrumentIcon24(slot.instrument_id);
- `
+ proficiency_desc = slot.proficiency_desc
+ if !proficiency_desc
+ # this is to allow unstructured RSVPs to not specify proficiency_desc
+ proficiency_desc = "Any Skill Level"
+
+ moreLinkHtml = '';
+ if isLast
+ moreLinkHtml = `more`
+
+ instrument_url = inst
+ instrument = slot.description
+ proficiency = proficiency_desc
+ more_link = moreLinkHtml
+
+
+ `
|
@@ -61,24 +75,24 @@ logger = context.JK.logger
{more_link} |
`
+
createRsvpUser: (user, session, isLast) ->
- instrumentLogoHtml = []
+ instruments = []
if user.instrument_list
- for j in [0 .. user.instrument_list.length]
- instrument = user.instrument_list[j];
+ for instrument in user.instrument_list
inst = context.JK.getInstrumentIcon24(instrument.id);
- instrumentLogoHtml.push(`

`)
+ instruments.push(`

`)
moreLinkHtml = '';
if isLast
moreLinkHtml = `
more`
- instruments = @createInstrument(user)
- id = participant.user.id;
- name = participant.user.name;
+ #instruments = @createInstrument(user)
+ id = user.id;
+ name = user.name;
userId = id
- avatar_url = context.JK.resolveAvatarUrl(participant.user.photo_url)
+ avatar_url = context.JK.resolveAvatarUrl(user.photo_url)
profile_url = "/client#/profile/" + id
musician_name = name
more_link = ''
@@ -104,18 +118,16 @@ logger = context.JK.logger
inSessionUsers = []
result = []
- if session.active_music_session && "participants" in session.active_music_session && session.active_music_session.participants.length > 0
- for i in [0 .. session.active_music_session.participants.length]
- participant = session.active_music_session.participants[i]
+ console.log("render active", session)
+ if session.active_music_session && session.active_music_session.participants && session.active_music_session.participants.length > 0
+ for participant in session.active_music_session.participants
inSessionUsers.push(participant.user.id);
result.push(@createInSessionUser(participant))
return [result, inSessionUsers]
- createRsvpUsers:( ) ->
-
- session = @props.session
+ createRsvpUsers:(session) ->
firstResults = []
lastResults = []
@@ -126,19 +138,16 @@ logger = context.JK.logger
first = session.approved_rsvps.slice(0, 3)
last = session.approved_rsvps.slice(3)
- for i in [0..first]
- user = first[i]
- firstResults.push(@createRsvpUser(user, session, approvedRsvpCount > 3 && i == 2))
- for i in [0..last]
- user = last[i]
- lastResults.push(@createRsvpUser(user, session, false))
+ for approved_rsvp in first
+ firstResults.push(@createRsvpUser(approved_rsvp, session, approvedRsvpCount > 3 && i == 2))
+ for approved_rsvp in last
+ lastResults.push(@createRsvpUser(approved_rsvp, session, false))
[firstResults, lastResults]
- createOpenSlots: () ->
- session = @prop.session
+ createOpenSlots: (session) ->
firstResults = []
remainingResults = []
@@ -148,30 +157,45 @@ logger = context.JK.logger
if session.open_slots
openSlotCount = session.open_slots.length
- for i in [0 .. openSlotCount]
- openSlot = session.open_slots[i]
+ for openSlot in session.open_slots
if i < 3
- firstResults.push(@createOpenSlot(session.open_slots[i], openSlotCount > 3 && i == 2))
+ firstResults.push(@createOpenSlot(openSlot, openSlotCount > 3 && i == 2))
else
- remainingResults.push(@createOpenSlot(session.open_slots[i], false))
+ remainingResults.push(@createOpenSlot(openSlot, false))
return [firstResults, remainingResults]
- showJoinLinks: (inSessionUsers) ->
- session = @prop.session
+ showJoinLink: (session, inSessionUsers) ->
showJoinLink = session.musician_access
if session.approved_rsvps
- approvedRsvpCount = session.approved_rsvps.length
- for i in [0 .. approvedRsvpCount]
+ for approved_rsvps in session.approved_rsvps
# do not show the user in this section if he is already in the session
- if $.inArray(session.approved_rsvps[i].id, inSessionUsers) == -1
- if session.approved_rsvps[i].id == context.JK.currentUserId
+ if $.inArray(approved_rsvps.id, inSessionUsers) == -1
+ if approved_rsvps.id == context.JK.currentUserId
showJoinLink = true
else
showJoinLink = true
showJoinLink
+ rsvps: (session, rsvp_musicians_first_3, rsvp_musicians_remaining) ->
+
+ if session.create_type == 'quick-start' || !rsvp_musicians_first_3 || rsvp_musicians_first_3.length == 0
+ return null
+
+ `
+ | RSVPs: |
+
+
+ {rsvp_musicians_first_3}
+
+
+
+ {rsvp_musicians_remaining}
+
+
+ |
+
`
render: () ->
@@ -180,11 +204,12 @@ logger = context.JK.logger
id = session.id
name = session.name
description = session.description || "(No description)"
- genres = '(' + session.genres.join (', ') + ')'
- [in_session_musicians, inSessionUsers] = @inSessionUsersHtml()
- [rsvp_musicians_first_3, rsvp_musicians_remaining] = @createRsvpUsers()
- [open_slots_first_3, open_slots_remaining] = @createOpenSlots()
- showJoinLink = @showJoinLink(inSessionUsers)
+ genres = '(' + session.genres.join (', ')
+ genres += ')'
+ [in_session_musicians, inSessionUsers] = @inSessionUsersHtml(session)
+ [rsvp_musicians_first_3, rsvp_musicians_remaining] = @createRsvpUsers(session)
+ [open_slots_first_3, open_slots_remaining] = @createOpenSlots(session)
+ showJoinLink = @showJoinLink(session, inSessionUsers)
showListenLink = session.fan_access && session.active_music_session && session.active_music_session.mount
join_link_display_style = {display: "none"}
listen_link_display_style = {display: "none"}
@@ -201,20 +226,22 @@ logger = context.JK.logger
else
listen_link_text = '';
+ rsvps = @rsvps(rsvp_musicians_first_3, rsvp_musicians_remaining)
`
- |
+ |
- | {name} |
- {genres} |
+ {name} |
+ {genres} |
- | {description} |
+ {description} |
+
|
-
+ |
| In Session: |
@@ -224,48 +251,25 @@ logger = context.JK.logger
|
-
- | RSVPs: |
-
-
- {rsvp_musicians_first_3}
-
-
-
- {rsvp_musicians_remaining}
-
-
- |
-
-
- | Still Needed: |
-
-
-
-
- {open_slots_remaining}
-
-
- |
-
+ {rsvps}
+
-
+ |
-
-
+
+
{listen_link_text}?
+
|
`
diff --git a/web/app/assets/javascripts/react-components/FindSessionScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/FindSessionScreen.js.jsx.coffee
index ca23a89f5..ae12b9c2e 100644
--- a/web/app/assets/javascripts/react-components/FindSessionScreen.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/FindSessionScreen.js.jsx.coffee
@@ -20,7 +20,6 @@ MIX_MODES = context.JK.MIX_MODES
generateTabClasses: (tab) ->
classes = {}
- classes['button-orange'] = true
classes['find-tab'] = true
classes[tab] = true
@@ -56,19 +55,8 @@ MIX_MODES = context.JK.MIX_MODES
- Scheduled
+ Upcoming
-
-
-
-
-
-
-