diff --git a/ruby/lib/jam_ruby/models/active_music_session.rb b/ruby/lib/jam_ruby/models/active_music_session.rb index 7d6e62228..d6e9bbb57 100644 --- a/ruby/lib/jam_ruby/models/active_music_session.rb +++ b/ruby/lib/jam_ruby/models/active_music_session.rb @@ -949,4 +949,4 @@ module JamRuby music_session.lesson_session end end -end +end \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/FindSessionFriends.js.jsx.coffee b/web/app/assets/javascripts/react-components/FindSessionFriends.js.jsx.coffee index 22cd05a6a..413e0c9a9 100644 --- a/web/app/assets/javascripts/react-components/FindSessionFriends.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/FindSessionFriends.js.jsx.coffee @@ -4,6 +4,8 @@ context = window mixins: [Reflux.listenTo(@AppStore, "onAppInit")] + LIMIT: 50 + getInitialState: () -> {sessions: [], currentPage: 0, next: null, searching: false, count: 0} @@ -49,16 +51,29 @@ context = window
-

sessions for me

+
+

sessions for me

+ + +
+ REFRESH +
+
+ +
+
+
- - - + + + {results}
SESSIONMUSICIANSACTIONSSESSIONMUSICIANSACTIONS
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}
+
- + @@ -224,48 +251,25 @@ logger = context.JK.logger
In Session:
- - RSVPs: - - - {rsvp_musicians_first_3} -
-
- - {rsvp_musicians_remaining} -
-
- - - - Still Needed: - - - {open_slots_first_3} -
-
- - {open_slots_remaining} -
-
- - + {rsvps} +
- +
- - + +

{listen_link_text}?
- - + +
Join
+
` 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 - - -
- -
- -
- REFRESH -
diff --git a/web/app/assets/stylesheets/client/findSession.scss b/web/app/assets/stylesheets/client/findSession.scss index 6843e688f..e10187713 100644 --- a/web/app/assets/stylesheets/client/findSession.scss +++ b/web/app/assets/stylesheets/client/findSession.scss @@ -2,12 +2,6 @@ #findSession { - .btn-refresh { - position: absolute; - right: 2%; - top: 13px; - margin-right: 0; - } .session-keyword-srch { @@ -16,16 +10,63 @@ .tabs { padding-left: 25px; } - .find-tab { + .header-zone { + h2 { + display:inline-block; + } + .search-box { + margin-right: 24px; + position: relative; + top: -3px; + float: right; + } + .refresh-btn { + float:right; + } + padding-right:2%; + } + + .find-tab { + width: 19%; + text-align: center; + height: 27px; + display: block; float: left; - margin: 0 10px; + margin-right: 5px; + vertical-align: bottom; + padding-top: 65px; + background-color: #535353; + color: #ccc; + font-size: 17px; + text-decoration: none; &.active { + background-color: #ed3618; + color: #fff; + } + + &:hover { + filter: brightness(125%); } } + .spacer { + background-color:#404040; + height:10px; + position:absolute; + bottom:0; + left:0; + right:0; + } + + .actions, .session-musicians, .session-cell{ + position:relative; + padding-bottom:20px; + } + .sessions-for-me { + clear:both; display:none; &.active { display:block; @@ -33,17 +74,23 @@ } .join-icon { + display: inline-block; background: url('/assets/content/join-icon.jpg') no-repeat; - height: 37px; - width: 40px; + height: 40px; + width: 37px; } .listen-icon { + display: inline-block; background: url('/assets/content/listen-icon.jpg') no-repeat; height: 40px; width: 40px; } + #sessions-active { + font-size:14px; + } + .paginate-wait { margin:auto; @@ -84,11 +131,11 @@ width:100%; padding-top: 11px; padding-bottom: 11px; - background-color:#4c4c4c; - min-height:20px; + #background-color:#4c4c4c; overflow-x:visible; vertical-align:middle; position:relative; + min-height:100px; } .session-filter select { @@ -151,20 +198,22 @@ } .join-link { - position:relative; - left:-3px; + #position:relative; + #left:-3px; } .join-link-text { - position:relative; - left:6px; + font-weight:bold; + #position:relative; + #left:6px; } .rsvp-link { - position:relative; - left:0px; + #position:relative; + #left:0px; } .rsvp-link-text { - position:relative; - left:6px; + font-weight:bold; + #position:relative; + #left:6px; } } \ No newline at end of file diff --git a/web/app/views/api_music_sessions/show_history.rabl b/web/app/views/api_music_sessions/show_history.rabl index 74549a1ef..b17469bd6 100644 --- a/web/app/views/api_music_sessions/show_history.rabl +++ b/web/app/views/api_music_sessions/show_history.rabl @@ -16,7 +16,7 @@ if !current_user } else - attributes :id, :music_session_id, :name, :description, :musician_access, :approval_required, :fan_access, :fan_chat, + attributes :id, :music_session_id, :name, :description, :musician_access, :approval_required, :fan_access, :fan_chat, :create_type, :band_id, :user_id, :genre_id, :created_at, :like_count, :comment_count, :play_count, :scheduled_duration, :language, :recurring_mode, :language_description, :scheduled_start_date, :access_description, :timezone, :timezone_id, :timezone_description, :musician_access_description, :fan_access_description, :session_removed_at, :legal_policy, :open_rsvps, :is_unstructured_rsvp?