From 956ff422f403610518048b5b364af75037855f89 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 19 Feb 2014 22:48:34 -0500 Subject: [PATCH 1/5] fix sidebar for recordings --- ruby/lib/jam_ruby/models/band.rb | 3 +-- ruby/lib/jam_ruby/models/music_session_history.rb | 4 ---- ruby/lib/jam_ruby/models/recording.rb | 8 -------- ruby/lib/jam_ruby/models/user.rb | 3 +-- web/app/views/recordings/show.html.erb | 2 +- web/app/views/shared/_landing_sidebar.html.erb | 7 ++++--- 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/ruby/lib/jam_ruby/models/band.rb b/ruby/lib/jam_ruby/models/band.rb index 72838fad0..ea14cabe5 100644 --- a/ruby/lib/jam_ruby/models/band.rb +++ b/ruby/lib/jam_ruby/models/band.rb @@ -67,8 +67,7 @@ module JamRuby end def recent_history - recordings = ClaimedRecording.joins(:recording) - .where(:recordings => {:band_id => "#{self.id}"}) + recordings = Recording.where(:band_id => self.id) .order('created_at DESC') .limit(10) diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index b98d1d106..1c917fa2a 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -39,10 +39,6 @@ module JamRuby feed.music_session_history = self end - def like_count - self.likes.size - end - def comment_count self.comments.size end diff --git a/ruby/lib/jam_ruby/models/recording.rb b/ruby/lib/jam_ruby/models/recording.rb index 7e8ea3ac9..8fc666e0f 100644 --- a/ruby/lib/jam_ruby/models/recording.rb +++ b/ruby/lib/jam_ruby/models/recording.rb @@ -40,14 +40,6 @@ module JamRuby self.band_id = nil if self.band_id == '' end - def like_count - self.likes.size - end - - def play_count - self.plays.size - end - def comment_count self.comments.size end diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index 1c4f49700..7ff867717 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -275,8 +275,7 @@ module JamRuby end def recent_history - recordings = ClaimedRecording.joins(:recording) - .where(:recordings => {:owner_id => "#{self.id}"}) + recordings = Recording.where(:owner_id => self.id) .order('created_at DESC') .limit(10) diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 82ea6adb5..dff09958b 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -18,7 +18,7 @@ <% end %>
- <% unless @claimed_recording.recording.band.nil? %> + <% unless @claimed_recording.recording.band.blank? %>
<% unless @claimed_recording.recording.band.photo_url.blank? %> <%= image_tag "#{@claimed_recording.recording.band.photo_url}", {:alt => ""} %> diff --git a/web/app/views/shared/_landing_sidebar.html.erb b/web/app/views/shared/_landing_sidebar.html.erb index ab14d09fc..673acebf7 100644 --- a/web/app/views/shared/_landing_sidebar.html.erb +++ b/web/app/views/shared/_landing_sidebar.html.erb @@ -4,14 +4,15 @@ <% recent_history.each do |history_record| %> - <% if history_record.instance_of? ClaimedRecording %> + <% if history_record.instance_of? Recording %>
<%= history_record.created_at.strftime("%b #{history_record.created_at.day.ordinalize}") %>:
+
<%= history_record.claimed_recordings.first.description %>
<% elsif history_record.instance_of? MusicSessionHistory %>
@@ -31,9 +32,9 @@ Session Ended. Unavailable. <% end %>
+
<%= history_record.description %>
<% end %> -
<%= history_record.description %>
<% if history_record != recent_history.last %>

<% end %> From 069e9c829708fb696218e1f3eb500f5cbaa0448c Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Thu, 20 Feb 2014 00:18:11 -0500 Subject: [PATCH 2/5] VRFS-1135 allow empty string to be passed in to start parameter (due to jQuery not stripping null / empty params and refactor) --- ruby/lib/jam_ruby/models/feed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/lib/jam_ruby/models/feed.rb b/ruby/lib/jam_ruby/models/feed.rb index 27ba46c68..f85912c58 100644 --- a/ruby/lib/jam_ruby/models/feed.rb +++ b/ruby/lib/jam_ruby/models/feed.rb @@ -20,7 +20,7 @@ module JamRuby sort ||= 'date' raise "not valid sort #{sort}" unless SORT_TYPES.include?(sort) - start = params[:start] + start = params[:start].presence if sort == 'date' start ||= FIXNUM_MAX else From ca64966c7f2dcd2b5098539237290fe70caa0a66 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Thu, 20 Feb 2014 00:16:59 -0500 Subject: [PATCH 3/5] * duplicate entry $ bundle exec rails server Your Gemfile lists the gem bcrypt-ruby (= 3.0.1) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later. --- admin/Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/admin/Gemfile b/admin/Gemfile index 74f6a2125..5ec8a3411 100644 --- a/admin/Gemfile +++ b/admin/Gemfile @@ -37,7 +37,6 @@ gem 'bootstrap-will_paginate', '0.0.6' gem 'carrierwave', '0.9.0' gem 'carrierwave_direct' gem 'uuidtools', '2.1.2' -gem 'bcrypt-ruby', '3.0.1' gem 'jquery-rails' # , '2.3.0' # pinned because jquery-ui-rails was split from jquery-rails, but activeadmin doesn't support this gem yet gem 'jquery-ui-rails' gem 'rails3-jquery-autocomplete' From 1ecc21fd9c1ca053dbf74709af510bf0a632d9a3 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 20 Feb 2014 02:03:00 -0500 Subject: [PATCH 4/5] VRFS-1188 play/pause for recording landing page --- .../stylesheets/web/recordings.css.scss | 1 - web/app/views/recordings/show.html.erb | 47 +++++++++++++++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/web/app/assets/stylesheets/web/recordings.css.scss b/web/app/assets/stylesheets/web/recordings.css.scss index 45e591aa1..2e3ac9e24 100644 --- a/web/app/assets/stylesheets/web/recordings.css.scss +++ b/web/app/assets/stylesheets/web/recordings.css.scss @@ -45,7 +45,6 @@ .recording-slider { position:absolute; - left:25%; top:0px; } diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index dff09958b..be3de35d8 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -51,17 +51,19 @@
<%= @claimed_recording.description %>

- <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20, :alt => ""} %> + <%= image_tag "content/icon_playbutton.png", {:id => "imgPlayPause", :width => 20, :height => 20, :alt => ""} %>
0:00
<%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16, :alt => ""} %>
-
4:59
+
-
1:23
+
0:00
+
-
<%= @claimed_recording.genre_id.capitalize %>
<%= @claimed_recording.recording.play_count %> @@ -99,9 +101,44 @@ <% content_for :extra_js do %> <% end %> From f37e7de42ed61c6ab3a86bec91539f4925bce52e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 20 Feb 2014 02:07:09 -0500 Subject: [PATCH 5/5] VRFS-1188 remove hard-coded audio source / reset slider when playback is complete --- web/app/views/recordings/show.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index be3de35d8..1eef34c11 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -61,7 +61,8 @@
0:00
<%= @claimed_recording.genre_id.capitalize %>
@@ -123,8 +124,10 @@ $(".recording-slider").css({'left': percentComplete + '%'}); $(".recording-current").html(formatTime(htmlAudio.currentTime)); + // reset icon to play and slider to far left when done if (percentComplete === 100) { $("#imgPlayPause").attr('src', '/assets/content/icon_playbutton.png'); + $(".recording-slider").css({'left': 0 + '%'}); } });