From 75b9b97c60341f44d725a131d58b40106f7e08ef Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 27 Dec 2013 16:28:28 -0500 Subject: [PATCH 01/78] fix warning related to ruby- prefix in .ruby-version files --- db/.ruby-version | 2 +- pb/.ruby-version | 2 +- ruby/.ruby-version | 2 +- web/.ruby-version | 2 +- websocket-gateway/.ruby-version | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/.ruby-version b/db/.ruby-version index abf2ccea0..cb506813e 100644 --- a/db/.ruby-version +++ b/db/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p247 +2.0.0-p247 diff --git a/pb/.ruby-version b/pb/.ruby-version index abf2ccea0..cb506813e 100644 --- a/pb/.ruby-version +++ b/pb/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p247 +2.0.0-p247 diff --git a/ruby/.ruby-version b/ruby/.ruby-version index abf2ccea0..cb506813e 100644 --- a/ruby/.ruby-version +++ b/ruby/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p247 +2.0.0-p247 diff --git a/web/.ruby-version b/web/.ruby-version index abf2ccea0..cb506813e 100644 --- a/web/.ruby-version +++ b/web/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p247 +2.0.0-p247 diff --git a/websocket-gateway/.ruby-version b/websocket-gateway/.ruby-version index abf2ccea0..cb506813e 100644 --- a/websocket-gateway/.ruby-version +++ b/websocket-gateway/.ruby-version @@ -1 +1 @@ -ruby-2.0.0-p247 +2.0.0-p247 From 4a9ad7b733bf048e6c6302a949739ff02caf7b85 Mon Sep 17 00:00:00 2001 From: Anthony Davis Date: Sat, 28 Dec 2013 11:54:53 -0600 Subject: [PATCH 02/78] VRFS-937 - locking 'gon' to ~>4.1.0 to fix test failures --- web/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/Gemfile b/web/Gemfile index 0f5f3066e..91f446324 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -32,7 +32,7 @@ gem 'ruby-protocol-buffers', '1.2.2' gem 'pg', '0.15.1' gem 'compass-rails' gem 'rabl' # for JSON API development -gem 'gon' # for passthrough of Ruby variables to Javascript variables +gem 'gon', '~>4.1.0' # for passthrough of Ruby variables to Javascript variables gem 'eventmachine', '1.0.3' gem 'amqp', '0.9.8' gem 'logging-rails', :require => 'logging/rails' From 7e78163bb992876fc68c3e9bf21704b07149452a Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 28 Dec 2013 23:51:35 -0500 Subject: [PATCH 03/78] VRFS-933 notification work --- pb/src/client_container.proto | 349 +++++++++++------- ruby/Gemfile | 1 + ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 39 ++ .../jam_ruby/constants/notification_types.rb | 11 +- ruby/lib/jam_ruby/message_factory.rb | 304 ++++++++------- ruby/lib/jam_ruby/models/notification.rb | 294 ++++++++++----- ruby/lib/jam_ruby/models/user.rb | 41 +- .../assets/javascripts/AAB_message_factory.js | 36 +- web/app/assets/javascripts/sidebar.js | 167 +++++++-- .../controllers/api_invitations_controller.rb | 2 +- web/app/controllers/api_users_controller.rb | 4 +- 11 files changed, 831 insertions(+), 417 deletions(-) diff --git a/pb/src/client_container.proto b/pb/src/client_container.proto index fef2995dc..4f594e7cb 100644 --- a/pb/src/client_container.proto +++ b/pb/src/client_container.proto @@ -9,43 +9,62 @@ package jampb; message ClientMessage { enum Type { - LOGIN = 100; - LOGIN_ACK = 101; + LOGIN = 100; + LOGIN_ACK = 105; + LOGIN_MUSIC_SESSION = 110; + LOGIN_MUSIC_SESSION_ACK = 115; + LEAVE_MUSIC_SESSION = 120; + LEAVE_MUSIC_SESSION_ACK = 125; + HEARTBEAT = 130; + HEARTBEAT_ACK = 135; - LOGIN_MUSIC_SESSION = 102; - LOGIN_MUSIC_SESSION_ACK = 103; - FRIEND_SESSION_JOIN = 104; - LEAVE_MUSIC_SESSION = 105; - LEAVE_MUSIC_SESSION_ACK = 106; - HEARTBEAT = 107; - FRIEND_UPDATE = 108; - SESSION_INVITATION = 109; - MUSICIAN_SESSION_DEPART = 110; - JOIN_REQUEST = 111; - FRIEND_REQUEST = 112; - FRIEND_REQUEST_ACCEPTED = 113; - MUSICIAN_SESSION_JOIN = 114; - MUSICIAN_SESSION_FRESH = 115; - MUSICIAN_SESSION_STALE = 116; - HEARTBEAT_ACK = 117; - JOIN_REQUEST_APPROVED = 118; - JOIN_REQUEST_REJECTED = 119; - BAND_INVITATION = 120; - BAND_INVITATION_ACCEPTED = 121; + // friend notifications + FRIEND_UPDATE = 140; + FRIEND_REQUEST = 145; + FRIEND_REQUEST_ACCEPTED = 150; + FRIEND_SESSION_JOIN = 155; + NEW_USER_FOLLOWER = 160; + NEW_BAND_FOLLOWER = 161; - TEST_SESSION_MESSAGE = 200; + // session invitations + SESSION_INVITATION = 165; + SESSION_ENDED = 170; + JOIN_REQUEST = 175; + JOIN_REQUEST_APPROVED = 180; + JOIN_REQUEST_REJECTED = 185; + + // musician notifications + MUSICIAN_SESSION_JOIN = 190; + MUSICIAN_SESSION_DEPART = 195; + + // recording notifications + MUSICIAN_RECORDING_SAVED = 200; + BAND_RECORDING_SAVED = 205; + RECORDING_STARTED = 210; + RECORDING_ENDED = 215; + RECORDING_MASTER_MIX_COMPLETE = 220; + + // band notifications + BAND_INVITATION = 225; + BAND_INVITATION_ACCEPTED = 230; + BAND_SESSION_JOIN = 235; + + MUSICIAN_SESSION_FRESH = 240; + MUSICIAN_SESSION_STALE = 245; + + TEST_SESSION_MESSAGE = 295; PING_REQUEST = 300; - PING_ACK = 301; - PEER_MESSAGE = 302; - TEST_CLIENT_MESSAGE = 303; + PING_ACK = 305; + PEER_MESSAGE = 310; + TEST_CLIENT_MESSAGE = 315; SERVER_BAD_STATE_RECOVERED = 900; SERVER_GENERIC_ERROR = 1000; - SERVER_REJECTION_ERROR = 1001; - SERVER_PERMISSION_ERROR = 1002; - SERVER_BAD_STATE_ERROR = 1003; + SERVER_REJECTION_ERROR = 1005; + SERVER_PERMISSION_ERROR = 1010; + SERVER_BAD_STATE_ERROR = 1015; } // Identifies which inner message is filled in @@ -59,45 +78,66 @@ message ClientMessage { // Client-Server messages (to/from) optional Login login = 100; // to server - optional LoginAck login_ack = 101; // from server - optional LoginMusicSession login_music_session = 102; // to server - optional LoginMusicSessionAck login_music_session_ack = 103; // from server - optional FriendSessionJoin friend_session_join = 104; // from server to all members - optional LeaveMusicSession leave_music_session = 105; - optional LeaveMusicSessionAck leave_music_session_ack = 106; - optional Heartbeat heartbeat = 107; - optional FriendUpdate friend_update = 108; // from server to all friends of user - optional SessionInvitation session_invitation = 109; // from server to user - optional MusicianSessionDepart musician_session_depart = 110; - optional JoinRequest join_request = 111; - optional FriendRequest friend_request = 112; - optional FriendRequestAccepted friend_request_accepted = 113; - optional MusicianSessionJoin musician_session_join = 114; - optional MusicianSessionFresh musician_session_fresh = 115; - optional MusicianSessionStale musician_session_stale = 116; - optional HeartbeatAck heartbeat_ack = 117; - optional JoinRequestApproved join_request_approved = 118; - optional JoinRequestRejected join_request_rejected = 119; - optional BandInvitation band_invitation = 120; - optional BandInvitationAccepted band_invitation_accepted = 121; + optional LoginAck login_ack = 105; // from server + optional LoginMusicSession login_music_session = 110; // to server + optional LoginMusicSessionAck login_music_session_ack = 115; // from server + optional LeaveMusicSession leave_music_session = 120; + optional LeaveMusicSessionAck leave_music_session_ack = 125; + optional Heartbeat heartbeat = 130; + optional HeartbeatAck heartbeat_ack = 135; + + // friend notifications + optional FriendUpdate friend_update = 140; // from server to all friends of user + optional FriendRequest friend_request = 145; + optional FriendRequestAccepted friend_request_accepted = 150; + optional FriendSessionJoin friend_session_join = 155; + optional NewUserFollower new_user_follower = 160; + optional NewBandFollower new_band_follower = 161; + + // session invitations + optional SessionInvitation session_invitation = 165; // from server to user + optional SessionEnded session_ended = 170; + optional JoinRequest join_request = 175; + optional JoinRequestApproved join_request_approved = 180; + optional JoinRequestRejected join_request_rejected = 185; + + // musician notifications + optional MusicianSessionJoin musician_session_join = 190; + optional MusicianSessionDepart musician_session_depart = 195; + + // recording notifications + optional MusicianRecordingSaved musician_recording_saved = 200; + optional BandRecordingSaved band_recording_saved = 205; + optional RecordingStarted recording_started = 210; + optional RecordingEnded recording_ended = 215; + optional RecordingMasterMixComplete recording_master_mix_complete = 220; + + // band notifications + optional BandInvitation band_invitation = 225; + optional BandInvitationAccepted band_invitation_accepted = 230; + optional BandSessionJoin band_session_join = 235; + + optional MusicianSessionFresh musician_session_fresh = 240; + optional MusicianSessionStale musician_session_stale = 245; + // Client-Session messages (to/from) - optional TestSessionMessage test_session_message = 200; + optional TestSessionMessage test_session_message = 295; // Client-Client messages (to/from) optional PingRequest ping_request = 300; - optional PingAck ping_ack = 301; - optional PeerMessage peer_message = 302; - optional TestClientMessage test_client_message = 303; + optional PingAck ping_ack = 305; + optional PeerMessage peer_message = 310; + optional TestClientMessage test_client_message = 315; // Server-to-Client special messages optional ServerBadStateRecovered server_bad_state_recovered = 900; // Server-to-Client errors optional ServerGenericError server_generic_error = 1000; - optional ServerRejectionError server_rejection_error = 1001; - optional ServerPermissionError server_permission_error = 1002; - optional ServerBadStateError server_bad_state_error = 1003; + optional ServerRejectionError server_rejection_error = 1005; + optional ServerPermissionError server_permission_error = 1010; + optional ServerBadStateError server_bad_state_error = 1015; } // route_to: server @@ -157,6 +197,40 @@ message LeaveMusicSessionAck { optional string error_reason = 2; } +// target: client +// send from server to client when a user logs in +message FriendUpdate { + optional string user_id = 1; + optional string name = 2; + optional string photo_url = 3; + optional bool online = 4; + optional string msg = 5; +} + +// target: client +// send from server to client when user sends a friend request +message FriendRequest { + optional string friend_request_id = 1; + optional string user_id = 2; + optional string name = 3; + optional string photo_url = 4; + optional string friend_id = 5; + optional string msg = 6; + optional string notification_id = 7; + optional string created_at = 8; +} + +// target: client +message FriendRequestAccepted { + optional string friend_id = 1; // accepter + optional string name = 2; + optional string photo_url = 3; + optional string user_id = 4; // original requester + optional string msg = 5; + optional string notification_id = 6; + optional string created_at = 7; +} + // route_to: client: // sent by server to let the rest of the participants know a user has joined. message FriendSessionJoin { @@ -166,41 +240,33 @@ message FriendSessionJoin { optional string photo_url = 4; } -// route_to: client: -// sent by server to let the rest of the participants know a user has joined. -message MusicianSessionJoin { - optional string session_id = 1; // the session ID - optional string user_id = 2; // this is the user_id and can be used for user unicast messages - optional string username = 3; // meant to be a display name - optional string photo_url = 4; +message NewUserFollower { + optional string name = 1; + optional string photo_url = 2; + optional string msg = 3; + optional string notification_id = 4; + optional string created_at = 5; } -// route_to: client: -// sent by server to let the rest of the participants know a user has left. -message MusicianSessionDepart { - optional string session_id = 1; // the session ID - optional string user_id = 2; // this is the user_id and can be used for user unicast messages - optional string username = 3; // meant to be a display name - optional string photo_url = 4; - optional string recordingId = 5; // if specified, the recording was stopped automatically +message NewBandFollower { + optional string name = 1; + optional string photo_url = 2; + optional string msg = 3; + optional string notification_id = 4; + optional string created_at = 5; } -// route_to: client: -// sent by server to let the rest of the participants know a client has become active again after going stale -message MusicianSessionFresh { - optional string session_id = 1; // the session ID - optional string user_id = 2; // this is the user_id and can be used for user unicast messages - optional string username = 3; // meant to be a display name - optional string photo_url = 4; +// route_to: user:[USER_ID] +// let a user know they've been invited to a session +message SessionInvitation { + optional string sender_name = 1; + optional string session_id = 2; + optional string notification_id = 3; + optional string created_at = 4; } -// route_to: client: -// sent by server to let the rest of the participants know a user has gone stale (websocket connection dropped) -message MusicianSessionStale { - optional string session_id = 1; // the session ID - optional string user_id = 2; // this is the user_id and can be used for user unicast messages - optional string username = 3; // meant to be a display name - optional string photo_url = 4; +message SessionEnded { + } message JoinRequest { @@ -233,6 +299,45 @@ message JoinRequestRejected { optional string created_at = 7; } +// route_to: client: +// sent by server to let the rest of the participants know a user has joined. +message MusicianSessionJoin { + optional string session_id = 1; // the session ID + optional string user_id = 2; // this is the user_id and can be used for user unicast messages + optional string username = 3; // meant to be a display name + optional string photo_url = 4; +} + +// route_to: client: +// sent by server to let the rest of the participants know a user has left. +message MusicianSessionDepart { + optional string session_id = 1; // the session ID + optional string user_id = 2; // this is the user_id and can be used for user unicast messages + optional string username = 3; // meant to be a display name + optional string photo_url = 4; + optional string recordingId = 5; // if specified, the recording was stopped automatically +} + +message MusicianRecordingSaved { + +} + +message BandRecordingSaved { + +} + +message RecordingStarted { + +} + +message RecordingEnded { + +} + +message RecordingMasterMixComplete { + +} + message BandInvitation { optional string band_invitation_id = 1; optional string band_id = 2; @@ -256,6 +361,33 @@ message BandInvitationAccepted { optional string created_at = 8; } +message BandSessionJoin { + optional string session_id = 1; + optional string band_name = 2; + optional string photo_url = 3; + optional string msg = 4; + optional string notification_id = 5; + optional string created_at = 6; +} + +// route_to: client: +// sent by server to let the rest of the participants know a client has become active again after going stale +message MusicianSessionFresh { + optional string session_id = 1; // the session ID + optional string user_id = 2; // this is the user_id and can be used for user unicast messages + optional string username = 3; // meant to be a display name + optional string photo_url = 4; +} + +// route_to: client: +// sent by server to let the rest of the participants know a user has gone stale (websocket connection dropped) +message MusicianSessionStale { + optional string session_id = 1; // the session ID + optional string user_id = 2; // this is the user_id and can be used for user unicast messages + optional string username = 3; // meant to be a display name + optional string photo_url = 4; +} + // route_to: session // a test message used by ruby-client currently. just gives way to send out to rest of session message TestSessionMessage { @@ -298,57 +430,12 @@ message Heartbeat { message HeartbeatAck { } -// target: client -// send from server to client when user sends a friend request -message FriendRequest { - optional string friend_request_id = 1; - optional string user_id = 2; - optional string name = 3; - optional string photo_url = 4; - optional string friend_id = 5; - optional string msg = 6; - optional string notification_id = 7; - optional string created_at = 8; -} - -// target: client -message FriendRequestAccepted { - optional string friend_id = 1; // accepter - optional string name = 2; - optional string photo_url = 3; - optional string user_id = 4; // original requester - optional string msg = 5; - optional string notification_id = 6; - optional string created_at = 7; -} - -// target: client -// send from server to client when a user logs in -message FriendUpdate { - optional string user_id = 1; - optional string name = 2; - optional string photo_url = 3; - optional bool online = 4; - optional string msg = 5; -} - -// route_to: user:[USER_ID] -// let a user know they've been invited to a session -message SessionInvitation { - optional string sender_name = 1; - optional string session_id = 2; - optional string notification_id = 3; - optional string created_at = 4; -} - // route_to: client // this should follow a ServerBadStateError in the case that the // websocket gateway recovers from whatever ailed it message ServerBadStateRecovered { } - - // route_to: client // this indicates unhandled error on server // if you receive this, your connection will close after. diff --git a/ruby/Gemfile b/ruby/Gemfile index 67fa507f4..f8607162e 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -10,6 +10,7 @@ gem 'pg', '0.15.1', :platform => [:mri, :mswin, :mingw] gem 'jdbc_postgres', :platform => [:jruby] gem 'activerecord', '3.2.13' +gem "activerecord-import", "~> 0.4.1" gem 'uuidtools', '2.1.2' gem 'bcrypt-ruby', '3.0.1' gem 'ruby-protocol-buffers', '1.2.2' diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index c399f4e24..b59c74f86 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -88,5 +88,44 @@ end end + ######### NOTIFICATION EMAILS ######### + + + def friend_request(source_user, target_user) + end + + def friend_request_accepted(source_user, target_user) + end + + def new_user_follower(source_user, target_user) + @user = target_user + sendgrid_unique_args :type => "new_user_follower" + mail(:to => @user.email, :subject => "You have a new follower on JamKazam") do |format| + format.text + format.html + end + end + + def new_band_follower(source_user, target_users, band) + sendgrid_unique_args :type => "new_band_follower" + + mail(:to => extract_emails(target_users), :subject => "Your band has a new follower on JamKazam") do |format| + format.text + format.html + end + end + + def session_invitation(source_user, target_user) + @user = target_user + end + + def musician_session_join(user) + @user = user + end + + def extract_emails(users) + users.map! { |u| u.email } + end + end end diff --git a/ruby/lib/jam_ruby/constants/notification_types.rb b/ruby/lib/jam_ruby/constants/notification_types.rb index 272095f59..f8b8e5d55 100644 --- a/ruby/lib/jam_ruby/constants/notification_types.rb +++ b/ruby/lib/jam_ruby/constants/notification_types.rb @@ -5,10 +5,12 @@ module NotificationTypes FRIEND_REQUEST = "FRIEND_REQUEST" FRIEND_REQUEST_ACCEPTED = "FRIEND_REQUEST_ACCEPTED" FRIEND_SESSION_JOIN = "FRIEND_SESSION_JOIN" + NEW_USER_FOLLOWER = "NEW_USER_FOLLOWER" + NEW_BAND_FOLLOWER = "NEW_BAND_FOLLOWER" # session notifications SESSION_INVITATION = "SESSION_INVITATION" - SESSION_ENDED = "SESSION_ENDED" # used to remove session-related notification from sidebar + SESSION_ENDED = "SESSION_ENDED" # used to remove session-related notifications from sidebar JOIN_REQUEST = "JOIN_REQUEST" JOIN_REQUEST_APPROVED = "JOIN_REQUEST_APPROVED" JOIN_REQUEST_REJECTED = "JOIN_REQUEST_REJECTED" @@ -18,10 +20,15 @@ module NotificationTypes MUSICIAN_SESSION_DEPART = "MUSICIAN_SESSION_DEPART" # recording notifications - RECORDING_CREATED = "RECORDING_CREATED" + MUSICIAN_RECORDING_SAVED = "MUSICIAN_RECORDING_SAVED" + BAND_RECORDING_SAVED = "BAND_RECORDING_SAVED" + RECORDING_STARTED = "RECORDING_STARTED" + RECORDING_ENDED = "RECORDING_ENDED" + RECORDING_MASTER_MIX_COMPLETE = "RECORDING_MASTER_MIX_COMPLETE" # band notifications BAND_INVITATION = "BAND_INVITATION" BAND_INVITATION_ACCEPTED = "BAND_INVITATION_ACCEPTED" + BAND_SESSION_JOIN = "BAND_SESSION_JOIN" # cleared using SESSION_ENDED notification end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/message_factory.rb b/ruby/lib/jam_ruby/message_factory.rb index 51df0e0d5..425f182cf 100644 --- a/ruby/lib/jam_ruby/message_factory.rb +++ b/ruby/lib/jam_ruby/message_factory.rb @@ -9,18 +9,18 @@ CLIENT_TARGET_PREFIX = "client:" def initialize() - @type_values = {} + @type_values = {} - Jampb::ClientMessage::Type.constants.each do |constant| - @type_values[Jampb::ClientMessage::Type.const_get(constant)] = constant - end + Jampb::ClientMessage::Type.constants.each do |constant| + @type_values[Jampb::ClientMessage::Type.const_get(constant)] = constant + end end - # given a string (bytes) payload, return a client message - def parse_client_msg(payload) - return Jampb::ClientMessage.parse(payload) - end + # given a string (bytes) payload, return a client message + def parse_client_msg(payload) + return Jampb::ClientMessage.parse(payload) + end # create a login message using user/pass def login_with_user_pass(username, password, options = {}) @@ -114,6 +114,28 @@ ) end + # create a heartbeat + def heartbeat() + heartbeat = Jampb::Heartbeat.new + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::HEARTBEAT, + :route_to => SERVER_TARGET, + :heartbeat => heartbeat + ) + end + + # create a heartbeat ack + def heartbeat_ack() + heartbeat_ack = Jampb::HeartbeatAck.new + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::HEARTBEAT_ACK, + :route_to => CLIENT_TARGET, + :heartbeat_ack => heartbeat_ack + ) + end + # create a server bad state recovered msg def server_bad_state_recovered(original_message_id) recovered = Jampb::ServerBadStateRecovered.new() @@ -126,7 +148,7 @@ ) end - # create a server error + # create a server error def server_generic_error(error_msg) error = Jampb::ServerGenericError.new(:error_msg => error_msg) @@ -137,7 +159,7 @@ ) end - # create a server rejection error + # create a server rejection error def server_rejection_error(error_msg) error = Jampb::ServerRejectionError.new(:error_msg => error_msg) @@ -172,6 +194,64 @@ ) end + ###################################### NOTIFICATIONS ###################################### + + # create a friend update message + def friend_update(user_id, name, photo_url, online, msg) + friend = Jampb::FriendUpdate.new( + :user_id => user_id, + :name => name, + :photo_url => photo_url, + :online => online, + :msg => msg + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::FRIEND_UPDATE, + :route_to => USER_TARGET_PREFIX + user_id, + :friend_update => friend + ) + end + + # create a friend request message + def friend_request(friend_request_id, user_id, name, photo_url, friend_id, msg, notification_id, created_at) + friend_request = Jampb::FriendRequest.new( + :friend_request_id => friend_request_id, + :user_id => user_id, + :name => name, + :photo_url => photo_url, + :friend_id => friend_id, + :msg => msg, + :notification_id => notification_id, + :created_at => created_at + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::FRIEND_REQUEST, + :route_to => USER_TARGET_PREFIX + friend_id, + :friend_request => friend_request + ) + end + + # create a friend request acceptance message + def friend_request_accepted(friend_id, name, photo_url, user_id, msg, notification_id, created_at) + friend_request_accepted = Jampb::FriendRequestAccepted.new( + :friend_id => friend_id, + :name => name, + :photo_url => photo_url, + :user_id => user_id, + :msg => msg, + :notification_id => notification_id, + :created_at => created_at + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::FRIEND_REQUEST_ACCEPTED, + :route_to => USER_TARGET_PREFIX + user_id, + :friend_request_accepted => friend_request_accepted + ) + end + # create a friend joined session message def friend_session_join(session_id, user_id, username, photo_url) join = Jampb::FriendSessionJoin.new( @@ -188,6 +268,38 @@ ) end + def new_user_follower(receiver_id, follower_name, photo_url, msg, notification_id, created_at) + new_user_follower = Jampb::NewUserFollower.new( + :name => follower_name, + :photo_url => photo_url, + :msg => msg, + :notification_id => notification_id, + :created_at => created_at + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::NEW_USER_FOLLOWER, + :route_to => USER_TARGET_PREFIX + receiver_id, + :new_user_follower => new_user_follower + ) + end + + def new_band_follower(receiver_id, follower_name, photo_url, msg, notification_id, created_at) + new_band_follower = Jampb::NewBandFollower.new( + :name => follower_name, + :photo_url => photo_url, + :msg => msg, + :notification_id => notification_id, + :created_at => created_at + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::NEW_BAND_FOLLOWER, + :route_to => USER_TARGET_PREFIX + receiver_id, + :new_user_follower => new_band_follower + ) + end + # create a musician joined session message def musician_session_join(session_id, user_id, username, photo_url) join = Jampb::MusicianSessionJoin.new( @@ -221,35 +333,18 @@ ) end - # create a musician fresh session message - def musician_session_fresh(session_id, user_id, username, photo_url) - fresh = Jampb::MusicianSessionFresh.new( - :session_id => session_id, - :user_id => user_id, - :username => username, - :photo_url => photo_url + def session_invitation(receiver_id, sender_name, session_id, notification_id, created_at) + session_invitation = Jampb::SessionInvitation.new( + :sender_name => sender_name, + :session_id => session_id, + :notification_id => notification_id, + :created_at => created_at ) return Jampb::ClientMessage.new( - :type => ClientMessage::Type::MUSICIAN_SESSION_FRESH, - :route_to => CLIENT_TARGET, - :musician_session_fresh => fresh - ) - end - - # create a musician stale session message - def musician_session_stale(session_id, user_id, username, photo_url) - stale = Jampb::MusicianSessionStale.new( - :session_id => session_id, - :user_id => user_id, - :username => username, - :photo_url => photo_url - ) - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::MUSICIAN_SESSION_STALE, - :route_to => CLIENT_TARGET, - :musician_session_stale => stale + :type => ClientMessage::Type::SESSION_INVITATION, + :route_to => USER_TARGET_PREFIX + receiver_id, + :session_invitation => session_invitation ) end @@ -351,85 +446,46 @@ ) end - # create a test message to send in session - def test_session_message(session_id, msg) - test = Jampb::TestSessionMessage.new(:msg => msg) + # create a musician fresh session message + def musician_session_fresh(session_id, user_id, username, photo_url) + fresh = Jampb::MusicianSessionFresh.new( + :session_id => session_id, + :user_id => user_id, + :username => username, + :photo_url => photo_url + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::MUSICIAN_SESSION_FRESH, + :route_to => CLIENT_TARGET, + :musician_session_fresh => fresh + ) + end + + # create a musician stale session message + def musician_session_stale(session_id, user_id, username, photo_url) + stale = Jampb::MusicianSessionStale.new( + :session_id => session_id, + :user_id => user_id, + :username => username, + :photo_url => photo_url + ) + + return Jampb::ClientMessage.new( + :type => ClientMessage::Type::MUSICIAN_SESSION_STALE, + :route_to => CLIENT_TARGET, + :musician_session_stale => stale + ) + end + + # create a test message to send in session + def test_session_message(session_id, msg) + test = Jampb::TestSessionMessage.new(:msg => msg) return Jampb::ClientMessage.new( :type => ClientMessage::Type::TEST_SESSION_MESSAGE, :route_to => SESSION_TARGET_PREFIX + session_id, :test_session_message => test - ) - end - - def session_invitation(receiver_id, sender_name, session_id, notification_id, created_at) - session_invitation = Jampb::SessionInvitation.new( - :sender_name => sender_name, - :session_id => session_id, - :notification_id => notification_id, - :created_at => created_at - ) - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::SESSION_INVITATION, - :route_to => USER_TARGET_PREFIX + receiver_id, - :session_invitation => session_invitation - ) - end - - # create a friend update message - def friend_update(user_id, name, photo_url, online, msg) - friend = Jampb::FriendUpdate.new( - :user_id => user_id, - :name => name, - :photo_url => photo_url, - :online => online, - :msg => msg - ) - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::FRIEND_UPDATE, - :route_to => USER_TARGET_PREFIX + user_id, - :friend_update => friend - ) - end - - # create a friend request message - def friend_request(friend_request_id, user_id, name, photo_url, friend_id, msg, notification_id, created_at) - friend_request = Jampb::FriendRequest.new( - :friend_request_id => friend_request_id, - :user_id => user_id, - :name => name, - :photo_url => photo_url, - :friend_id => friend_id, - :msg => msg, - :notification_id => notification_id, - :created_at => created_at - ) - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::FRIEND_REQUEST, - :route_to => USER_TARGET_PREFIX + friend_id, - :friend_request => friend_request - ) - end - - # create a friend request acceptance message - def friend_request_accepted(friend_id, name, photo_url, user_id, msg, notification_id, created_at) - friend_request_accepted = Jampb::FriendRequestAccepted.new( - :friend_id => friend_id, - :name => name, - :photo_url => photo_url, - :user_id => user_id, - :msg => msg, - :notification_id => notification_id, - :created_at => created_at - ) - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::FRIEND_REQUEST_ACCEPTED, - :route_to => USER_TARGET_PREFIX + user_id, - :friend_request_accepted => friend_request_accepted ) end @@ -473,28 +529,6 @@ #################################################### - # create a heartbeat - def heartbeat() - heartbeat = Jampb::Heartbeat.new - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::HEARTBEAT, - :route_to => SERVER_TARGET, - :heartbeat => heartbeat - ) - end - - # create a heartbeat ack - def heartbeat_ack() - heartbeat_ack = Jampb::HeartbeatAck.new - - return Jampb::ClientMessage.new( - :type => ClientMessage::Type::HEARTBEAT_ACK, - :route_to => CLIENT_TARGET, - :heartbeat_ack => heartbeat_ack - ) - end - # is this message directed to the server? def server_directed? msg return msg.route_to == MessageFactory::SERVER_TARGET @@ -519,8 +553,8 @@ return msg.route_to[MessageFactory::SESSION_TARGET_PREFIX..-1] end - def get_message_type msg - return @type_values[msg.type] - end + def get_message_type msg + return @type_values[msg.type] + end end end diff --git a/ruby/lib/jam_ruby/models/notification.rb b/ruby/lib/jam_ruby/models/notification.rb index 5c54cdd00..9205bfbe2 100644 --- a/ruby/lib/jam_ruby/models/notification.rb +++ b/ruby/lib/jam_ruby/models/notification.rb @@ -81,7 +81,7 @@ module JamRuby return friend_ids end - def retrieve_followers(connection, user_id) + def retrieve_user_followers(connection, user_id) follower_ids = [] connection.exec("SELECT uf.follower_id as friend_id FROM users_followers uf WHERE uf.user_id = $1", [user_id]) do |follower_results| follower_results.each do |follower_result| @@ -93,7 +93,7 @@ module JamRuby def retrieve_friends_and_followers(connection, user_id) ids = retrieve_friends(connection, user_id) - ids.concat(retrieve_followers(connection, user_id)) + ids.concat(retrieve_user_followers(connection, user_id)) ids.uniq! {|id| id} return ids end @@ -109,7 +109,17 @@ module JamRuby return ids end - def format_msg(description, user = nil) + def retrieve_band_followers(connection, band_id) + follower_ids = [] + connection.exec("SELECT bf.follower_id as follower_id FROM bands_followers bf WHERE bf.band_id = $1", [band_id]) do |follower_results| + follower_results.each do |follower_result| + follower_ids.push(follower_result['follower_id']) + end + end + return follower_ids + end + + def format_msg(description, user = nil, band = nil) name = "" unless user.nil? name = user.name @@ -118,6 +128,8 @@ module JamRuby end case description + + # friend notifications when NotificationTypes::FRIEND_UPDATE return "#{name} is now " @@ -130,12 +142,13 @@ module JamRuby when NotificationTypes::FRIEND_SESSION_JOIN return "#{name} has joined the session." - when NotificationTypes::MUSICIAN_SESSION_JOIN - return "#{name} has joined the session." + when NotificationTypes::NEW_USER_FOLLOWER + return "#{name} is now following you on JamKazam." - when NotificationTypes::MUSICIAN_SESSION_DEPART - return "#{name} has left the session." + when NotificationTypes::NEW_BAND_FOLLOWER + return "#{name} is now following your band #{band.name} on JamKazam." + # session notifications when NotificationTypes::SESSION_INVITATION return "#{name} has invited you to a session." @@ -148,12 +161,42 @@ module JamRuby when NotificationTypes::JOIN_REQUEST_REJECTED return "We're sorry, but you cannot join the session at this time." + + # musician notifications + when NotificationTypes::MUSICIAN_SESSION_JOIN + return "#{name} has joined the session." + + when NotificationTypes::MUSICIAN_SESSION_DEPART + return "#{name} has left the session." + + + # recording notifications + when NotificationTypes::MUSICIAN_RECORDING_SAVED + return "#{name} has made a new recording." + + when NotificationTypes::BAND_RECORDING_SAVED + return "#{name} has made a new recording." + + when NotificationTypes::RECORDING_STARTED + return "#{name} has started a recording." + + when NotificationTypes::RECORDING_ENDED + return "#{name} has stopped recording." + + when NotificationTypes::RECORDING_MASTER_MIX_COMPLETE + return "This recording has been mastered and mixed and is ready to share." + + + # band notifications when NotificationTypes::BAND_INVITATION return "You have been invited to join the band #{name}." when NotificationTypes::BAND_INVITATION_ACCEPTED return "#{name} has accepted your band invitation." + when NotificationTypes::BAND_SESSION_JOIN + return "#{name} is now in a session." + else return "" end @@ -238,14 +281,43 @@ module JamRuby @@mq_router.publish_to_user(user_id, msg) end - ################## SESSION INVITATION ################## - def send_session_invitation(receiver_id, sender, session_id) + ################## FRIEND SESSION JOIN ################## + def send_friend_session_join(db_conn, connection, user) + ids = retrieve_friends_and_followers_not_in_session(db_conn, user.id, connection.music_session.id) + + unless ids.empty? + # (1) bulk save to database + notifications = [] + ids.each do |id| + notification = Notification.new + notification.description = NotificationTypes::FRIEND_SESSION_JOIN + notification.source_user_id = user.id + notification.target_user_id = id + notifications << notification + end + + Notification.import notifications + + # (2) create notification + msg = @@message_factory.friend_session_join( + connection.music_session.id, + user.id, + user.name, + user.photo_url) + + # (3) send notification + @@mq_router.publish_to_friends(ids, msg, sender = {:client_id => connection.client_id}) + end + end + + ############### NEW FOLLOWER ############### + def send_new_user_follower(follower, user) # (1) save to database notification = Notification.new - notification.description = NotificationTypes::SESSION_INVITATION + notification.description = NotificationTypes::NEW_USER_FOLLOWER notification.source_user_id = sender.id - notification.target_user_id = receiver_id + notification.target_user_id = receiver.id notification.session_id = session_id notification.save @@ -259,87 +331,41 @@ module JamRuby ) # (3) send notification - @@mq_router.publish_to_user(receiver_id, msg) + @@mq_router.publish_to_user(receiver.id, msg) end - ################## SESSION INVITATION ################## - def send_musician_session_join(music_session, connection, user) + def send_new_band_follower(follower, band) + end - # (1) create notification - msg = @@message_factory.musician_session_join( - music_session.id, - user.id, - user.name, - user.photo_url + ################## SESSION INVITATION ################## + def send_session_invitation(receiver, sender, session_id) + + # (1) save to database + notification = Notification.new + notification.description = NotificationTypes::SESSION_INVITATION + notification.source_user_id = sender.id + notification.target_user_id = receiver.id + notification.session_id = session_id + notification.save + + # (2) create notification + msg = @@message_factory.session_invitation( + receiver_id, + sender.name, + session_id, + notification.id, + notification.created_at.to_s ) - # (2) send notification - @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => connection.client_id}) + # (3) send notification + @@mq_router.publish_to_user(receiver.id, msg) end - ################## MUSICIAN SESSION DEPART ################## - def send_musician_session_depart(music_session, client_id, user, recordingId = nil) + ################## SESSION ENDED ################## + def send_session_ended(music_session, connection) - # (1) create notification - msg = @@message_factory.musician_session_depart( - music_session.id, - user.id, - user.name, - user.photo_url, - recordingId - ) - - # (2) send notification - @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) - end - - ################## MUSICIAN SESSION FRESH ################## - def send_musician_session_fresh(music_session, client_id, user) - - # (1) create notification - msg = @@message_factory.musician_session_fresh( - music_session.id, - user.id, - user.name, - user.photo_url - ) - - # (2) send notification - @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) - end - - ################## MUSICIAN SESSION STALE ################## - def send_musician_session_stale(music_session, client_id, user) - - # (1) create notification - msg = @@message_factory.musician_session_stale( - music_session.id, - user.id, - user.name, - user.photo_url - ) - - # (2) send notification - @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) - end - - ################## FRIEND SESSION JOIN ################## - def send_friend_session_join(db_conn, connection, user) - ids = retrieve_friends_and_followers_not_in_session(db_conn, user.id, connection.music_session.id) - - if ids.length > 0 - # (1) save to database - - # (2) create notification - msg = @@message_factory.friend_session_join( - connection.music_session.id, - user.id, - user.name, - user.photo_url) - - # (3) send notification - @@mq_router.publish_to_friends(ids, msg, sender = {:client_id => connection.client_id}) - end + # TODO: this should actually publish to all users who have a notification for this session + @@mq_router.server_publish_to_session(music_session, nil, sender = {:client_id => connection.client_id}) end ################## JOIN REQUEST ################## @@ -423,6 +449,74 @@ module JamRuby @@mq_router.publish_to_user(join_request.user.id, msg) end + ################## MUSICIAN SESSION JOIN ################## + def send_musician_session_join(music_session, connection, user) + + # (1) create notification + msg = @@message_factory.musician_session_join( + music_session.id, + user.id, + user.name, + user.photo_url + ) + + # (2) send notification + @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => connection.client_id}) + end + + ################## MUSICIAN SESSION DEPART ################## + def send_musician_session_depart(music_session, client_id, user, recordingId = nil) + + # (1) create notification + msg = @@message_factory.musician_session_depart( + music_session.id, + user.id, + user.name, + user.photo_url, + recordingId + ) + + # (2) send notification + @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) + end + + ################## MUSICIAN RECORDING SAVED ################## + def send_musician_recording_saved(recording, user) + + ids = retrieve_friends_and_followers(connection, user_id) + + # (1) save to database + notification = Notification.new + notification.description = NotificationTypes::MUSICIAN_RECORDING_SAVED + notification.source_user_id = user.id + notification.target_user_id = join_request.user.id + notification.session_id = music_session.id + notification.save + + # (2) create notification + notification_msg = format_msg(notification.description, user) + msg = @@message_factory.join_request_approved( + join_request.id, + music_session.id, + music_session.creator.name, + music_session.creator.photo_url, + notification_msg, + notification.id, + notification.created_at.to_s + ) + + # (3) send notification + @@mq_router.publish_to_friends(ids, msg, sender = {:client_id => connection.client_id}) + end + + ################## BAND RECORDING SAVED ################## + + ################## RECORDING STARTED ################## + + ################## RECORDING ENDED ################## + + ################## RECORDING MASTER MIX COMPLETE ################## + ################## BAND INVITATION ################## def send_band_invitation(band, band_invitation, sender, receiver) @@ -481,6 +575,38 @@ module JamRuby @@mq_router.publish_to_user(receiver.id, msg) end + ################## BAND SESSION JOIN ################## + + ################## MUSICIAN SESSION FRESH ################## + def send_musician_session_fresh(music_session, client_id, user) + + # (1) create notification + msg = @@message_factory.musician_session_fresh( + music_session.id, + user.id, + user.name, + user.photo_url + ) + + # (2) send notification + @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) + end + + ################## MUSICIAN SESSION STALE ################## + def send_musician_session_stale(music_session, client_id, user) + + # (1) create notification + msg = @@message_factory.musician_session_stale( + music_session.id, + user.id, + user.name, + user.photo_url + ) + + # (2) send notification + @@mq_router.server_publish_to_session(music_session, msg, sender = {:client_id => client_id}) + end + end end end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index c2b138aed..c0c47f254 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -548,6 +548,28 @@ module JamRuby self.save end + def create_user_following(user_id) + follower = UserFollower.new + follower.user_id = user_id + follower.follower_id = self.id + follower.save + + # TODO: make this async + user = User.find(user_id) + Notification.send_new_user_follower(self, user) + end + + def create_band_following(band_id) + follower = BandFollower.new + follower.band_id = band_id + follower.follower_id = self.id + follower.save + + # TODO: make this async + band = Band.find(band_id) + Notification.send_new_band_follower(self, band) + end + def self.finalize_update_email(update_email_token) # updates the user model to have a new email address user = User.find_by_update_email_token!(update_email_token) @@ -560,7 +582,6 @@ module JamRuby return user end - def self.create_user_like(user_id, liker_id) liker = UserLiker.new() liker.user_id = user_id @@ -578,7 +599,7 @@ module JamRuby end def self.create_band_like(band_id, liker_id) - liker = BandLiker.new() + liker = BandLiker.new liker.band_id = band_id liker.liker_id = liker_id liker.save @@ -588,13 +609,6 @@ module JamRuby JamRuby::BandLiker.delete_all "(band_id = '#{band_id}' AND liker_id = '#{liker_id}')" end - def self.create_user_following(user_id, follower_id) - follower = UserFollower.new() - follower.user_id = user_id - follower.follower_id = follower_id - follower.save - end - def self.delete_following(user_id, band_id, follower_id) if !user_id.nil? JamRuby::UserFollower.delete_all "(user_id = '#{user_id}' AND follower_id = '#{follower_id}')" @@ -604,19 +618,12 @@ module JamRuby end end - def self.create_band_following(band_id, follower_id) - follower = BandFollower.new() - follower.band_id = band_id - follower.follower_id = follower_id - follower.save - end - def self.delete_band_following(band_id, follower_id) JamRuby::BandFollower.delete_all "(band_id = '#{band_id}' AND follower_id = '#{follower_id}')" end def self.create_favorite(user_id, recording_id) - favorite = UserFavorite.new() + favorite = UserFavorite.new favorite.user_id = user_id favorite.recording_id = recording_id favorite.save diff --git a/web/app/assets/javascripts/AAB_message_factory.js b/web/app/assets/javascripts/AAB_message_factory.js index b648b7ec9..e96aedff2 100644 --- a/web/app/assets/javascripts/AAB_message_factory.js +++ b/web/app/assets/javascripts/AAB_message_factory.js @@ -12,22 +12,42 @@ LOGIN_ACK : "LOGIN_ACK", LOGIN_MUSIC_SESSION : "LOGIN_MUSIC_SESSION", LOGIN_MUSIC_SESSION_ACK : "LOGIN_MUSIC_SESSION_ACK", - FRIEND_SESSION_JOIN : "FRIEND_SESSION_JOIN", - MUSICIAN_SESSION_JOIN : "MUSICIAN_SESSION_JOIN", - MUSICIAN_SESSION_DEPART : "MUSICIAN_SESSION_DEPART", LEAVE_MUSIC_SESSION : "LEAVE_MUSIC_SESSION", LEAVE_MUSIC_SESSION_ACK : "LEAVE_MUSIC_SESSION_ACK", HEARTBEAT : "HEARTBEAT", HEARTBEAT_ACK : "HEARTBEAT_ACK", + + // friend notifications FRIEND_UPDATE : "FRIEND_UPDATE", + FRIEND_REQUEST : "FRIEND_REQUEST", + FRIEND_REQUEST_ACCEPTED : "FRIEND_REQUEST_ACCEPTED", + FRIEND_SESSION_JOIN : "FRIEND_SESSION_JOIN", + NEW_USER_FOLLOWER : "NEW_USER_FOLLOWER", + NEW_BAND_FOLLOWER : "NEW_BAND_FOLLOWER", + + // session notifications SESSION_INVITATION : "SESSION_INVITATION", + SESSION_ENDED : "SESSION_ENDED", JOIN_REQUEST : "JOIN_REQUEST", JOIN_REQUEST_APPROVED : "JOIN_REQUEST_APPROVED", JOIN_REQUEST_REJECTED : "JOIN_REQUEST_REJECTED", - FRIEND_REQUEST : "FRIEND_REQUEST", - FRIEND_REQUEST_ACCEPTED : "FRIEND_REQUEST_ACCEPTED", + + // musician notifications + MUSICIAN_SESSION_JOIN : "MUSICIAN_SESSION_JOIN", + MUSICIAN_SESSION_DEPART : "MUSICIAN_SESSION_DEPART", + + // recording notifications + MUSICIAN_RECORDING_SAVED : "MUSICIAN_RECORDING_SAVED", + BAND_RECORDING_SAVED : "BAND_RECORDING_SAVED", + RECORDING_STARTED : "RECORDING_STARTED", + RECORDING_ENDED : "RECORDING_ENDED", + RECORDING_MASTER_MIX_COMPLETE : "RECORDING_MASTER_MIX_COMPLETE", + + // band notifications BAND_INVITATION : "BAND_INVITATION", BAND_INVITATION_ACCEPTED : "BAND_INVITATION_ACCEPTED", + BAND_SESSION_JOIN : "BAND_SESSION_JOIN", + TEST_SESSION_MESSAGE : "TEST_SESSION_MESSAGE", PING_REQUEST : "PING_REQUEST", PING_ACK : "PING_ACK", @@ -84,10 +104,10 @@ // reconnect_music_session_id is an optional argument that allows the session to be immediately associated // with a music session. factory.login_with_token = function(token, reconnect_music_session_id) { - //context.JK.logger.debug("*** login_with_token: client_id = "+$.cookie("client_id")); + //context.JK.logger.debug("*** login_with_token: client_id = "+$.cookie("client_id")); var login = { token : token, - client_id : $.cookie("client_id") - }; + client_id : $.cookie("client_id") + }; return client_container(msg.LOGIN, route_to.SERVER, login); }; diff --git a/web/app/assets/javascripts/sidebar.js b/web/app/assets/javascripts/sidebar.js index f78fda21e..849a53ce6 100644 --- a/web/app/assets/javascripts/sidebar.js +++ b/web/app/assets/javascripts/sidebar.js @@ -156,9 +156,11 @@ acceptFriendRequest({ "friend_request_id": payload.friend_request_id, "notification_id": payload.notification_id }); }); } + else if (type === context.JK.MessageType.FRIEND_REQUEST_ACCEPTED) { $notification.find('#div-actions').hide(); } + else if (type === context.JK.MessageType.SESSION_INVITATION) { var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('JOIN'); @@ -166,6 +168,7 @@ openTerms({ "session_id": payload.session_id, "notification_id": payload.notification_id }); }); } + else if (type === context.JK.MessageType.JOIN_REQUEST) { var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('APPROVE'); @@ -173,6 +176,7 @@ approveJoinRequest({ "join_request_id": payload.join_request_id, "notification_id": payload.notification_id }); }); } + else if (type === context.JK.MessageType.JOIN_REQUEST_APPROVED) { var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('JOIN'); @@ -180,9 +184,11 @@ openTerms({ "session_id": payload.session_id, "notification_id": payload.notification_id }); }); } + else if (type === context.JK.MessageType.JOIN_REQUEST_REJECTED) { $notification.find('#div-actions').hide(); } + else if (type === context.JK.MessageType.BAND_INVITATION) { var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('ACCEPT'); @@ -190,6 +196,7 @@ acceptBandInvitation({ "band_invitation_id": payload.band_invitation_id, "band_id": payload.band_id, "notification_id": payload.notification_id }); }); } + else if (type === context.JK.MessageType.BAND_INVITATION_ACCEPTED) { $notification.find('#div-actions').hide(); } @@ -421,18 +428,36 @@ $('.sidebar .invite-friend-row').hoverIntent(inviteHoverIn, inviteHoverOut); + // friend notifications registerFriendUpdate(); registerFriendRequest(); registerFriendRequestAccepted(); - registerMusicianSessionJoin(); - registerMusicianSessionDepart(); registerFriendSessionJoin(); + registerNewUserFollower(); + registerNewBandFollower(); + + // session invitations registerSessionInvitation(); + registerSessionEnded(); registerJoinRequest(); registerJoinRequestApproved(); registerJoinRequestRejected(); + + // musician notifications + registerMusicianSessionJoin(); + registerMusicianSessionDepart(); + + // recording notifications + registerMusicianRecordingSaved(); + registerBandRecordingSaved(); + registerRecordingStarted(); + registerRecordingEnded(); + registerRecordingMasterMixComplete(); + + // band notifications registerBandInvitation(); registerBandInvitationAccepted(); + registerBandSessionJoin(); // watch for Invite More Users events $('#sidebar-div .btn-email-invitation').click(function() { @@ -512,45 +537,14 @@ }); } - function registerMusicianSessionJoin() { - context.JK.JamServer.registerMessageCallback(context.JK.MessageType.MUSICIAN_SESSION_JOIN, function(header, payload) { - logger.debug("Handling MUSICIAN_SESSION_JOIN msg " + JSON.stringify(payload)); - - // display notification - app.notify({ - "title": "Musician Joined Session", - "text": payload.username + " has joined the session.", - "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) - }); - }); - } - - function registerMusicianSessionDepart() { - context.JK.JamServer.registerMessageCallback(context.JK.MessageType.MUSICIAN_SESSION_DEPART, function(header, payload) { - logger.debug("Handling MUSICIAN_SESSION_DEPART msg " + JSON.stringify(payload)); - - if(payload.recordingId && context.JK.CurrentSessionModel.recordingModel.isRecording(payload.recordingId)) { - context.JK.CurrentSessionModel.recordingModel.onServerStopRecording(payload.recordingId); - /**app.notify({ - "title": "Recording Stopped", - "text": payload.username + " has left the session.", - "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) - }); */ - } - else { - app.notify({ - "title": "Musician Left Session", - "text": payload.username + " has left the session.", - "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) - }); - } - }); - } - function registerFriendSessionJoin() { + context.JK.JamServer.registerMessageCallback(context.JK.MessageType.FRIEND_SESSION_JOIN, function(header, payload) { logger.debug("Handling FRIEND_SESSION_JOIN msg " + JSON.stringify(payload)); + // update sidebar + handleNotification(payload, header.type); + // display notification app.notify({ "title": "Friend Joined Session", @@ -560,6 +554,41 @@ }); } + function registerNewUserFollower() { + + context.JK.JamServer.registerMessageCallback(context.JK.MessageType.NEW_USER_FOLLOWER, function(header, payload) { + logger.debug("Handling NEW_USER_FOLLOWER msg " + JSON.stringify(payload)); + + // update sidebar + handleNotification(payload, header.type); + + // display notification + app.notify({ + "title": "New Follower", + "text": payload.msg, + "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) + }); + }); + } + + function registerNewBandFollower() { + + context.JK.JamServer.registerMessageCallback(context.JK.MessageType.NEW_BAND_FOLLOWER, function(header, payload) { + logger.debug("Handling NEW_BAND_FOLLOWER msg " + JSON.stringify(payload)); + + // update sidebar + handleNotification(payload, header.type); + + // display notification + app.notify({ + "title": "New Band Follower", + "text": payload.msg, + "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) + }); + }); + + } + function registerSessionInvitation() { context.JK.JamServer.registerMessageCallback(context.JK.MessageType.SESSION_INVITATION, function(header, payload) { logger.debug("Handling SESSION_INVITATION msg " + JSON.stringify(payload)); @@ -608,6 +637,10 @@ context.location = '#/session/' + args.session_id; } + function registerSessionEnded() { + + } + function registerJoinRequest() { context.JK.JamServer.registerMessageCallback(context.JK.MessageType.JOIN_REQUEST, function(header, payload) { logger.debug("Handling JOIN_REQUEST msg " + JSON.stringify(payload)); @@ -678,6 +711,62 @@ }); } + + function registerMusicianSessionJoin() { + context.JK.JamServer.registerMessageCallback(context.JK.MessageType.MUSICIAN_SESSION_JOIN, function(header, payload) { + logger.debug("Handling MUSICIAN_SESSION_JOIN msg " + JSON.stringify(payload)); + + // display notification + app.notify({ + "title": "Musician Joined Session", + "text": payload.username + " has joined the session.", + "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) + }); + }); + } + + function registerMusicianSessionDepart() { + context.JK.JamServer.registerMessageCallback(context.JK.MessageType.MUSICIAN_SESSION_DEPART, function(header, payload) { + logger.debug("Handling MUSICIAN_SESSION_DEPART msg " + JSON.stringify(payload)); + + if(payload.recordingId && context.JK.CurrentSessionModel.recordingModel.isRecording(payload.recordingId)) { + context.JK.CurrentSessionModel.recordingModel.onServerStopRecording(payload.recordingId); + /**app.notify({ + "title": "Recording Stopped", + "text": payload.username + " has left the session.", + "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) + }); */ + } + else { + app.notify({ + "title": "Musician Left Session", + "text": payload.username + " has left the session.", + "icon_url": context.JK.resolveAvatarUrl(payload.photo_url) + }); + } + }); + } + + function registerMusicianRecordingSaved() { + + } + + function registerBandRecordingSaved() { + + } + + function registerRecordingStarted() { + + } + + function registerRecordingEnded() { + + } + + function registerRecordingMasterMixComplete() { + + } + function registerBandInvitation() { context.JK.JamServer.registerMessageCallback(context.JK.MessageType.BAND_INVITATION, function(header, payload) { logger.debug("Handling BAND_INVITATION msg " + JSON.stringify(payload)); @@ -726,6 +815,10 @@ }); } + function registerBandSessionJoin() { + + } + this.initialize = function(invitationDialogInstance) { events(); initializeFriendsPanel(); diff --git a/web/app/controllers/api_invitations_controller.rb b/web/app/controllers/api_invitations_controller.rb index 48faa4fb5..266f97d6d 100644 --- a/web/app/controllers/api_invitations_controller.rb +++ b/web/app/controllers/api_invitations_controller.rb @@ -46,7 +46,7 @@ class ApiInvitationsController < ApiController User.save_session_settings(current_user, music_session) # send notification - Notification.send_session_invitation(receiver.id, current_user, music_session.id) + Notification.send_session_invitation(receiver, current_user, music_session.id) respond_with @invitation, :responder => ApiResponder, :location => api_invitation_detail_url(@invitation) else diff --git a/web/app/controllers/api_users_controller.rb b/web/app/controllers/api_users_controller.rb index 1fa1c4271..00e539451 100644 --- a/web/app/controllers/api_users_controller.rb +++ b/web/app/controllers/api_users_controller.rb @@ -269,11 +269,11 @@ class ApiUsersController < ApiController id = params[:id] if !params[:user_id].nil? - User.create_user_following(params[:user_id], id) + @user.create_user_following(params[:user_id]) respond_with @user, responder: ApiResponder, :location => api_user_following_index_url(@user) elsif !params[:band_id].nil? - User.create_band_following(params[:band_id], id) + @user.create_band_following(params[:band_id]) respond_with @user, responder: ApiResponder, :location => api_band_following_index_url(@user) end end From 7bb4b4a3c830128af40d386b8aa67d454fe4fc82 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 29 Dec 2013 13:14:50 -0500 Subject: [PATCH 04/78] VRFS-936 Session header bar missing --- web/app/views/clients/_session.html.erb | 190 ++++++++++++------------ 1 file changed, 96 insertions(+), 94 deletions(-) diff --git a/web/app/views/clients/_session.html.erb b/web/app/views/clients/_session.html.erb index 4c71c8349..6aca6d92f 100644 --- a/web/app/views/clients/_session.html.erb +++ b/web/app/views/clients/_session.html.erb @@ -7,116 +7,118 @@

session

+
-
- - <%= image_tag "content/icon_resync.png", {:align => "texttop", :height => 14, :width => 12} %> - RESYNC - - - <%= image_tag "content/icon_settings_sm.png", {:align => "texttop", :height => 12, :width => 12} %> - SETTINGS - - - <%= image_tag "content/icon_share.png", {:align => "texttop", :height => 12, :width => 12} %> - SHARE - +
+ + <%= image_tag "content/icon_resync.png", {:align => "texttop", :height => 14, :width => 12} %> + RESYNC + + + <%= image_tag "content/icon_settings_sm.png", {:align => "texttop", :height => 12, :width => 12} %> + SETTINGS + + + <%= image_tag "content/icon_share.png", {:align => "texttop", :height => 12, :width => 12} %> + SHARE + - -
-
VOLUME:
-
+ +
+
VOLUME:
+
+
+ + +
+
MIX:
+
others
+
+
me
+
+ + + X  LEAVE
+ - -
-
MIX:
-
others
-
-
me
-
+ +
+
- - X  LEAVE -
- + +
- -
-
+ +
+

my tracks

+
+ <%= image_tag "content/icon_settings_lg.png", {:width => 18, :height => 18} %>  Settings +
- -
- - -
-

my tracks

-
- <%= image_tag "content/icon_settings_lg.png", {:width => 18, :height => 18} %>  Settings -
- -
-
- -
- -
-

live tracks

- From 1806c5245f79d1672acfa242649b86f09eaef0fd Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 29 Dec 2013 14:40:21 -0500 Subject: [PATCH 05/78] VRFS-933 notification work --- .../user_mailer/band_invitation.html.erb | 0 .../user_mailer/band_invitation.text.erb | 0 .../band_invitation_acceptance.html.erb | 0 .../band_invitation_acceptance.text.erb | 0 .../user_mailer/band_recording_saved.html.erb | 0 .../user_mailer/band_recording_saved.text.erb | 0 .../user_mailer/band_session_join.html.erb | 0 .../user_mailer/band_session_join.text.erb | 0 .../user_mailer/friend_request.html.erb | 0 .../user_mailer/friend_request.text.erb | 0 .../friend_request_acceptance.html.erb | 0 .../friend_request_acceptance.text.erb | 0 .../musician_recording_saved.html.erb | 0 .../musician_recording_saved.text.erb | 0 .../musician_session_join.html.erb | 0 .../musician_session_join.text.erb | 0 .../user_mailer/new_band_follower.html.erb | 0 .../user_mailer/new_band_follower.text.erb | 0 .../user_mailer/new_user_follower.html.erb | 0 .../user_mailer/new_user_follower.text.erb | 0 .../recording_master_mix_complete.html.erb | 0 .../recording_master_mix_complete.text.erb | 0 ruby/lib/jam_ruby/models/notification.rb | 38 ++++- web/app/assets/javascripts/profile.js | 160 +++++++++--------- web/app/assets/javascripts/sidebar.js | 4 + 25 files changed, 113 insertions(+), 89 deletions(-) create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.text.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.html.erb create mode 100644 ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.text.erb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_invitation_acceptance.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_recording_saved.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/band_session_join.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_recording_saved.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/musician_session_join.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_user_follower.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/recording_master_mix_complete.text.erb new file mode 100644 index 000000000..e69de29bb diff --git a/ruby/lib/jam_ruby/models/notification.rb b/ruby/lib/jam_ruby/models/notification.rb index 9205bfbe2..1a25eb7a8 100644 --- a/ruby/lib/jam_ruby/models/notification.rb +++ b/ruby/lib/jam_ruby/models/notification.rb @@ -316,25 +316,46 @@ module JamRuby # (1) save to database notification = Notification.new notification.description = NotificationTypes::NEW_USER_FOLLOWER - notification.source_user_id = sender.id - notification.target_user_id = receiver.id - notification.session_id = session_id + notification.source_user_id = follower.id + notification.target_user_id = user.id notification.save # (2) create notification - msg = @@message_factory.session_invitation( - receiver_id, - sender.name, - session_id, + notification_msg = format_msg(notification.description, follower) + msg = @@message_factory.new_user_follower( + user.id, + follower.name, + follower.photo_url, + notification_msg, notification.id, notification.created_at.to_s ) # (3) send notification - @@mq_router.publish_to_user(receiver.id, msg) + @@mq_router.publish_to_user(user.id, msg) end def send_new_band_follower(follower, band) + # (1) save to database + notification = Notification.new + notification.description = NotificationTypes::NEW_BAND_FOLLOWER + notification.source_user_id = follower.id + notification.target_user_id = user.id + notification.save + + # (2) create notification + notification_msg = format_msg(notification.description, follower, band) + msg = @@message_factory.new_user_follower( + user.id, + follower.name, + follower.photo_url, + notification_msg, + notification.id, + notification.created_at.to_s + ) + + # (3) send notification + @@mq_router.publish_to_user(user.id, msg) end ################## SESSION INVITATION ################## @@ -440,7 +461,6 @@ module JamRuby music_session.id, music_session.creator.name, music_session.creator.photo_url, - notification_msg, notification.id, notification.created_at.to_s ) diff --git a/web/app/assets/javascripts/profile.js b/web/app/assets/javascripts/profile.js index fb9bab119..b6e1cb4d6 100644 --- a/web/app/assets/javascripts/profile.js +++ b/web/app/assets/javascripts/profile.js @@ -24,7 +24,7 @@ function beforeShow(data) { userId = data.id; - user = null; + user = null; } function afterShow(data) { @@ -46,83 +46,83 @@ $('.profile-nav a.#profile-about-link').addClass('active'); } - function getUser() { - if (user === null) { - var url = "/api/users/" + userId; - $.ajax({ - type: "GET", - dataType: "json", - url: url, - async: false, - processData:false, - success: function(response) { - user = response; - }, - error: function(jqXHR, textStatus, errorMessage) { - user = null; - app.ajaxError(jqXHR, textStatus, errorMessage); - } - }); - } - return user; - } + function getUser() { + if (user === null) { + var url = "/api/users/" + userId; + $.ajax({ + type: "GET", + dataType: "json", + url: url, + async: false, + processData:false, + success: function(response) { + user = response; + }, + error: function(jqXHR, textStatus, errorMessage) { + user = null; + app.ajaxError(jqXHR, textStatus, errorMessage); + } + }); + } + return user; + } - function isMusician() { - if (getUser()) { - return user.musician === true; - } - return false; - } + function isMusician() { + if (getUser()) { + return user.musician === true; + } + return false; + } - function isCurrentUser() { - return userId === context.JK.currentUserId; - } + function isCurrentUser() { + return userId === context.JK.currentUserId; + } - function configureUserType() { - if (isMusician()) { - $('#profile-history-link').show(); - $('#profile-bands-link').show(); - $('#profile-instruments').show(); - $('#profile-session-stats').show(); - $('#profile-recording-stats').show(); + function configureUserType() { + if (isMusician()) { + $('#profile-history-link').show(); + $('#profile-bands-link').show(); + $('#profile-instruments').show(); + $('#profile-session-stats').show(); + $('#profile-recording-stats').show(); - // $('#profile-following-stats').hide(); - // $('#profile-favorites-stats').hide(); + // $('#profile-following-stats').hide(); + // $('#profile-favorites-stats').hide(); - $('#btn-add-friend').show(); + $('#btn-add-friend').show(); $('.profile-social-left').show(); - $('#profile-type-label').text('musician'); - $('#profile-location-label').text('Location'); + $('#profile-type-label').text('musician'); + $('#profile-location-label').text('Location'); - } else { - $('#profile-history-link').hide(); - $('#profile-bands-link').hide(); - $('#profile-instruments').hide(); - $('#profile-session-stats').hide(); - $('#profile-recording-stats').hide(); + } else { + $('#profile-history-link').hide(); + $('#profile-bands-link').hide(); + $('#profile-instruments').hide(); + $('#profile-session-stats').hide(); + $('#profile-recording-stats').hide(); - // $('#profile-following-stats').show(); - // $('#profile-favorites-stats').show(); - - $('#btn-add-friend').hide(); + // $('#profile-following-stats').show(); + // $('#profile-favorites-stats').show(); + + $('#btn-add-friend').hide(); $('.profile-social-left').hide(); - $('#profile-type-label').text('fan'); - $('#profile-location-label').text('Presence'); - } + $('#profile-type-label').text('fan'); + $('#profile-location-label').text('Presence'); + } - if (isCurrentUser()) { + if (isCurrentUser()) { $('#btn-profile-edit').show(); - } else { + } else { $('#btn-profile-edit').hide(); - } - } + } + } /****************** MAIN PORTION OF SCREEN *****************/ // events for main screen function events() { - configureUserType(); + configureUserType(); // wire up panel clicks $('#profile-about-link').click(renderAbout); @@ -168,7 +168,7 @@ } function isFriend() { - return getUser() ? user.is_friend : false; + return getUser() ? user.is_friend : false; } function friendRequestCallback() { @@ -240,7 +240,7 @@ } function isFollowing() { - return getUser() ? user.is_following : false; + return getUser() ? user.is_following : false; } function configureFollowingButton(following) { @@ -338,18 +338,18 @@ text = user.follower_count > 1 || user.follower_count === 0 ? " Followers" : " Follower"; $('#profile-follower-stats').html(user.follower_count + text); - if (isMusician()) { + if (isMusician()) { text = user.session_count > 1 || user.session_count === 0 ? " Sessions" : " Session"; $('#profile-session-stats').html(user.session_count + text); text = user.recording_count > 1 || user.recording_count === 0 ? " Recordings" : " Recording"; $('#profile-recording-stats').html(user.recording_count + text); - } else { + } else { text = " Following"; $('#profile-following-stats').html(user.following_count + text); text = user.favorite_count > 1 || user.favorite_count === 0 ? " Favorites" : " Favorite"; $('#profile-favorite-stats').html(user.favorite_count + text); - } + } $('#profile-biography').html(user.biography); } @@ -373,41 +373,41 @@ $('.profile-nav a.active').removeClass('active'); $('.profile-nav a.#profile-social-link').addClass('active'); - /*if (isMusician()) { + /*if (isMusician()) { $('.profile-social-left').show(); - } else { + } else { $('.profile-social-left').hide(); - }*/ + }*/ bindSocial(); } function bindSocial() { - if (isMusician()) { - // FRIENDS - var url = "/api/users/" + userId + "/friends"; - $.ajax({ + if (isMusician()) { + // FRIENDS + var url = "/api/users/" + userId + "/friends"; + $.ajax({ type: "GET", dataType: "json", url: url, async: false, processData:false, success: function(response) { - $.each(response, function(index, val) { + $.each(response, function(index, val) { var template = $('#template-profile-social').html(); var friendHtml = context.JK.fillTemplate(template, { - avatar_url: context.JK.resolveAvatarUrl(val.photo_url), - userName: val.name, - location: val.location, - type: "Friends" + avatar_url: context.JK.resolveAvatarUrl(val.photo_url), + userName: val.name, + location: val.location, + type: "Friends" }); $('#profile-social-friends').append(friendHtml); - }); + }); }, error: app.ajaxError - }); - } + }); + } // FOLLOWINGS (USERS) url = "/api/users/" + userId + "/followings"; diff --git a/web/app/assets/javascripts/sidebar.js b/web/app/assets/javascripts/sidebar.js index 849a53ce6..c7bf88b9e 100644 --- a/web/app/assets/javascripts/sidebar.js +++ b/web/app/assets/javascripts/sidebar.js @@ -161,6 +161,10 @@ $notification.find('#div-actions').hide(); } + else if (type === context.JK.MessageType.NEW_USER_FOLLOWER || type === context.JK.MessageType.NEW_BAND_FOLLOWER) { + $notification.find('#div-actions').hide(); + } + else if (type === context.JK.MessageType.SESSION_INVITATION) { var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('JOIN'); From 144f97f470d2d7e8eccdb1b7c1f5eef1e781c7c5 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 29 Dec 2013 15:52:29 -0500 Subject: [PATCH 06/78] VRFS-935 Account identity screen borked. --- web/app/assets/stylesheets/client/account.css.scss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/app/assets/stylesheets/client/account.css.scss b/web/app/assets/stylesheets/client/account.css.scss index a5981de62..d49ba33b9 100644 --- a/web/app/assets/stylesheets/client/account.css.scss +++ b/web/app/assets/stylesheets/client/account.css.scss @@ -1,9 +1,10 @@ @import 'common.css.scss'; -.account-content-scroller { +.account-content-scroller, +#account-identity-content-scroller { .content-wrapper { - padding:10px 35px; + padding:10px 30px; } .content-wrapper.account { @@ -114,6 +115,7 @@ .button-orange, .button-grey { line-height:14px; + margin-top:6px; margin-right:0; } @@ -122,7 +124,7 @@ } div.field { - margin-bottom:27px; + margin-bottom:21px; } div.profile-instrumentlist table { From 56bf44561023273642f3d4f9f9cf6785c66c228f Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 29 Dec 2013 15:55:55 -0500 Subject: [PATCH 07/78] VRFS-935 Account identity screen borked. --- web/app/assets/stylesheets/client/account.css.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/web/app/assets/stylesheets/client/account.css.scss b/web/app/assets/stylesheets/client/account.css.scss index d49ba33b9..93967f182 100644 --- a/web/app/assets/stylesheets/client/account.css.scss +++ b/web/app/assets/stylesheets/client/account.css.scss @@ -17,6 +17,7 @@ } h4 { + margin-top:8px; margin-bottom: 10px; font-weight:bold; } From 90f81e0994c8e508780f8a826606e19446bd053d Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 29 Dec 2013 16:42:18 -0500 Subject: [PATCH 08/78] VRFS-934 Remove extraneous scrollbar due to explicit height in markup --- web/app/views/clients/_profile.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/views/clients/_profile.html.erb b/web/app/views/clients/_profile.html.erb index 238d2cdd8..5a276fa1e 100644 --- a/web/app/views/clients/_profile.html.erb +++ b/web/app/views/clients/_profile.html.erb @@ -45,7 +45,7 @@
-
+
From 102306e4d1ec28350b613467c0f2c0676ea7c8a7 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 29 Dec 2013 20:49:44 -0500 Subject: [PATCH 09/78] VRFS-933 notification work --- ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 44 ++++-- .../user_mailer/friend_request.html.erb | 3 + .../user_mailer/friend_request.text.erb | 1 + .../friend_request_acceptance.html.erb | 3 + .../friend_request_acceptance.text.erb | 1 + .../user_mailer/new_band_follower.html.erb | 3 + .../user_mailer/new_band_follower.text.erb | 1 + ruby/lib/jam_ruby/message_factory.rb | 2 +- ruby/lib/jam_ruby/models/notification.rb | 137 +++++++++++------- web/app/assets/javascripts/profile.js | 2 +- web/app/views/api_users/show.rabl | 4 +- 11 files changed, 129 insertions(+), 72 deletions(-) diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index b59c74f86..14e7c72c2 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -92,24 +92,42 @@ def friend_request(source_user, target_user) - end + @user = source_user + sendgrid_category "Notification" + sendgrid_unique_args :type => "friend_request" - def friend_request_accepted(source_user, target_user) - end - - def new_user_follower(source_user, target_user) - @user = target_user - sendgrid_unique_args :type => "new_user_follower" - mail(:to => @user.email, :subject => "You have a new follower on JamKazam") do |format| + mail(:to => target_user.email, :subject => "You have a new JamKazam friend request") do |format| format.text format.html end end - def new_band_follower(source_user, target_users, band) - sendgrid_unique_args :type => "new_band_follower" + def friend_request_accepted(source_user, target_user) + @user = source_user + sendgrid_category "Notification" + sendgrid_unique_args :type => "friend_request_accepted" - mail(:to => extract_emails(target_users), :subject => "Your band has a new follower on JamKazam") do |format| + mail(:to => target_user.email, :subject => "#{@user.name} accepted your JamKazam friend request") do |format| + format.text + format.html + end + end + + def new_user_follower(source_user, target_user) + @user = source_user + sendgrid_category "Notification" + sendgrid_unique_args :type => "new_user_follower" + mail(:to => target_user.email, :subject => "You have a new follower on JamKazam") do |format| + format.text + format.html + end + end + + def new_band_follower(source_user, target_user, band) + @user, @band = source_user, band + sendgrid_category "Notification" + sendgrid_unique_args :type => "new_band_follower" + mail(:to => target_user, :subject => "Your band has a new follower on JamKazam") do |format| format.text format.html end @@ -123,9 +141,5 @@ @user = user end - def extract_emails(users) - users.map! { |u| u.email } - end - end end diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb index e69de29bb..3bfedccf4 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.html.erb @@ -0,0 +1,3 @@ +<% provide(:title, 'New JamKazam Friend Request') %> + +

<% @user.name %> has sent you a friend request on JamKazam.

\ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb index e69de29bb..ac39cad90 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request.text.erb @@ -0,0 +1 @@ +<% @user.name %> has sent you a friend request on JamKazam. \ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb index e69de29bb..f7edf076b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.html.erb @@ -0,0 +1,3 @@ +<% provide(:title, 'Friend Request Accepted') %> + +

<% @user.name %> has accepted your friend request on JamKazam.

\ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb index e69de29bb..e2773a017 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/friend_request_acceptance.text.erb @@ -0,0 +1 @@ +<% @user.name %> has accepted your friend request on JamKazam. \ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb index e69de29bb..74b17512b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.html.erb @@ -0,0 +1,3 @@ +<% provide(:title, 'New Band Follower on JamKazam') %> + +

<% @user.name %> is now following your band <%= @band.name %> on JamKazam.

\ No newline at end of file diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb index e69de29bb..c5a2aae2b 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/new_band_follower.text.erb @@ -0,0 +1 @@ +<% @user.name %> is now following your band <%= @band.name %> on JamKazam. \ No newline at end of file diff --git a/ruby/lib/jam_ruby/message_factory.rb b/ruby/lib/jam_ruby/message_factory.rb index 425f182cf..c1f41a916 100644 --- a/ruby/lib/jam_ruby/message_factory.rb +++ b/ruby/lib/jam_ruby/message_factory.rb @@ -296,7 +296,7 @@ return Jampb::ClientMessage.new( :type => ClientMessage::Type::NEW_BAND_FOLLOWER, :route_to => USER_TARGET_PREFIX + receiver_id, - :new_user_follower => new_band_follower + :new_band_follower => new_band_follower ) end diff --git a/ruby/lib/jam_ruby/models/notification.rb b/ruby/lib/jam_ruby/models/notification.rb index 1a25eb7a8..2d4fd02c1 100644 --- a/ruby/lib/jam_ruby/models/notification.rb +++ b/ruby/lib/jam_ruby/models/notification.rb @@ -229,6 +229,7 @@ module JamRuby ################### FRIEND REQUEST ################### def send_friend_request(friend_request_id, user_id, friend_id) user = User.find(user_id) + friend = User.find(friend_id) # (1) save to database notification = Notification.new @@ -239,25 +240,31 @@ module JamRuby notification.save # (2) create notification - notification_msg = format_msg(notification.description, user) - msg = @@message_factory.friend_request( - friend_request_id, - user_id, - user.name, - user.photo_url, - friend_id, - notification_msg, - notification.id, - notification.created_at.to_s - ) + if user.online + notification_msg = format_msg(notification.description, user) + msg = @@message_factory.friend_request( + friend_request_id, + user_id, + user.name, + user.photo_url, + friend_id, + notification_msg, + notification.id, + notification.created_at.to_s + ) - # (3) send notification - @@mq_router.publish_to_user(friend_id, msg) + # (2a) send notification if user is online + @@mq_router.publish_to_user(friend_id, msg) + else + # (2b) send email if user is offline + UserMailer.friend_request(user, friend) + end end ############### FRIEND REQUEST ACCEPTED ############### def send_friend_request_accepted(user_id, friend_id) friend = User.find(friend_id) + user = User.find(user_id) # (1) save to database notification = Notification.new @@ -267,18 +274,23 @@ module JamRuby notification.save # (2) create notification - notification_msg = format_msg(notification.description, friend) - msg = @@message_factory.friend_request_accepted( - friend_id, - friend.name, - friend.photo_url, - user_id, notification_msg, - notification.id, - notification.created_at.to_s - ) + if friend.online + notification_msg = format_msg(notification.description, friend) + msg = @@message_factory.friend_request_accepted( + friend_id, + friend.name, + friend.photo_url, + user_id, notification_msg, + notification.id, + notification.created_at.to_s + ) - # (3) send notification - @@mq_router.publish_to_user(user_id, msg) + # (3) send notification + @@mq_router.publish_to_user(user_id, msg) + else + # (2b) send email if user is offline + UserMailer.friend_request(friend, user) + end end ################## FRIEND SESSION JOIN ################## @@ -321,41 +333,60 @@ module JamRuby notification.save # (2) create notification - notification_msg = format_msg(notification.description, follower) - msg = @@message_factory.new_user_follower( - user.id, - follower.name, - follower.photo_url, - notification_msg, - notification.id, - notification.created_at.to_s - ) + if user.online + notification_msg = format_msg(notification.description, follower) - # (3) send notification - @@mq_router.publish_to_user(user.id, msg) + msg = @@message_factory.new_user_follower( + user.id, + follower.name, + follower.photo_url, + notification_msg, + notification.id, + notification.created_at.to_s + ) + + # (2a) send notification if user is online + @@mq_router.publish_to_user(user.id, msg) + else + # (2b) send email if user is offline + UserMailer.new_user_follower(follower, user) + end end def send_new_band_follower(follower, band) - # (1) save to database - notification = Notification.new - notification.description = NotificationTypes::NEW_BAND_FOLLOWER - notification.source_user_id = follower.id - notification.target_user_id = user.id - notification.save - # (2) create notification + notifications = [] notification_msg = format_msg(notification.description, follower, band) - msg = @@message_factory.new_user_follower( - user.id, - follower.name, - follower.photo_url, - notification_msg, - notification.id, - notification.created_at.to_s - ) - # (3) send notification - @@mq_router.publish_to_user(user.id, msg) + band.band_musicians.each.each do |bm| + + # create notifications (saved below in bulk) + notification = Notification.new + notification.description = NotificationTypes::NEW_BAND_FOLLOWER + notification.source_user_id = follower.id + notification.target_user_id = bm.user.id + notifications << notification + + # send notification + if bm.user.online + msg = @@message_factory.new_user_follower( + bm.user_id, + follower.name, + follower.photo_url, + notification_msg, + notification.id, + notification.created_at.to_s + ) + + # (2a) send notification if user is online + @@mq_router.publish_to_user(user.id, msg) + else + # (2b) send email if user is offline + UserMailer.new_band_follower(follower, user, band) + end + end + + Notification.import notifications end ################## SESSION INVITATION ################## @@ -371,7 +402,7 @@ module JamRuby # (2) create notification msg = @@message_factory.session_invitation( - receiver_id, + receiver.id, sender.name, session_id, notification.id, diff --git a/web/app/assets/javascripts/profile.js b/web/app/assets/javascripts/profile.js index b6e1cb4d6..dda53a91c 100644 --- a/web/app/assets/javascripts/profile.js +++ b/web/app/assets/javascripts/profile.js @@ -240,7 +240,7 @@ } function isFollowing() { - return getUser() ? user.is_following : false; + return getUser() ? user.is_following : false; } function configureFollowingButton(following) { diff --git a/web/app/views/api_users/show.rabl b/web/app/views/api_users/show.rabl index 13360ac19..fb3e14d28 100644 --- a/web/app/views/api_users/show.rabl +++ b/web/app/views/api_users/show.rabl @@ -13,10 +13,10 @@ if @user == current_user attributes :email, :original_fpfile, :cropped_fpfile, :crop_selection, :session_settings, :show_whats_next, :subscribe_email elsif current_user node :is_friend do |uu| - @user.friends?(current_user) + current_user.friends?(@user) end node :is_following do |uu| - @user.following?(current_user) + current_user.following?(@user) end end From e22784c6c38efe127327f84240947769b7a84d99 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 29 Dec 2013 21:04:07 -0500 Subject: [PATCH 10/78] VRFS-294 Adjustments to HTML/ CSS. Account Profile Avatar page --- .../clients/_account_profile_avatar.html.erb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/app/views/clients/_account_profile_avatar.html.erb b/web/app/views/clients/_account_profile_avatar.html.erb index 49bf17f20..010ee663e 100644 --- a/web/app/views/clients/_account_profile_avatar.html.erb +++ b/web/app/views/clients/_account_profile_avatar.html.erb @@ -12,11 +12,13 @@
- - \ No newline at end of file diff --git a/web/app/views/clients/_hoverBubble.html.erb b/web/app/views/clients/_hoverBubble.html.erb new file mode 100644 index 000000000..6fb92a38e --- /dev/null +++ b/web/app/views/clients/_hoverBubble.html.erb @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/web/app/views/clients/_localRecordingsDialog.html.erb b/web/app/views/clients/_localRecordingsDialog.html.erb new file mode 100644 index 000000000..f1234de60 --- /dev/null +++ b/web/app/views/clients/_localRecordingsDialog.html.erb @@ -0,0 +1,48 @@ + +
+ +
+ <%= image_tag "content/icon_add.png", {:width => 19, :height => 19, :class => 'content-icon' } %> +

open a recording

+
+ +
+ +
+ + + + + + + + + + + +
WHENNAMEDURATION
+
+ +
+ +
+ +
+
+ CANCEL +
+ +
+
+ + + +
+ + diff --git a/web/app/views/clients/_paginator.html.erb b/web/app/views/clients/_paginator.html.erb new file mode 100644 index 000000000..72461454a --- /dev/null +++ b/web/app/views/clients/_paginator.html.erb @@ -0,0 +1,24 @@ + diff --git a/web/app/views/clients/_play_controls.html.erb b/web/app/views/clients/_play_controls.html.erb new file mode 100644 index 000000000..5255576a4 --- /dev/null +++ b/web/app/views/clients/_play_controls.html.erb @@ -0,0 +1,29 @@ + +
+ + + + <%= image_tag "content/icon_playbutton.png", {:height => 20, :width => 20, :class=> "playbutton"} %> + <%= image_tag "content/icon_pausebutton.png", {:height => 20, :width => 20, :class=> "pausebutton"} %> + + + +
+ + +
0:00
+ + +
+
<%= image_tag "content/slider_playcontrols.png", {:height => 16, :width => 5} %>
+
+ + +
0:00
+
+ + + +
0:00
+
+ \ No newline at end of file diff --git a/web/app/views/clients/_recordingFinishedDialog.html.erb b/web/app/views/clients/_recordingFinishedDialog.html.erb index 165fd2cd7..0bb425fc1 100644 --- a/web/app/views/clients/_recordingFinishedDialog.html.erb +++ b/web/app/views/clients/_recordingFinishedDialog.html.erb @@ -40,36 +40,8 @@
- Preview Recording:
- -
- - <%= image_tag "content/icon_playbutton.png", {:height => 20, :width => 20} %> - - -
- - -
0:00
- - -
-
<%= image_tag "content/slider_playcontrols.png", {:height => 16, :width => 5} %>
-
- - -
4:59
-
- - - -
- 1:23 -
- -
- + <%= render "play_controls" %>

diff --git a/web/app/views/clients/_session.html.erb b/web/app/views/clients/_session.html.erb index 6aca6d92f..d044ff38c 100644 --- a/web/app/views/clients/_session.html.erb +++ b/web/app/views/clients/_session.html.erb @@ -94,13 +94,22 @@

recordings

-
-   + -
-

- No Recordings:
Open a Recording -

+
+
+

+ No Recordings:
Open a Recording +

+
+
+ + <%= render "play_controls" %> +
@@ -114,8 +123,6 @@
--> -
-
@@ -140,10 +147,10 @@
<%= image_tag "content/icon_closetrack.png", {:width => 12, :height => 12} %>
-
+
-
+
diff --git a/web/app/views/clients/index.html.erb b/web/app/views/clients/index.html.erb index 320499564..c1d80859a 100644 --- a/web/app/views/clients/index.html.erb +++ b/web/app/views/clients/index.html.erb @@ -9,6 +9,7 @@ <%= render "header" %> <%= render "home" %> <%= render "footer" %> +<%= render "paginator" %> <%= render "searchResults" %> <%= render "faders" %> <%= render "vu_meters" %> @@ -36,11 +37,13 @@ <%= render "invitationDialog" %> <%= render "whatsNextDialog" %> <%= render "recordingFinishedDialog" %> +<%= render "localRecordingsDialog" %> <%= render "notify" %> <%= render "client_update" %> <%= render "banner" %> <%= render "clients/banners/disconnected" %> <%= render "overlay_small" %> +<%= render "help" %>