From 1a2f40c3e82dd11121fd591ae9f8b00100fb4b23 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 25 Feb 2014 20:40:35 -0500 Subject: [PATCH 01/13] reset current time when recording playback is complete --- web/app/views/recordings/show.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index b16b5de25..fc5eed80b 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -139,6 +139,7 @@ if (percentComplete === 100) { $imgPlayPauseSelector.attr('src', playButtonPath); $(".recording-slider").css({'left': 0 + '%'}); + $(".recording-current").html("0:00"); } }); From f6fdd13170f16d078f59d53851520419e195ffa1 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 25 Feb 2014 21:18:12 -0500 Subject: [PATCH 02/13] fix bug with session/recording hovers on landing pages --- web/app/views/api_claimed_recordings/show.rabl | 2 +- web/app/views/api_music_sessions/history_show.rabl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/views/api_claimed_recordings/show.rabl b/web/app/views/api_claimed_recordings/show.rabl index e6646003c..683c1bed9 100644 --- a/web/app/views/api_claimed_recordings/show.rabl +++ b/web/app/views/api_claimed_recordings/show.rabl @@ -13,7 +13,7 @@ node :share_url do |claimed_recording| end child(:recording => :recording) { - attributes :id, :created_at, :duration, :comment_count, :like_count, :play_count, :grouped_tracks + attributes :id, :created_at, :duration, :comment_count, :like_count, :play_count child(:band => :band) { attributes :id, :name, :location, :photo_url diff --git a/web/app/views/api_music_sessions/history_show.rabl b/web/app/views/api_music_sessions/history_show.rabl index af71bfe73..841e427d5 100644 --- a/web/app/views/api_music_sessions/history_show.rabl +++ b/web/app/views/api_music_sessions/history_show.rabl @@ -1,6 +1,6 @@ object @history -attributes :id, :music_session_id, :description, :genres, :like_count, :comment_count, :created_at, :grouped_tracks +attributes :id, :music_session_id, :description, :genres, :like_count, :comment_count, :created_at node :share_url do |history| unless history.share_token.nil? From c4dd04de69b8b92cc4864ad2acf36866c0f0d100 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 25 Feb 2014 21:18:50 -0500 Subject: [PATCH 03/13] fix JS error --- web/app/assets/javascripts/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index 098ce3fb3..72126447c 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -224,7 +224,7 @@ } context.JK.fetchUserNetworkOrServerFailure = function() { - app.notify({ + JK.app.notify({ title: "Unable to communicate with server", text: "Please try again later", icon_url: "/assets/content/icon_alert_big.png" @@ -232,7 +232,7 @@ } context.JK.entityNotFound = function(type) { - app.notify({ + JK.app.notify({ title: type + " Deleted", text: "The " + type + " no longer exists.", icon_url: "/assets/content/icon_alert_big.png" From ee0a25293da21ff66561d08cbbc5e43e965920ba Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 25 Feb 2014 22:04:19 -0500 Subject: [PATCH 04/13] VRFS-1235 de-dup tracks on recording hover --- ruby/lib/jam_ruby/models/recorded_track.rb | 2 + web/app/assets/javascripts/hoverRecording.js | 40 ++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ruby/lib/jam_ruby/models/recorded_track.rb b/ruby/lib/jam_ruby/models/recorded_track.rb index 0dc498996..ac1ba40d8 100644 --- a/ruby/lib/jam_ruby/models/recorded_track.rb +++ b/ruby/lib/jam_ruby/models/recorded_track.rb @@ -8,6 +8,8 @@ module JamRuby self.table_name = "recorded_tracks" self.primary_key = 'id' + default_scope order('user_id ASC') + attr_accessor :marking_complete attr_writer :is_skip_mount_uploader diff --git a/web/app/assets/javascripts/hoverRecording.js b/web/app/assets/javascripts/hoverRecording.js index e6fe325f3..6d32b8ffa 100644 --- a/web/app/assets/javascripts/hoverRecording.js +++ b/web/app/assets/javascripts/hoverRecording.js @@ -8,6 +8,36 @@ var instrumentLogoMap = context.JK.getInstrumentIconMap24(); var hoverSelector = "#recording-hover"; + function deDupTracks(recordedTracks) { + var tracks = []; + + // this is replicated in recording.rb model + var t = {}; + t.instrument_ids = [] + $.each(recordedTracks, function(index, track) { + if (index > 0) { + if (recordedTracks[index-1].user.id !== recordedTracks[index].user.id) { + t = {}; + t.instrument_ids = []; + t.instrument_ids.push(track.instrument_id); + t.user = track.user; + tracks.push(t); + } + else { + if ($.inArray(track.instrument_id, t.instrument_ids)) { + t.instrument_ids.push(track.instrument_id); + } + } + } + else { + t.user = track.user; + t.instrument_ids.push(track.instrument_id); + tracks.push(t); + } + }); + return tracks; + } + this.showBubble = function() { $(hoverSelector).css({left: position.left-100, top: position.top+20}); $(hoverSelector).fadeIn(500); @@ -18,9 +48,11 @@ var recording = response.recording; $(hoverSelector).html(''); + var deDupedTracks = deDupTracks(recording.recorded_tracks); + // musicians var musicianHtml = ''; - $.each(recording.recorded_tracks, function(index, val) { + $.each(deDupedTracks, function(index, val) { var instrumentHtml = ''; var musician = val.user; @@ -28,7 +60,9 @@ musicianHtml += '' + musician.name + ''; instrumentHtml = '
'; - instrumentHtml += ' '; + $.each(val.instrument_ids, function(index, val) { + instrumentHtml += '  '; + }) instrumentHtml += '
'; musicianHtml += instrumentHtml; @@ -44,7 +78,7 @@ name: claimedRecording.name, genre: claimedRecording.genre_id.toUpperCase(), created_at: context.JK.formatDateTime(recording.created_at), - description: response.description, + description: response.description ? response.description : "", play_count: recording.play_count, comment_count: recording.comment_count, like_count: recording.like_count, From f433151ffb4c9a7f78b7215e4ccea5c561ef117f Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 27 Feb 2014 00:49:16 +0000 Subject: [PATCH 05/13] * carrierwave needs fog --- ruby/Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby/Gemfile b/ruby/Gemfile index 47bababdd..4856141b3 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -41,6 +41,7 @@ gem 'resque-failed-job-mailer' #, :path => "/Users/seth/workspace/resque_failed_ gem 'resque-lonely_job', '~> 1.0.0' gem 'oj' gem 'builder' +gem 'fog' group :test do gem 'simplecov', '~> 0.7.1' From 45881498763c1093be8358bd8a90cdb8b8e0a7d7 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 26 Feb 2014 20:56:58 -0500 Subject: [PATCH 06/13] VRFS-1246 bcc users on generated emails --- ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 38 ++++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index dcae48185..5b276d549 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -25,7 +25,7 @@ sendgrid_category "Confirm Email" sendgrid_unique_args :type => "confirm_email" - mail(:to => user.email, :subject => "Please confirm your JamKazam email") do |format| + mail(:bcc => user.email, :subject => "Please confirm your JamKazam email") do |format| format.text format.html end @@ -36,7 +36,7 @@ sendgrid_category "Welcome" sendgrid_unique_args :type => "welcome_message" - mail(:to => user.email, :subject => "Welcome to JamKazam") do |format| + mail(:bcc => user.email, :subject => "Welcome to JamKazam") do |format| format.text format.html end @@ -45,7 +45,7 @@ def password_changed(user) @user = user sendgrid_unique_args :type => "password_changed" - mail(:to => user.email, :subject => "JamKazam Password Changed") do |format| + mail(:bcc => user.email, :subject => "JamKazam Password Changed") do |format| format.text format.html end @@ -55,7 +55,7 @@ @user = user @password_reset_url = password_reset_url sendgrid_unique_args :type => "password_reset" - mail(:to => user.email, :subject => "JamKazam Password Reset") do |format| + mail(:bcc => user.email, :subject => "JamKazam Password Reset") do |format| format.text format.html end @@ -64,7 +64,7 @@ def updating_email(user) @user = user sendgrid_unique_args :type => "updating_email" - mail(:to => user.update_email, :subject => "JamKazam Email Change Confirmation") do |format| + mail(:bcc => user.update_email, :subject => "JamKazam Email Change Confirmation") do |format| format.text format.html end @@ -73,7 +73,7 @@ def updated_email(user) @user = user sendgrid_unique_args :type => "updated_email" - mail(:to => user.email, :subject => "JamKazam Email Changed") do |format| + mail(:bcc => user.email, :subject => "JamKazam Email Changed") do |format| format.text format.html end @@ -82,7 +82,7 @@ def new_musicians(user, new_nearby, host='www.jamkazam.com') @user, @new_nearby, @host = user, new_nearby, host sendgrid_unique_args :type => "new_musicians" - mail(:to => user.email, :subject => "JamKazam New Musicians in Your Area") do |format| + mail(:bcc => user.email, :subject => "JamKazam New Musicians in Your Area") do |format| format.text format.html end @@ -96,7 +96,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -109,7 +109,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -122,7 +122,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -135,7 +135,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -148,7 +148,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -161,7 +161,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -174,7 +174,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -187,7 +187,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -200,7 +200,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -213,7 +213,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -226,7 +226,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:to => email, :subject => subject) do |format| + mail(:bcc => email, :subject => subject) do |format| format.text format.html end @@ -236,7 +236,7 @@ # @body = msg # sendgrid_category "Notification" # sendgrid_unique_args :type => unique_args[:type] - # mail(:to => email, :subject => subject) do |format| + # mail(:bcc => email, :subject => subject) do |format| # format.text # format.html # end From e9e3cd886faeb53f0eee09a48addd6e12c6ba7f7 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 26 Feb 2014 21:15:40 -0500 Subject: [PATCH 07/13] VRFS-1246 revert some emails back to use to field --- ruby/lib/jam_ruby/app/mailers/user_mailer.rb | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb index 5b276d549..5ebd5d108 100644 --- a/ruby/lib/jam_ruby/app/mailers/user_mailer.rb +++ b/ruby/lib/jam_ruby/app/mailers/user_mailer.rb @@ -25,7 +25,7 @@ sendgrid_category "Confirm Email" sendgrid_unique_args :type => "confirm_email" - mail(:bcc => user.email, :subject => "Please confirm your JamKazam email") do |format| + mail(:to => user.email, :subject => "Please confirm your JamKazam email") do |format| format.text format.html end @@ -36,7 +36,7 @@ sendgrid_category "Welcome" sendgrid_unique_args :type => "welcome_message" - mail(:bcc => user.email, :subject => "Welcome to JamKazam") do |format| + mail(:to => user.email, :subject => "Welcome to JamKazam") do |format| format.text format.html end @@ -45,7 +45,7 @@ def password_changed(user) @user = user sendgrid_unique_args :type => "password_changed" - mail(:bcc => user.email, :subject => "JamKazam Password Changed") do |format| + mail(:to => user.email, :subject => "JamKazam Password Changed") do |format| format.text format.html end @@ -55,7 +55,7 @@ @user = user @password_reset_url = password_reset_url sendgrid_unique_args :type => "password_reset" - mail(:bcc => user.email, :subject => "JamKazam Password Reset") do |format| + mail(:to => user.email, :subject => "JamKazam Password Reset") do |format| format.text format.html end @@ -64,7 +64,7 @@ def updating_email(user) @user = user sendgrid_unique_args :type => "updating_email" - mail(:bcc => user.update_email, :subject => "JamKazam Email Change Confirmation") do |format| + mail(:to => user.update_email, :subject => "JamKazam Email Change Confirmation") do |format| format.text format.html end @@ -73,7 +73,7 @@ def updated_email(user) @user = user sendgrid_unique_args :type => "updated_email" - mail(:bcc => user.email, :subject => "JamKazam Email Changed") do |format| + mail(:to => user.email, :subject => "JamKazam Email Changed") do |format| format.text format.html end @@ -82,7 +82,7 @@ def new_musicians(user, new_nearby, host='www.jamkazam.com') @user, @new_nearby, @host = user, new_nearby, host sendgrid_unique_args :type => "new_musicians" - mail(:bcc => user.email, :subject => "JamKazam New Musicians in Your Area") do |format| + mail(:to => user.email, :subject => "JamKazam New Musicians in Your Area") do |format| format.text format.html end @@ -96,7 +96,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end @@ -109,7 +109,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end @@ -122,7 +122,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end @@ -148,7 +148,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end @@ -181,7 +181,7 @@ end def musician_recording_saved(email, msg) - subject = msg + subject = "A musician has saved a new recording on JamKazam" unique_args = {:type => "musician_recording_saved"} @body = msg @@ -194,7 +194,7 @@ end def band_recording_saved(email, msg) - subject = msg + subject = "A band has saved a new recording on JamKazam" unique_args = {:type => "band_recording_saved"} @body = msg @@ -213,7 +213,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end @@ -226,7 +226,7 @@ @body = msg sendgrid_category "Notification" sendgrid_unique_args :type => unique_args[:type] - mail(:bcc => email, :subject => subject) do |format| + mail(:to => email, :subject => subject) do |format| format.text format.html end From 63fdd60311e72b6852cc80d67ffdec85a8e1622d Mon Sep 17 00:00:00 2001 From: Scott Comer Date: Wed, 26 Feb 2014 21:44:49 -0600 Subject: [PATCH 08/13] eh, added some code which i disabled --- web/app/controllers/api_scoring_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/app/controllers/api_scoring_controller.rb b/web/app/controllers/api_scoring_controller.rb index 553c3637c..38e3a6105 100644 --- a/web/app/controllers/api_scoring_controller.rb +++ b/web/app/controllers/api_scoring_controller.rb @@ -12,6 +12,7 @@ class ApiScoringController < ApiController if !c.user.id.eql?(current_user.id) then render :json => {message: 'user does not own client_id'}, :status => 403; return end # todo this method is a stub + #result_client_id = JamRuby::GetWork.get_work(c.locidispid) result_client_id = client_id+'peer' render :json => {:clientid => result_client_id}, :status => 200 @@ -26,6 +27,7 @@ class ApiScoringController < ApiController if !c.user.id.eql?(current_user.id) then render :json => {message: 'user does not own client_id'}, :status => 403; return end # todo this method is a stub + # result_client_ids = JamRuby::GetWork.get_work_list(c.locidispid) result_client_ids = [client_id+'peer1', client_id+'peer2'] render :json => {:clientids => result_client_ids}, :status => 200 From 701063f8655101a2c11d81aefe8d7fd6e9f7765d Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 26 Feb 2014 23:22:09 -0500 Subject: [PATCH 09/13] VRFS-1239 show Click to Join link only in thick client, also prompt with terms or join request dialog as needed --- web/app/assets/javascripts/hoverMusician.js | 24 +++- web/app/views/clients/_hoverMusician.html.erb | 113 +++++++++++++++++- 2 files changed, 134 insertions(+), 3 deletions(-) diff --git a/web/app/assets/javascripts/hoverMusician.js b/web/app/assets/javascripts/hoverMusician.js index 449e12380..71128a5df 100644 --- a/web/app/assets/javascripts/hoverMusician.js +++ b/web/app/assets/javascripts/hoverMusician.js @@ -58,9 +58,28 @@ var sessionDisplayStyle = 'none'; var sessionId = ''; + var joinDisplayStyle = 'none'; if (response.sessions !== undefined && response.sessions.length > 0) { sessionDisplayStyle = 'block'; - sessionId = response.sessions[0].id; + var session = response.sessions[0]; + sessionId = session.id; + + // TODO: if approval_required, then prompt user to send join request + if (context.jamClient && session.musician_access && !session.approval_required) { + joinDisplayStyle = 'inline'; + } + + $("#btnJoinSession", hoverSelector).click(function(evt) { + // If no FTUE, show that first. + console.log("click"); + if (!(context.jamClient.FTUEGetStatus())) { + context.JK.app.afterFtue = function() { joinClick(sessionId); }; + context.JK.app.layout.startNewFtue(); + return; + } else { + joinClick(sessionId); + } + }); } var musicianHtml = context.JK.fillTemplate(template, { @@ -74,7 +93,8 @@ recording_count: response.recording_count, session_count: response.session_count, session_display: sessionDisplayStyle, - session_id: sessionId, + join_display: joinDisplayStyle, + sessionId: sessionId, friendAction: response.is_friend ? "removeMusicianFriend" : (response.pending_friend_request ? "" : "sendMusicianFriendRequest"), followAction: response.is_following ? "removeMusicianFollowing" : "addMusicianFollowing", biography: response.biography, diff --git a/web/app/views/clients/_hoverMusician.html.erb b/web/app/views/clients/_hoverMusician.html.erb index 1fad0817f..a5ce0f6fa 100644 --- a/web/app/views/clients/_hoverMusician.html.erb +++ b/web/app/views/clients/_hoverMusician.html.erb @@ -4,6 +4,7 @@