From 59f6e10e5584f063b20730e7ebba6ff6a5bcc715 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 14 Jan 2014 02:49:21 -0500 Subject: [PATCH 01/39] VRFS-986 recording landing page work --- .gitignore | 3 +- db/manifest | 2 +- db/up/ms_recording_anonymous_likes.sql | 23 ++ .../jam_ruby/models/music_session_comment.rb | 2 + ruby/lib/jam_ruby/models/recording_comment.rb | 2 + web/app/assets/images/content/icon_like.png | Bin 0 -> 1127 bytes web/app/assets/javascripts/user_dropdown.js | 1 + web/app/assets/javascripts/web/recordings.js | 8 + web/app/assets/javascripts/web/sessions.js | 0 web/app/assets/javascripts/web/web.js | 4 +- .../stylesheets/client/user_dropdown.css.scss | 18 +- web/app/assets/stylesheets/web/main.css.scss | 384 +++++++++++------- .../stylesheets/web/recordings.css.scss | 56 +++ .../assets/stylesheets/web/sessions.css.scss | 2 + web/app/assets/stylesheets/web/web.css | 2 + .../api_music_sessions_controller.rb | 4 +- .../controllers/api_recordings_controller.rb | 8 +- web/app/controllers/recordings_controller.rb | 10 + .../views/api_claimed_recordings/show.rabl | 25 +- web/app/views/layouts/web.erb | 39 +- web/app/views/recordings/show.html.erb | 211 ++++++++++ web/app/views/users/_user_dropdown.html.erb | 15 +- web/config/routes.rb | 7 +- 23 files changed, 623 insertions(+), 203 deletions(-) create mode 100644 db/up/ms_recording_anonymous_likes.sql create mode 100644 web/app/assets/images/content/icon_like.png create mode 100644 web/app/assets/javascripts/web/recordings.js create mode 100644 web/app/assets/javascripts/web/sessions.js create mode 100644 web/app/assets/stylesheets/web/recordings.css.scss create mode 100644 web/app/assets/stylesheets/web/sessions.css.scss create mode 100644 web/app/controllers/recordings_controller.rb create mode 100644 web/app/views/recordings/show.html.erb diff --git a/.gitignore b/.gitignore index 8927de757..9a18ea4cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea *~ *.swp -HTML \ No newline at end of file +HTML +.DS_Store diff --git a/db/manifest b/db/manifest index 5a9d3c4c8..978cee1ae 100755 --- a/db/manifest +++ b/db/manifest @@ -88,4 +88,4 @@ icecast.sql home_page_promos.sql mix_job_watch.sql music_session_constraints.sql -mixes_drop_manifest_add_retry.sql \ No newline at end of file +ms_recording_anonymous_likes.sql \ No newline at end of file diff --git a/db/up/ms_recording_anonymous_likes.sql b/db/up/ms_recording_anonymous_likes.sql new file mode 100644 index 000000000..ad9e765b6 --- /dev/null +++ b/db/up/ms_recording_anonymous_likes.sql @@ -0,0 +1,23 @@ +alter table music_sessions_comments +add column ip_address inet; + +alter table music_sessions_likers +add column ip_address inet; + +alter table music_sessions_likers +alter column liker_id drop not null; + +alter table recordings_comments +add column ip_address inet; + +alter table recordings_likers +add column ip_address inet; + +alter table recordings_likers +alter column liker_id drop not null; + +alter table recordings_plays +add column ip_address inet; + +alter table recordings_plays +alter column player_id drop not null; diff --git a/ruby/lib/jam_ruby/models/music_session_comment.rb b/ruby/lib/jam_ruby/models/music_session_comment.rb index cda5589bd..71fa8ae9a 100644 --- a/ruby/lib/jam_ruby/models/music_session_comment.rb +++ b/ruby/lib/jam_ruby/models/music_session_comment.rb @@ -5,6 +5,8 @@ module JamRuby self.primary_key = 'id' + default_scope order('created_at DESC') + belongs_to :music_session, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "creator_id" diff --git a/ruby/lib/jam_ruby/models/recording_comment.rb b/ruby/lib/jam_ruby/models/recording_comment.rb index 8b7e5ae62..5747da52f 100644 --- a/ruby/lib/jam_ruby/models/recording_comment.rb +++ b/ruby/lib/jam_ruby/models/recording_comment.rb @@ -5,6 +5,8 @@ module JamRuby self.primary_key = 'id' + default_scope order('created_at DESC') + belongs_to :recording, :class_name => "JamRuby::Recording", :foreign_key => "recording_id" belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "creator_id" diff --git a/web/app/assets/images/content/icon_like.png b/web/app/assets/images/content/icon_like.png new file mode 100644 index 0000000000000000000000000000000000000000..9ec7ebb66a03f7fc1db9d8ed2504fb9a631b7a63 GIT binary patch literal 1127 zcmaJ=O=#0l9M3+iS~@KQ4^G5K++b7Ne5@a9XkEKza|JU-SG1slY4Wy)nY@_1+H4|r zdhi1e6U3W1K~NBNf*|NY)E)HT(V?OThbW@r$3gTU^JT8ngEb_1@BR7xe*e#RVsKzv zlefi7QB+f=U(Ax#=YA_ZOmHwl}f;@yrZE29vD0vyqd1pVpGT^eX=g5DXHSjkMoqSild z!J+YioH9PD#8kR_D~LM+5zrx)furv;Y{5y;3%UZ?yJm(43lKb-pnnIImj*!^SrCMS zodJdAI1q^hxllL~;kE#t<#>iAZzRBlgm6UQqhRr&i8o6f7P4aBqAzkv&_#?*fnmz! zaC)0(%&iQ=8~*o zFP4cEjB#X>;exE2QWYpk|A*@O657UD_$S_f3fs9c6Eaz7qmreN#tmEXw3e1QJnrH+yO%=Eh7ww63g<`36 zFUR%rDLxhLVWY8hR19_X@#!j8L`q4A2Cj0|KiqIlt~(66Nj!_t(hfki&q6v_NLtWp z$HLdtTjZ*>W9h8PWk@iL+uFZcT{V&Uakoo@OAbq;4-GQ!78&f1chAg{OYtltrgF~n zLfn4iYiOQaHn%PL!ZY&(Ow7;Ecd|Txe+|n`9bwxK9j#lQoCS3=rNM7)yIb;8vsV4p zJs$OI>fEGPz1~L$xBkD%YQsj z@s=t#TgTh$zGz_G>vxAi)7y#ff`2o0qr?BcuC1+dvT@>jbn>UKA2rOK2WhI_NBx-I V{^8#BmZE$0Gra@iwVu64egV@4ZP5S# literal 0 HcmV?d00001 diff --git a/web/app/assets/javascripts/user_dropdown.js b/web/app/assets/javascripts/user_dropdown.js index 71d700f94..b003f2d76 100644 --- a/web/app/assets/javascripts/user_dropdown.js +++ b/web/app/assets/javascripts/user_dropdown.js @@ -71,6 +71,7 @@ // initially show avatar function showAvatar() { var photoUrl = context.JK.resolveAvatarUrl(userMe.photo_url); + logger.debug("photoUrl=" + photoUrl); $('#header-avatar').attr('src', photoUrl); } diff --git a/web/app/assets/javascripts/web/recordings.js b/web/app/assets/javascripts/web/recordings.js new file mode 100644 index 000000000..7f4a5b478 --- /dev/null +++ b/web/app/assets/javascripts/web/recordings.js @@ -0,0 +1,8 @@ +(function(context,$) { + + "use strict"; + + context.JK = context.JK || {}; + + +})(window, jQuery) \ No newline at end of file diff --git a/web/app/assets/javascripts/web/sessions.js b/web/app/assets/javascripts/web/sessions.js new file mode 100644 index 000000000..e69de29bb diff --git a/web/app/assets/javascripts/web/web.js b/web/app/assets/javascripts/web/web.js index d5407b2fe..c45b117d4 100644 --- a/web/app/assets/javascripts/web/web.js +++ b/web/app/assets/javascripts/web/web.js @@ -15,4 +15,6 @@ //= require landing/init //= require landing/signup //= require web/downloads -//= require web/congratulations \ No newline at end of file +//= require web/congratulations +//= require web/recordings +//= require web/sessions \ No newline at end of file diff --git a/web/app/assets/stylesheets/client/user_dropdown.css.scss b/web/app/assets/stylesheets/client/user_dropdown.css.scss index 471883c4c..42e8081af 100644 --- a/web/app/assets/stylesheets/client/user_dropdown.css.scss +++ b/web/app/assets/stylesheets/client/user_dropdown.css.scss @@ -7,12 +7,18 @@ } #profile { - width:auto; - float:right; - height:64px; + float: right; + height: 54px; + margin-top: 30px; + text-align: right; + + ul { + margin-bottom:0; + } + .signin { - position:relative; - margin-top:40px; + text-decoration: underline; + cursor: auto; } } @@ -35,7 +41,7 @@ border-radius:26px; } -#user { +.user { margin:18px 0px 0px 10px; font-size:20px; font-weight:200; diff --git a/web/app/assets/stylesheets/web/main.css.scss b/web/app/assets/stylesheets/web/main.css.scss index fb3b8f142..5ce2dbb42 100644 --- a/web/app/assets/stylesheets/web/main.css.scss +++ b/web/app/assets/stylesheets/web/main.css.scss @@ -2,6 +2,10 @@ html { height:100%; } +p, div { + white-space: normal; +} + body.web { background-repeat: repeat-x; margin:0 !important; @@ -10,165 +14,240 @@ body.web { overflow: visible !important; width:auto !important; - #web-container { - padding:3% 0; + .logo-home { + width: 298px; + margin-top: 30px; + display: inline-block; + } + + .landing-tag { + display:inline-block; + margin-left:70px; + width:400px; + } + + .landing-tag h1 { + color:#ed3718; + font-size:26px; + font-weight:300; + } + + .landing-content { + background-color:black; + width:100%; + padding-bottom:15px; + /*position:relative; + width:100%; + min-height: 366px; + background-color:black; + padding-top:20px;*/ } div.wrapper { - white-space: nowrap; - - p, ul { - color:#999; - line-height:160%; - margin-bottom:20px; - width:90%; - white-space:normal; - font-size:16px; - } - - h2 { - font-weight:300; - } - - .content-wrapper { - border-bottom: medium none; - padding: 0; - } - - .black-bar{ - position:relative; - width:100%; - min-height: 366px; - background-color:black; - padding-top:20px; - } - - .black-bar-inner { - width:1100px; - margin: 0 auto; - - position:relative; - - // all custom CSS for the register page goes here - .register-page { - - .register-container { - padding:10px; - } - - input.register-musician { - - } - - .actions { - margin-top:20px; - - a.button-grey { - line-height:15px; // WHY is this not universal - } - } - - - .error { - padding: 5px 12px 5px 5px; - margin-left:-5px; - margin-right:-12px; - } - - input.register-fan { - margin-left:20px; - } - - input[type=text], input[type=password] { - margin-top:1px; - width:100%; - } - - select { - width:100%; - } - - - .right-side { - margin-left:25px; - } - - - .register-left { - - select { - width:104%; - } - - div.field { - margin-top:31px; - width:43%; - float:left; - } - } - - .register-right { - - margin-top:40px; - - table { - border-collapse:separate; - border-spacing:6px; - } - - label.instruments { - margin-bottom:2px; - } - - div.field { - margin-top:15px; - } - - a.tos { - text-decoration: underline; - } - - .ftue-instrumentlist { - width:100%; - } - } - } - } - - .after-black-bar { - position:relative; - background-color:#262626; - width:1100px; - margin:0 auto; - - .after-black-bar-inner { - background-color:#262626; - position:absolute; - left:0; - right:0; - } - } - } - - .header { width:1100px; margin:0 auto; - - .logo-home { - width: 298px; - margin-top: 30px; - display: inline-block; - float:left; - } + white-space:nowrap; + position:relative; } - #profile { + .landing-sidebar { + width:350px; + background:#353535; + border:solid 1px #ed3718; position:absolute; - top:-80px; - right:0; + top:30px; + right:0px; + padding:25px; + padding-top:0px; + line-height:130%; + } - ul { - margin-bottom:0; + .landing-sidebar h2 { + font-size:18px !important; + line-height:normal; + color:#fff; + } + + .landing-band { + float:left; + text-align:center; + width: 115px; + margin-right:25px; + font-size:17px; + color:#fff; + } + + .landing-avatar { + padding:2px; + width:110px; + height:110px; + background-color:#ed3618; + -webkit-border-radius:57px; + -moz-border-radius:57px; + border-radius:57px; + margin-bottom:10px; + } + + .landing-avatar img { + width:110px; + height:110px; + -webkit-border-radius:55px; + -moz-border-radius:55px; + border-radius:55px; + } + + .landing-details { + float:left; + width:515px; + font-size:14px; + font-weight:400; + color:#666; + } + + .landing-details a { + text-decoration:none; + color:#ccc; + } + + .landing-details a:hover { + color:#fff; + } + + .landing-content h2 { + font-size:24px; + color:#ccc; + font-weight:200; + } + + .landing-comments { + margin-left:140px; + width:515px; + } + + .landing-comments a { + text-decoration:none; + font-weight:bold; + color:#ED3618; + } + + .landing-comment-scroller { + height:470px; + overflow:auto; + } + + .landing .cta { + margin-top:25px; + } + + .cta { + margin-top:40px; + text-align:center; + width:345px; + font-size:12px; + } + + white-space: nowrap; + + p, ul { + color:#999; + line-height:160%; + margin-bottom:20px; + width:90%; + white-space:normal; + font-size:16px; + } + + h2 { + font-weight:300; + } + + .content-wrapper { + border-bottom: medium none; + padding: 0; + } + + + // all custom CSS for the register page goes here + .register-page { + + .register-container { + padding:10px; + } + + input.register-musician { + + } + + .actions { + margin-top:20px; + + a.button-grey { + line-height:15px; // WHY is this not universal + } + } + + .error { + padding: 5px 12px 5px 5px; + margin-left:-5px; + margin-right:-12px; + } + + input.register-fan { + margin-left:20px; + } + + input[type=text], input[type=password] { + margin-top:1px; + width:100%; + } + + select { + width:100%; + } + + + .right-side { + margin-left:25px; + } + + + .register-left { + + select { + width:104%; + } + + div.field { + margin-top:31px; + width:43%; + float:left; + } + } + + .register-right { + + margin-top:40px; + + table { + border-collapse:separate; + border-spacing:6px; + } + + label.instruments { + margin-bottom:2px; + } + + div.field { + margin-top:15px; + } + + a.tos { + text-decoration: underline; + } + + .ftue-instrumentlist { + width:100%; + } } } @@ -215,11 +294,6 @@ body.web { } } -#landing-container { - padding: 3% 0; - position:relative; - text-align: center; -} .signin-overlay { position:relative; diff --git a/web/app/assets/stylesheets/web/recordings.css.scss b/web/app/assets/stylesheets/web/recordings.css.scss new file mode 100644 index 000000000..c5dbef4b7 --- /dev/null +++ b/web/app/assets/stylesheets/web/recordings.css.scss @@ -0,0 +1,56 @@ +.feed-entry .recording-controls, .feed-entry .session-controls, .landing-details .recording-controls { + margin-top:0px; + margin-bottom:5px; + padding:8px 5px 8px 10px; + width:98%; +} + +.recording-position { + display:inline-block; + width:80%; + margin-left:-20px; + font-family:Arial, Helvetica, sans-serif; + font-size:11px; + height:18px; + vertical-align:top; +} + +.landing-details .recording-position { + width:100%; +} + +.recording-time { + display:inline-block; + height:16px; + vertical-align:top; + margin-top:4px; +} + +.landing-details .recording-current { + top:8px; +} + +.recording-playback { + display:inline-block; + background-image:url(../images/content/bkg_playcontrols.png); + background-repeat:repeat-x; + position:relative; + width:70%; + height:16px; + margin-top:2px; +} + +.recording-slider { + position:absolute; + left:25%; + top:0px; +} + +.recording-current { + font-family:Arial, Helvetica, sans-serif; + display:inline-block; + font-size:18px; + position:absolute; + top:3px; + right:4px; +} \ No newline at end of file diff --git a/web/app/assets/stylesheets/web/sessions.css.scss b/web/app/assets/stylesheets/web/sessions.css.scss new file mode 100644 index 000000000..139597f9c --- /dev/null +++ b/web/app/assets/stylesheets/web/sessions.css.scss @@ -0,0 +1,2 @@ + + diff --git a/web/app/assets/stylesheets/web/web.css b/web/app/assets/stylesheets/web/web.css index eee7082da..59db0c313 100644 --- a/web/app/assets/stylesheets/web/web.css +++ b/web/app/assets/stylesheets/web/web.css @@ -9,4 +9,6 @@ *= require client/invitationDialog *= require web/main *= require web/footer +*= require web/recordings +#= require web/sessions */ \ No newline at end of file diff --git a/web/app/controllers/api_music_sessions_controller.rb b/web/app/controllers/api_music_sessions_controller.rb index 79b8cfe84..d727f94ae 100644 --- a/web/app/controllers/api_music_sessions_controller.rb +++ b/web/app/controllers/api_music_sessions_controller.rb @@ -3,7 +3,7 @@ require 'aws-sdk' class ApiMusicSessionsController < ApiController # have to be signed in currently to see this screen - before_filter :api_signed_in_user + before_filter :api_signed_in_user, :except => [ :add_like ] before_filter :lookup_session, only: [:show, :update, :delete, :claimed_recording_start, :claimed_recording_stop] skip_before_filter :api_signed_in_user, only: [:perf_upload] @@ -251,6 +251,7 @@ class ApiMusicSessionsController < ApiController comment.music_session_id = params[:id] comment.creator_id = params[:user_id] comment.comment = params[:comment] + comment.ip_address = request.remote_ip comment.save if comment.errors.any? @@ -272,6 +273,7 @@ class ApiMusicSessionsController < ApiController liker = MusicSessionLiker.new liker.music_session_id = params[:id] liker.liker_id = params[:user_id] + liker.ip_address = request.remote_ip liker.save if liker.errors.any? diff --git a/web/app/controllers/api_recordings_controller.rb b/web/app/controllers/api_recordings_controller.rb index 3a8986fb2..ce06547c6 100644 --- a/web/app/controllers/api_recordings_controller.rb +++ b/web/app/controllers/api_recordings_controller.rb @@ -1,6 +1,6 @@ class ApiRecordingsController < ApiController - before_filter :api_signed_in_user + before_filter :api_signed_in_user, :except => [ :add_like, :add_play ] before_filter :look_up_recording, :only => [ :show, :stop, :claim, :discard, :keep ] before_filter :parse_filename, :only => [ :download, :upload_next_part, :upload_sign, :upload_part_complete, :upload_complete ] @@ -97,6 +97,7 @@ class ApiRecordingsController < ApiController comment.recording_id = params[:id] comment.creator_id = params[:user_id] comment.comment = params[:comment] + comment.ip_address = request.remote_ip comment.save if comment.errors.any? @@ -118,6 +119,7 @@ class ApiRecordingsController < ApiController liker = RecordingLiker.new liker.recording_id = params[:id] liker.liker_id = params[:user_id] + liker.ip_address = request.remote_ip liker.save if liker.errors.any? @@ -139,6 +141,7 @@ class ApiRecordingsController < ApiController play = RecordingPlay.new play.recording_id = params[:id] play.player_id = params[:user_id] + play.ip_address = request.remote_ip play.save if play.errors.any? @@ -209,10 +212,7 @@ class ApiRecordingsController < ApiController end end - - private - def parse_filename @recorded_track = RecordedTrack.find_by_recording_id_and_client_track_id!(params[:id], params[:track_id]) raise PermissionError, ValidationMessages::PERMISSION_VALIDATION_ERROR unless @recorded_track.recording.has_access?(current_user) diff --git a/web/app/controllers/recordings_controller.rb b/web/app/controllers/recordings_controller.rb new file mode 100644 index 000000000..650c6971f --- /dev/null +++ b/web/app/controllers/recordings_controller.rb @@ -0,0 +1,10 @@ +class RecordingsController < ApplicationController + + respond_to :html + + def show + @claimed_recording = ClaimedRecording.find(params[:id]) + render :layout => "web" + end + +end \ No newline at end of file diff --git a/web/app/views/api_claimed_recordings/show.rabl b/web/app/views/api_claimed_recordings/show.rabl index cb46530cd..36c020610 100644 --- a/web/app/views/api_claimed_recordings/show.rabl +++ b/web/app/views/api_claimed_recordings/show.rabl @@ -1,13 +1,13 @@ # I'm not sure this is right at all. The idea is to bring in all the stuff you would need to play the tracks. -# I don't think I need to include URLs since that's handled by syncing. This is jsut to make the metadata +# I don't think I need to include URLs since that's handled by syncing. This is just to make the metadata # depictable. object @claimed_recording -attributes :id, :name, :description, :is_public, :is_downloadable +attributes :id, :name, :description, :is_public, :is_downloadable, :genre_id child(:recording => :recording) { - attributes :id, :created_at, :duration + attributes :id, :created_at, :duration, :comment_count, :like_count, :play_count child(:band => :band) { attributes :id, :name } @@ -19,9 +19,20 @@ child(:recording => :recording) { child(:recorded_tracks => :recorded_tracks) { attributes :id, :fully_uploaded, :url, :client_track_id, :client_id, :instrument_id - child(:user => :user) { - attributes :id, :first_name, :last_name, :city, :state, :country, :photo_url - } + child(:user => :user) { + attributes :id, :first_name, :last_name, :city, :state, :country, :photo_url + } } -} + child(:band => :band) { + attributes :id, :name, :photo_url + } + + child(:comments => :comments) { + attributes :comment, :created_at + + child(:user => :creator) { + attributes :id, :first_name, :last_name, :photo_url + } + } +} \ No newline at end of file diff --git a/web/app/views/layouts/web.erb b/web/app/views/layouts/web.erb index 6d439faf6..d76e02611 100644 --- a/web/app/views/layouts/web.erb +++ b/web/app/views/layouts/web.erb @@ -19,30 +19,33 @@ <%= javascript_include_tag "web/web" %> -
-
-
-
- <%= link_to root_path do %> - <%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %> - <% end %> -
+
+ <%= link_to root_path do %> + <%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %> + <% end %>
-
- -
-
- <%= render "users/user_dropdown" %> - <%= yield %> -
+
+

Play music together over the Internet as if in the same room

-
- <%= yield(:after_black_bar) %> + <%= render "users/user_dropdown" %> + +


+
+ +
+
+

+ <%= yield %>
+
+ +
+ <%= yield(:after_black_bar) %> +
- <%= render "shared/ga" %> diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb new file mode 100644 index 000000000..4482b731e --- /dev/null +++ b/web/app/views/recordings/show.html.erb @@ -0,0 +1,211 @@ +<% provide(:title, "#{@claimed_recording.name}") %> + +
+
+ +
+ Raven & The Blackbirds +
+ +
+
RECORDING
+
Yesterday, 11:10 am
+

+

You Hurt Me Bad

+ +
+ A sweet and sexy ballad about broken hearts and bad girls.
+
+ + +
+ +
+ + + + + +
+ + +
0:00
+ + +
+
+
+ + +
4:59
+
+ + + +
+ 1:23 +
+ +
+ + + +
Blues
+
80     12     35
+
+

+ + + + + + + + + + + + + + + + + + + +
Jimmy Johnson
Perry Jon Blazinsky
Knox Pitzer
Coby Jones
+
+
+ + + + +

+

More by Raven & The Blackbirds:


+ +
Now:
+ +
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
+

+
Yesterday:
+
RECORDING: You Hurt Me Bad
+
Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
+

+
Dec. 18th:
+
SESSION: Session Ended. Unavailable.
+
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
+

+
Dec. 12th:
+
RECORDING: Bustin' My Chops
+
Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
+

+
Dec. 10th:
+
SESSION: Session Ended. Unavailable.
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
+

+
Nov. 29th:
+
SESSION: Session Ended. Unavailable.
+
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
+
+ + + +<% content_for :after_black_bar do %> +
+
+

Comments:

+ + +
+
+ +
+
+ + + +
+ + +
+
+ + Jeremy Jones Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. +
+
5 minutes ago
+
+
+ + +
+
+ + Johnny Cameroon Fusce consectetuer luctus ipsum. +
+
30 minutes ago
+
+
+ + +
+
+ + Perry Gaberdeen Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. +
+
2 hours ago
+
+
+ + +
+
+ + Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. +
+
Yesterday, 2:45 pm
+
+
+ + +
+
+ + Jeremy Jones Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. +
+
5 minutes ago
+
+
+ + +
+
+ + Johnny Cameroon Fusce consectetuer luctus ipsum. +
+
30 minutes ago
+
+
+ + +
+
+ + Perry Gaberdeen Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. +
+
2 hours ago
+
+
+ + +
+
+ + Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. +
+
Yesterday, 2:45 pm
+
+
+
+
+
+<% end %> diff --git a/web/app/views/users/_user_dropdown.html.erb b/web/app/views/users/_user_dropdown.html.erb index 558e8d25c..a42194440 100644 --- a/web/app/views/users/_user_dropdown.html.erb +++ b/web/app/views/users/_user_dropdown.html.erb @@ -1,14 +1,15 @@
+ + + + + <% if signed_in? %> - -
- -
-
+
+
diff --git a/web/config/routes.rb b/web/config/routes.rb index 990ca7426..16f7be727 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -6,7 +6,6 @@ SampleApp::Application.routes.draw do end resources :users - resources :sessions, only: [:new, :create, :destroy] #root to: 'static_pages#home' @@ -24,10 +23,14 @@ SampleApp::Application.routes.draw do match '/signin', to: 'sessions#new' match '/signout', to: 'sessions#destroy', via: :delete + # oauth match '/auth/:provider/callback', :to => 'sessions#oauth_callback' match '/auth/failure', :to => 'sessions#failure' + # session / recording landing pages + match '/sessions/:id' => 'music_sessions#show', :via => :get, :as => 'music_session_detail' + match '/recordings/:id' => 'recordings#show', :via => :get, :as => 'recording_detail' match '/isp', :to => 'users#isp' match '/isp/ping.jar', :to => redirect('/ping.jar') @@ -296,6 +299,8 @@ SampleApp::Application.routes.draw do match '/claimed_recordings/:id' => 'api_claimed_recordings#update', :via => :put match '/claimed_recordings/:id' => 'api_claimed_recordings#delete', :via => :delete + # Mixes + match '/mixes/schedule' => 'api_mixes#schedule', :via => :post match '/mixes/next' => 'api_mixes#next', :via => :get match '/mixes/:id/finish' => 'api_mixes#finish', :via => :put match '/mixes/:id/download' => 'api_mixes#download', :via => :get From 4f9e36a3321c10795002d27e1100773de1ecdc37 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 16 Jan 2014 01:55:36 -0500 Subject: [PATCH 02/39] VRFS-986 more landing page work --- web/app/assets/images/content/icon_arrow.png | Bin 0 -> 999 bytes .../assets/images/content/icon_comment.png | Bin 0 -> 319 bytes web/app/assets/javascripts/web/recordings.js | 8 - web/app/assets/javascripts/web/sessions.js | 0 web/app/assets/javascripts/web/web.js | 2 - web/app/assets/stylesheets/web/main.css.scss | 27 +- .../stylesheets/web/recordings.css.scss | 5 +- web/app/views/layouts/web.erb | 129 ++++--- web/app/views/recordings/show.html.erb | 328 +++++++----------- web/app/views/users/_user_dropdown.html.erb | 2 +- 10 files changed, 219 insertions(+), 282 deletions(-) create mode 100644 web/app/assets/images/content/icon_arrow.png create mode 100644 web/app/assets/images/content/icon_comment.png delete mode 100644 web/app/assets/javascripts/web/recordings.js delete mode 100644 web/app/assets/javascripts/web/sessions.js diff --git a/web/app/assets/images/content/icon_arrow.png b/web/app/assets/images/content/icon_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..e8685069d04dac823a4cd81a1799d3f56d29d465 GIT binary patch literal 999 zcmaJ=&ui0A9M7oR+}OrIVK@XISr3Y9(wDXA8Wy)UX(R7n{xlZN3VCTHOq0-9s2pb|2y%^UB~48z3Y zcBM+H`c=uq4rfF@TJA!bu<`p};5UD<)t{N{f<^0f!GuqxsgdR8otFvFJ%=>x6g`&o>$kt}(@7 ze}#wHY&PN$gaq|S1e-1~!h{=4v>8+sn7-{18@nK4G-`OA$ShTQkb>iNXx-qjOtfHp zXm~v2l2J-+M_vEFtK)RM15!dqdb<(_l}!)vB^2Ow-=vLOo`^zulHwzSV84R#TDyvi zbxd$j#~x71A~>%brtLQiVzlroRG`p zlbNiNQB%`JL1|-EY_2=VC2g#AgjJ5kM#JEEG_s0(djnZTA3LCxv}AYD0#h)P7pHTS zuh3n~0oFQRON8y72T#TDQEUHcb=ySeC)#!fmmWH!k6b$MJ{|1lud+rj#dS^1Rl?7; z7aL#4FUDf8&w)Q5ntglCy|L}F9ylRtquZ|@HwSj^JZcWSkDuacV{ah9Bay$LbZvh%m=jq}YqA~I8xsAMxj0~+0-yaE#JixKN zF=+AT20@i1Zf*~gFvGSzyed{oQdcuwTz2d@xB9>Rf9**+hR1nZ&#%6Ce3?hlfe+k2 z_9e4lmrvYL5_RB#f9odJ_-%S6hDRlo&lDUJtLBl5>6I( - - <%= full_title(yield(:title)) %> + + <%= full_title(yield(:title)) %> - - - <%= stylesheet_link_tag "web/web", media: "all" %> - <% if bugsnag? %> - - - <% end %> - <%= include_gon(:init => true) %> - <%= csrf_meta_tags %> - - -<%= javascript_include_tag "web/web" %> - + + + <%= stylesheet_link_tag "web/web", media: "all" %> + <% if bugsnag? %> + + + <% end %> + <%= include_gon(:init => true) %> + <%= csrf_meta_tags %> + + + <%= javascript_include_tag "web/web" %> + -
- -
- <%= link_to root_path do %> - <%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %> - <% end %> -
- -
-

Play music together over the Internet as if in the same room

-
- - <%= render "users/user_dropdown" %> - -


-
- -
-

- <%= yield %> -
-
-
- <%= yield(:after_black_bar) %> -
+
+ <%= link_to root_path do %> + <%= image_tag("web/logo_home.png", :alt => "JamKazam logo", :size => "298x54") %> + <% end %> +
+ +
+

Play music together over the Internet as if in the same room

+
+ + <%= render "users/user_dropdown" %> + +


+
+ +
+
+

+ <%= yield %> +
+
+ +
+ <%= yield(:after_black_bar) %> +
-
- <%= render "clients/invitationDialog" %> + <%= render "clients/invitationDialog" %> - + var userDropdown = new JK.UserDropdown(JK.app); + userDropdown.initialize(invitationDialog); + } + }) + -<%= render "shared/ga" %> - - + <%= render "shared/ga" %> + + diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 4482b731e..875d9919b 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -1,211 +1,137 @@ <% provide(:title, "#{@claimed_recording.name}") %> -
-
- -
- Raven & The Blackbirds +
+ <% unless @claimed_recording.recording.band.nil? %> +
+ <% unless @claimed_recording.recording.band.photo_url.blank? %> + <%= image_tag "#{@claimed_recording.recording.band.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic_band.png", {:alt => ""} %> + <% end %> +
+ <%= @claimed_recording.recording.band.name %> + <% else %> +
+ <% unless @claimed_recording.recording.owner.photo_url.blank? %> + <%= image_tag "#{@claimed_recording.recording.owner.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
+ <%= @claimed_recording.recording.owner.name %> + <% end %> +
+ +
+
RECORDING
+
<%= @claimed_recording.recording.created_at %>
+

+

<%= @claimed_recording.name %>

+ +
TODO: Which field is this in the database??

+
+
+ <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> +
+
0:00
+
+
<%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16} %>
- -
-
RECORDING
-
Yesterday, 11:10 am
-

-

You Hurt Me Bad

- -
- A sweet and sexy ballad about broken hearts and bad girls.
-
- - -
- -
- - - - - -
- - -
0:00
- - -
-
-
- - -
4:59
-
- - - -
- 1:23 -
- -
- - - -
Blues
-
80     12     35
-
-

- - - - - - - - - - - - - - - - - - - -
Jimmy Johnson
Perry Jon Blazinsky
Knox Pitzer
Coby Jones
-
-
+
4:59
+
+
1:23
+
+ +
<%= @claimed_recording.genre_id.capitalize %>
+
+ <%= @claimed_recording.recording.play_count %> + <%= image_tag "content/icon_arrow.png", {:width => 7, :height => 12, :align => "absmiddle"} %>     + <%= @claimed_recording.recording.comment_count %> + <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>     + <%= @claimed_recording.recording.like_count %> + <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %> +
+
+

+ + <% @claimed_recording.recording.recorded_tracks.each_with_index do |track, index| %> + <% if index % 2 == 0 %> + + <% end %> + + + + <% if index % 2 == 0 %> + + <% else %> + + <% end %> + <% end %> +
+
+ <% unless track.user.photo_url.blank? %> + <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
+
<%= track.user.name %>
+
+ <%= image_tag "shared/icon_instrument_#{track.instrument_id}45.png", {:width => 32, :alt => ""} %> +
+
+
+
- - - -

-

More by Raven & The Blackbirds:


- -
Now:
- -
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
-

-
Yesterday:
-
RECORDING: You Hurt Me Bad
-
Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
-

-
Dec. 18th:
-
SESSION: Session Ended. Unavailable.
-
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
-

-
Dec. 12th:
-
RECORDING: Bustin' My Chops
-
Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
-

-
Dec. 10th:
-
SESSION: Session Ended. Unavailable.
-
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
-

-
Nov. 29th:
-
SESSION: Session Ended. Unavailable.
-
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
-
+

+

More by Raven & The Blackbirds:


+
Now:
+ +
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
+

+
Yesterday:
+
RECORDING: You Hurt Me Bad
+
Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
+

+
Dec. 18th:
+
SESSION: Session Ended. Unavailable.
+
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
+

+
Dec. 12th:
+
RECORDING: Bustin' My Chops
+
Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
+

+
Dec. 10th:
+
SESSION: Session Ended. Unavailable.
+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
+

+
Nov. 29th:
+
SESSION: Session Ended. Unavailable.
+
Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
+
- <% content_for :after_black_bar do %> -
-
-

Comments:

- - -
-
- -
-
- - - -
- - -
-
- - Jeremy Jones Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. -
-
5 minutes ago
-
-
- - -
-
- - Johnny Cameroon Fusce consectetuer luctus ipsum. -
-
30 minutes ago
-
-
- - -
-
- - Perry Gaberdeen Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. -
-
2 hours ago
-
-
- - -
-
- - Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. -
-
Yesterday, 2:45 pm
-
-
- - -
-
- - Jeremy Jones Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. -
-
5 minutes ago
-
-
- - -
-
- - Johnny Cameroon Fusce consectetuer luctus ipsum. -
-
30 minutes ago
-
-
- - -
-
- - Perry Gaberdeen Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. -
-
2 hours ago
-
-
- - -
-
- - Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. -
-
Yesterday, 2:45 pm
-
-
-
+
+
+

Comments:

+
+
+ +
+
+ +
+
+
+ Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. +
+
Yesterday, 2:45 pm
+
+
<% end %> diff --git a/web/app/views/users/_user_dropdown.html.erb b/web/app/views/users/_user_dropdown.html.erb index a42194440..842219322 100644 --- a/web/app/views/users/_user_dropdown.html.erb +++ b/web/app/views/users/_user_dropdown.html.erb @@ -12,7 +12,7 @@
-
    +
    • <%= link_to "Identity", '/client#/account/identity' %>
    • From 6d482a034d02231208edb9693287c18ffd0bb3ec Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 16 Jan 2014 02:50:13 -0500 Subject: [PATCH 03/39] VRFS-986 more landing page work --- ... => icon_instrument_acoustic_guitar24.png} | Bin ... => icon_instrument_acoustic_guitar45.png} | Bin ....png => icon_instrument_bass_guitar24.png} | Bin ....png => icon_instrument_bass_guitar45.png} | Bin ... => icon_instrument_electric_guitar24.png} | Bin ... => icon_instrument_electric_guitar45.png} | Bin ....png => icon_instrument_french_horn24.png} | Bin ....png => icon_instrument_french_horn45.png} | Bin web/app/assets/javascripts/utils.js | 8 ++-- web/app/views/recordings/show.html.erb | 42 ++++++++++-------- web/app/views/shared/_cta_sidebar.html.erb | 0 .../views/shared/_landing_sidebar.html.erb | 0 web/config/environments/development.rb | 2 +- 13 files changed, 29 insertions(+), 23 deletions(-) rename web/app/assets/images/content/{icon_instrument_acoustic24.png => icon_instrument_acoustic_guitar24.png} (100%) rename web/app/assets/images/content/{icon_instrument_acoustic45.png => icon_instrument_acoustic_guitar45.png} (100%) rename web/app/assets/images/content/{icon_instrument_bass24.png => icon_instrument_bass_guitar24.png} (100%) rename web/app/assets/images/content/{icon_instrument_bass45.png => icon_instrument_bass_guitar45.png} (100%) rename web/app/assets/images/content/{icon_instrument_guitar24.png => icon_instrument_electric_guitar24.png} (100%) rename web/app/assets/images/content/{icon_instrument_guitar45.png => icon_instrument_electric_guitar45.png} (100%) rename web/app/assets/images/content/{icon_instrument_frenchhorn24.png => icon_instrument_french_horn24.png} (100%) rename web/app/assets/images/content/{icon_instrument_frenchhorn45.png => icon_instrument_french_horn45.png} (100%) create mode 100644 web/app/views/shared/_cta_sidebar.html.erb create mode 100644 web/app/views/shared/_landing_sidebar.html.erb diff --git a/web/app/assets/images/content/icon_instrument_acoustic24.png b/web/app/assets/images/content/icon_instrument_acoustic_guitar24.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_acoustic24.png rename to web/app/assets/images/content/icon_instrument_acoustic_guitar24.png diff --git a/web/app/assets/images/content/icon_instrument_acoustic45.png b/web/app/assets/images/content/icon_instrument_acoustic_guitar45.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_acoustic45.png rename to web/app/assets/images/content/icon_instrument_acoustic_guitar45.png diff --git a/web/app/assets/images/content/icon_instrument_bass24.png b/web/app/assets/images/content/icon_instrument_bass_guitar24.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_bass24.png rename to web/app/assets/images/content/icon_instrument_bass_guitar24.png diff --git a/web/app/assets/images/content/icon_instrument_bass45.png b/web/app/assets/images/content/icon_instrument_bass_guitar45.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_bass45.png rename to web/app/assets/images/content/icon_instrument_bass_guitar45.png diff --git a/web/app/assets/images/content/icon_instrument_guitar24.png b/web/app/assets/images/content/icon_instrument_electric_guitar24.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_guitar24.png rename to web/app/assets/images/content/icon_instrument_electric_guitar24.png diff --git a/web/app/assets/images/content/icon_instrument_guitar45.png b/web/app/assets/images/content/icon_instrument_electric_guitar45.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_guitar45.png rename to web/app/assets/images/content/icon_instrument_electric_guitar45.png diff --git a/web/app/assets/images/content/icon_instrument_frenchhorn24.png b/web/app/assets/images/content/icon_instrument_french_horn24.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_frenchhorn24.png rename to web/app/assets/images/content/icon_instrument_french_horn24.png diff --git a/web/app/assets/images/content/icon_instrument_frenchhorn45.png b/web/app/assets/images/content/icon_instrument_french_horn45.png similarity index 100% rename from web/app/assets/images/content/icon_instrument_frenchhorn45.png rename to web/app/assets/images/content/icon_instrument_french_horn45.png diff --git a/web/app/assets/javascripts/utils.js b/web/app/assets/javascripts/utils.js index 2d9ec36a1..a55e396f5 100644 --- a/web/app/assets/javascripts/utils.js +++ b/web/app/assets/javascripts/utils.js @@ -42,18 +42,18 @@ // available, and allowing the browser to resize offers better quality. var icon_map_base = { "accordion":"accordion", - "acoustic guitar":"acoustic", + "acoustic guitar":"acoustic_guitar", "banjo":"banjo", - "bass guitar":"bass", + "bass guitar":"bass_guitar", "cello":"cello", "clarinet":"clarinet", "computer":"computer", "default":"default", "drums":"drums", - "electric guitar":"guitar", + "electric guitar":"electric_guitar", "euphonium":"euphonium", "flute":"flute", - "french horn":"frenchhorn", + "french horn":"french_horn", "harmonica":"harmonica", "keyboard":"keyboard", "mandolin":"mandolin", diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 875d9919b..9cf20c28f 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -59,27 +59,33 @@ <% @claimed_recording.recording.recorded_tracks.each_with_index do |track, index| %> <% if index % 2 == 0 %> + <% end %> - - - - <% if index % 2 == 0 %> + <% if index % 2 > 0 %> - <% else %> - <% end %> <% end %>
       
      -
      - <% unless track.user.photo_url.blank? %> - <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> - <% else %> - <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> - <% end %> -
      +
      + + + + + + + +
      +
      + <% unless track.user.photo_url.blank? %> + <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
      +
      <%= track.user.name %>
      +
      + <%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => ""} %> +
      +
      <%= track.user.name %>
      -
      - <%= image_tag "shared/icon_instrument_#{track.instrument_id}45.png", {:width => 32, :alt => ""} %> -
      -
      @@ -117,7 +123,7 @@ <% content_for :after_black_bar do %>
      -

      Comments:

      +

      Comments:


      diff --git a/web/app/views/shared/_cta_sidebar.html.erb b/web/app/views/shared/_cta_sidebar.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/web/app/views/shared/_landing_sidebar.html.erb b/web/app/views/shared/_landing_sidebar.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index 6aec3027a..0fa697e0d 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -48,7 +48,7 @@ SampleApp::Application.configure do config.assets.debug = false # Set the logging destination(s) - config.log_to = %w[stdout file] + # config.log_to = %w[stdout file] # Show the logging configuration on STDOUT config.show_log_configuration = true From 09d84b4c11a6504f038715684d93606d3c726e3b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 18 Jan 2014 15:32:39 -0500 Subject: [PATCH 04/39] VRFS-986 landing page work --- web/app/views/recordings/show.html.erb | 53 +++---------------- web/app/views/shared/_comments.html.erb | 22 ++++++++ web/app/views/shared/_cta_sidebar.html.erb | 10 ++++ .../views/shared/_landing_sidebar.html.erb | 26 +++++++++ 4 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 web/app/views/shared/_comments.html.erb diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 9cf20c28f..b7f2c811e 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -91,53 +91,14 @@

      - -

      -

      More by Raven & The Blackbirds:


      -
      Now:
      - -
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
      -

      -
      Yesterday:
      -
      RECORDING: You Hurt Me Bad
      -
      Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
      -

      -
      Dec. 18th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
      -

      -
      Dec. 12th:
      -
      RECORDING: Bustin' My Chops
      -
      Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
      -

      -
      Dec. 10th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
      -

      -
      Nov. 29th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
      -
      - + +<% if !signed_in? %> + <%= render "shared/landing_sidebar" %> +<% else %> + <%= render "shared/cta_sidebar" %> +<% end %> <% content_for :after_black_bar do %>
      -
      -

      Comments:


      -
      -
      - -
      -
      - -
      -
      -
      - Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. -
      -
      Yesterday, 2:45 pm
      -
      -
      -
      -
      + <%= render "shared/comments", :locals => {:comments => @claimed_recording.recording.comments} %> <% end %> diff --git a/web/app/views/shared/_comments.html.erb b/web/app/views/shared/_comments.html.erb new file mode 100644 index 000000000..024273321 --- /dev/null +++ b/web/app/views/shared/_comments.html.erb @@ -0,0 +1,22 @@ +
      +

      Comments:


      +
      + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> +
      +
      + +
      +
      + +
      +
      + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> +
      +
      + Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. +
      +
      Yesterday, 2:45 pm
      +
      +
      +
      +
      \ No newline at end of file diff --git a/web/app/views/shared/_cta_sidebar.html.erb b/web/app/views/shared/_cta_sidebar.html.erb index e69de29bb..7742e983b 100644 --- a/web/app/views/shared/_cta_sidebar.html.erb +++ b/web/app/views/shared/_cta_sidebar.html.erb @@ -0,0 +1,10 @@ +
      + +

      + <%= image_tag "web/carousel_musicians.jpg", {:width => 350, :alt => ""} %>

      + <%= image_tag "web/carousel_fans.jpg", {:width => 350, :alt => ""} %>

      + <%= image_tag "web/carousel_bands.jpg", {:width => 350, :alt => ""} %> +
      \ No newline at end of file diff --git a/web/app/views/shared/_landing_sidebar.html.erb b/web/app/views/shared/_landing_sidebar.html.erb index e69de29bb..01b80d4e2 100644 --- a/web/app/views/shared/_landing_sidebar.html.erb +++ b/web/app/views/shared/_landing_sidebar.html.erb @@ -0,0 +1,26 @@ +

      +

      More by Raven & The Blackbirds:


      +
      Now:
      + +
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
      +

      +
      Yesterday:
      +
      RECORDING: You Hurt Me Bad
      +
      Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
      +

      +
      Dec. 18th:
      +
      SESSION: Session Ended. Unavailable.
      +
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
      +

      +
      Dec. 12th:
      +
      RECORDING: Bustin' My Chops
      +
      Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
      +

      +
      Dec. 10th:
      +
      SESSION: Session Ended. Unavailable.
      +
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
      +

      +
      Nov. 29th:
      +
      SESSION: Session Ended. Unavailable.
      +
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
      +
      \ No newline at end of file From cdb47bdd75ee4155213c81ebf0c741c8fe1f2382 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 18 Jan 2014 21:03:15 -0500 Subject: [PATCH 05/39] fix band_session_join protobuf message --- pb/src/client_container.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pb/src/client_container.proto b/pb/src/client_container.proto index 9e16de1f4..4c9ebfa21 100644 --- a/pb/src/client_container.proto +++ b/pb/src/client_container.proto @@ -102,7 +102,6 @@ message ClientMessage { optional SessionJoin session_join = 190; optional SessionDepart session_depart = 195; optional MusicianSessionJoin musician_session_join = 196; - optional BandSessionJoin band_session_join = 197; // recording notifications optional MusicianRecordingSaved musician_recording_saved = 200; @@ -115,6 +114,7 @@ message ClientMessage { // 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; From eea5cc781ead1413058db1ebbb3e9cc50101f54f Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 19 Jan 2014 17:23:10 -0500 Subject: [PATCH 06/39] VRFS-986 landing page work --- ruby/lib/jam_ruby/models/track.rb | 4 + web/app/views/music_sessions/show.html.erb | 90 ++++++++++++++----- web/app/views/recordings/show.html.erb | 46 ++-------- web/app/views/shared/_comments.html.erb | 24 +++-- .../views/shared/_landing_sidebar.html.erb | 2 +- web/app/views/shared/_track_details.html.erb | 33 +++++++ 6 files changed, 129 insertions(+), 70 deletions(-) create mode 100644 web/app/views/shared/_track_details.html.erb diff --git a/ruby/lib/jam_ruby/models/track.rb b/ruby/lib/jam_ruby/models/track.rb index 76b428b09..2413028eb 100644 --- a/ruby/lib/jam_ruby/models/track.rb +++ b/ruby/lib/jam_ruby/models/track.rb @@ -14,6 +14,10 @@ module JamRuby validates :sound, :inclusion => {:in => SOUND} + def user + self.connection.user + end + def self.index(current_user, music_session_id) query = Track .joins( diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index d60140bb3..43c318db5 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -1,24 +1,72 @@ -<% provide(:title, "Now Playing: #{@music_session.description}") %> -
      - -
      -

      Internal Session Activity

      -
      -

      Wait a moment...

      -
      -
      +<% provide(:title, "#{@claimed_recording.name}") %> + +
      + <% unless @claimed_recording.recording.band.nil? %> +
      + <% unless @claimed_recording.recording.band.photo_url.blank? %> + <%= image_tag "#{@claimed_recording.recording.band.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic_band.png", {:alt => ""} %> + <% end %> +
      + <%= @claimed_recording.recording.band.name %> + <% else %> +
      + <% unless @claimed_recording.recording.owner.photo_url.blank? %> + <%= image_tag "#{@claimed_recording.recording.owner.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
      + <%= @claimed_recording.recording.owner.name %> + <% end %>
      -<% content_for :post_scripts do %> - +
      +
      RECORDING
      +
      <%= @claimed_recording.recording.created_at.strftime("%b %e %Y, %l:%M %p") %>
      +

      +

      <%= @claimed_recording.name %>

      + +
      TODO: Which field is this in the database??

      +
      +
      + <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> +
      +
      0:00
      +
      +
      <%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16} %>
      +
      +
      4:59
      +
      +
      1:23
      +
      + +
      <%= @claimed_recording.genre_id.capitalize %>
      +
      + <%= @claimed_recording.recording.play_count %> + <%= image_tag "content/icon_arrow.png", {:width => 7, :height => 12, :align => "absmiddle"} %>     + <%= @claimed_recording.recording.comment_count %> + <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>     + <%= @claimed_recording.recording.like_count %> + <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %> +
      +
      +

      + <%= render :partial => "shared/track_details", :locals => {:tracks => @claimed_recording.recording.recorded_tracks} %> +
      +
      + +<% if signed_in? %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner} %> +<% else %> + <%= render :partial => "shared/cta_sidebar" %> +<% end %> + +<% content_for :after_black_bar do %> +
      + <%= render :partial => "shared/comments", :locals => {:comments => @claimed_recording.recording.comments} %> <% end %> diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index b7f2c811e..43c318db5 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -24,7 +24,7 @@
      RECORDING
      -
      <%= @claimed_recording.recording.created_at %>
      +
      <%= @claimed_recording.recording.created_at.strftime("%b %e %Y, %l:%M %p") %>


      <%= @claimed_recording.name %>

      @@ -36,7 +36,7 @@
      <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %>
      -
      0:00
      +
      0:00
      <%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16} %>
      @@ -56,49 +56,17 @@


      - - <% @claimed_recording.recording.recorded_tracks.each_with_index do |track, index| %> - <% if index % 2 == 0 %> - - - <% end %> - - <% if index % 2 > 0 %> - - <% end %> - <% end %> -
       
      - - - - - - - -
      -
      - <% unless track.user.photo_url.blank? %> - <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> - <% else %> - <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> - <% end %> -
      -
      <%= track.user.name %>
      -
      - <%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => ""} %> -
      -
      -
      + <%= render :partial => "shared/track_details", :locals => {:tracks => @claimed_recording.recording.recorded_tracks} %>

      -<% if !signed_in? %> - <%= render "shared/landing_sidebar" %> +<% if signed_in? %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner} %> <% else %> - <%= render "shared/cta_sidebar" %> + <%= render :partial => "shared/cta_sidebar" %> <% end %> <% content_for :after_black_bar do %>
      - <%= render "shared/comments", :locals => {:comments => @claimed_recording.recording.comments} %> + <%= render :partial => "shared/comments", :locals => {:comments => @claimed_recording.recording.comments} %> <% end %> diff --git a/web/app/views/shared/_comments.html.erb b/web/app/views/shared/_comments.html.erb index 024273321..955d8baae 100644 --- a/web/app/views/shared/_comments.html.erb +++ b/web/app/views/shared/_comments.html.erb @@ -9,14 +9,20 @@
      -
      - <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> -
      -
      - Billy Saban Ut eu ligula. Etiam ligula enim, tempor ut, blandit nec, mollis eu, lectus. -
      -
      Yesterday, 2:45 pm
      -
      -
      + <% comments.each do |c| %> +
      + <% unless c.user.photo_url.blank? %> + <%= image_tag "#{c.user.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
      +
      + <%= c.user.name %> <%= c.comment %> +
      +
      <%= c.created_at.strftime("%b %e %Y, %l:%M %p") %>
      +
      +
      + <% end %>
      \ No newline at end of file diff --git a/web/app/views/shared/_landing_sidebar.html.erb b/web/app/views/shared/_landing_sidebar.html.erb index 01b80d4e2..36cb3abfb 100644 --- a/web/app/views/shared/_landing_sidebar.html.erb +++ b/web/app/views/shared/_landing_sidebar.html.erb @@ -1,5 +1,5 @@

      -

      More by Raven & The Blackbirds:


      +

      More by <%= user.name %>:


      Now:
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
      diff --git a/web/app/views/shared/_track_details.html.erb b/web/app/views/shared/_track_details.html.erb new file mode 100644 index 000000000..9921c2807 --- /dev/null +++ b/web/app/views/shared/_track_details.html.erb @@ -0,0 +1,33 @@ + + <% tracks.each_with_index do |track, index| %> + <% if index % 2 == 0 %> + + + <% end %> + + <% if index % 2 > 0 %> + + <% end %> + <% end %> +
       
      + + + + + + + +
      +
      + <% unless track.user.photo_url.blank? %> + <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> + <% else %> + <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> + <% end %> +
      +
      <%= track.user.name %>
      +
      + <%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => "", :title => "#{track.instrument_id}"} %> +
      +
      +
      \ No newline at end of file From 6660102982630544c281b22254cbc13beede0326 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 20 Jan 2014 09:28:06 -0500 Subject: [PATCH 07/39] VRFS-986 landing page work --- .../jam_ruby/models/music_session_history.rb | 1 + .../models/music_session_user_history.rb | 4 ++ .../controllers/music_sessions_controller.rb | 44 +------------------ web/app/views/music_sessions/show.html.erb | 38 +++++++--------- web/app/views/recordings/show.html.erb | 2 +- 5 files changed, 23 insertions(+), 66 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index 1a6fd8418..a793cdad8 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -15,6 +15,7 @@ module JamRuby :foreign_key => :band_id, :inverse_of => :music_session_history) + has_many :music_session_history_users, :class_name => "JamRuby::MusicSessionUserHistory", :foreign_key => "music_session_id" has_many :comments, :class_name => "JamRuby::MusicSessionComment", :foreign_key => "music_session_id" has_many :likes, :class_name => "JamRuby::MusicSessionLiker", :foreign_key => "music_session_id" diff --git a/ruby/lib/jam_ruby/models/music_session_user_history.rb b/ruby/lib/jam_ruby/models/music_session_user_history.rb index 4e7a294b9..5bad18773 100644 --- a/ruby/lib/jam_ruby/models/music_session_user_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_user_history.rb @@ -12,6 +12,10 @@ module JamRuby :foreign_key => "user_id", :inverse_of => :music_session_user_histories) + belongs_to(:music_session_history, + :class_name => "MusicSessionHistory", + :foreign_key => "music_session_id") + validates_inclusion_of :rating, :in => 0..2, :allow_nil => true after_save :track_user_progression diff --git a/web/app/controllers/music_sessions_controller.rb b/web/app/controllers/music_sessions_controller.rb index c72f6f22f..7087fdaad 100644 --- a/web/app/controllers/music_sessions_controller.rb +++ b/web/app/controllers/music_sessions_controller.rb @@ -1,50 +1,10 @@ class MusicSessionsController < ApplicationController - # have to be signed in currently to see this screen - before_filter :signed_in_user - respond_to :html - def index - @music_sessions = MusicSession.paginate(page: params[:page]) - end - def show - @music_session = MusicSession.find(params[:id]) - - # use gon to pass variables into javascript - gon.websocket_gateway_uri = Rails.application.config.websocket_gateway_uri - gon.music_session_id = @music_session.id - end - - def new - @music_session = MusicSession.new - end - - def create - @music_session = MusicSession.new() - @music_session.creator = current_user - @music_session.description = params[:jam_ruby_music_session][:description] - if @music_session.save - flash[:success] = "Music Session created" - redirect_to @music_session - else - render 'new' - end - end - - - def edit - end - - def update - - end - - def destroy - MusicSession.find(params[:id]).destroy - flash[:success] = "Jam Session deleted." - redirect_to music_sessions_url + @music_session = MusicSessionHistory.find_by_music_session_id(params[:id]) + render :layout => "web" end end diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 43c318db5..5751dd68c 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -1,32 +1,32 @@ -<% provide(:title, "#{@claimed_recording.name}") %> +<% provide(:title, "#{@music_session.description}") %>
      - <% unless @claimed_recording.recording.band.nil? %> + <% unless @music_session.band.nil? %>
      - <% unless @claimed_recording.recording.band.photo_url.blank? %> - <%= image_tag "#{@claimed_recording.recording.band.photo_url}", {:alt => ""} %> + <% unless @music_session.band.photo_url.blank? %> + <%= image_tag "#{@music_session.band.photo_url}", {:alt => ""} %> <% else %> <%= image_tag "shared/avatar_generic_band.png", {:alt => ""} %> <% end %>
      - <%= @claimed_recording.recording.band.name %> + <%= @music_session.band.name %> <% else %>
      - <% unless @claimed_recording.recording.owner.photo_url.blank? %> - <%= image_tag "#{@claimed_recording.recording.owner.photo_url}", {:alt => ""} %> + <% unless @music_session.creator.photo_url.blank? %> + <%= image_tag "#{@music_session.creator.photo_url}", {:alt => ""} %> <% else %> <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> <% end %>
      - <%= @claimed_recording.recording.owner.name %> + <%= @music_session.creator.name %> <% end %>
      -
      RECORDING
      -
      <%= @claimed_recording.recording.created_at.strftime("%b %e %Y, %l:%M %p") %>
      +
      SESSION: Live Session in Progress
      +
      <%= @cmusic_session.created_at.strftime("%b %e %Y, %l:%M %p") %>


      -

      <%= @claimed_recording.name %>

      +

      <%= @music_session.name %>

      <%= image_tag "content/icon_like.png", {:width => 12, :height => 12} %> LIKE    <%= image_tag "content/icon_share.png", {:width => 13, :height => 15} %> SHARE @@ -34,22 +34,14 @@
      TODO: Which field is this in the database??

      - <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> -
      -
      0:00
      -
      -
      <%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16} %>
      -
      -
      4:59
      -
      + <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> +
      LIVE SESSION IN PROGRESS
      1:23
      -
      <%= @claimed_recording.genre_id.capitalize %>
      +
      <%= @music_session.genres.split('|').first.id.capitalize %>
      - <%= @claimed_recording.recording.play_count %> - <%= image_tag "content/icon_arrow.png", {:width => 7, :height => 12, :align => "absmiddle"} %>     - <%= @claimed_recording.recording.comment_count %> + <%= @music_session.comment_count %> <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>     <%= @claimed_recording.recording.like_count %> <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %> diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 43c318db5..8e3173d52 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -61,7 +61,7 @@
      <% if signed_in? %> - <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner} %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner, :recent_events => ""} %> <% else %> <%= render :partial => "shared/cta_sidebar" %> <% end %> From f4f54f579e0b80df7b9c7e9b31e85bb6f80ff394 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 21 Jan 2014 01:49:45 -0500 Subject: [PATCH 08/39] VRFS-986 pass recent_history to partial --- web/app/views/music_sessions/show.html.erb | 4 ++-- web/app/views/recordings/show.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 426e4452c..1894612a5 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -54,9 +54,9 @@ <% if signed_in? %> <% unless @music_session.band.nil? %> - <%= render :partial => "shared/landing_sidebar", :locals => {:user => @music_session.band, :recent_history => ""} %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @music_session.band, :recent_history => @music_session.band.recent_history} %> <% else %> - <%= render :partial => "shared/landing_sidebar", :locals => {:user => @music_session.user, :recent_history => ""} %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @music_session.user, :recent_history => @music_session.user.recent_history} %> <% end %> <% else %> <%= render :partial => "shared/cta_sidebar" %> diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index f3ba82f57..2fe3092b4 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -62,9 +62,9 @@ <% if signed_in? %> <% unless @claimed_recording.recording.band.nil? %> - <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.band, :recent_history => ""} %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.band, :recent_history => @claimed_recording.recording.band.recent_history} %> <% else %> - <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner, :recent_events => ""} %> + <%= render :partial => "shared/landing_sidebar", :locals => {:user => @claimed_recording.recording.owner, :recent_history => @claimed_recording.recording.owner.recent_history} %> <% end %> <% else %> <%= render :partial => "shared/cta_sidebar" %> From d6a38f6bee4c253e1537689e8a41134f6cfcdb33 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 23 Jan 2014 21:43:49 -0500 Subject: [PATCH 09/39] VRFS-986 bug fixes --- db/up/music_session_constraints.sql | 2 +- ruby/lib/jam_ruby/models/music_session_user_history.rb | 2 +- web/config/environments/development.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/up/music_session_constraints.sql b/db/up/music_session_constraints.sql index 72f2bccd4..f070bc571 100644 --- a/db/up/music_session_constraints.sql +++ b/db/up/music_session_constraints.sql @@ -6,4 +6,4 @@ ON UPDATE NO ACTION ON DELETE CASCADE; alter table music_sessions_likers drop constraint music_sessions_likers_music_session_id_fkey; alter table music_sessions_likers add constraint ms_likers_ms_history_fkey foreign key (music_session_id) references music_sessions_history(music_session_id) match simple -ON UPDATE NO ACTION ON DELETE CASCADE; +ON UPDATE NO ACTION ON DELETE CASCADE; \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/music_session_user_history.rb b/ruby/lib/jam_ruby/models/music_session_user_history.rb index 5a8e43f8d..5939f8bff 100644 --- a/ruby/lib/jam_ruby/models/music_session_user_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_user_history.rb @@ -35,7 +35,7 @@ module JamRuby session_user_history.music_session_id = music_session_id session_user_history.user_id = user_id session_user_history.client_id = client_id - session_user_history.instruments = tracks.map {|t| t.instrument_id}.join("|") + session_user_history.instruments = tracks.map {|t| t[:instrument_id]}.join("|") session_user_history.save end diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index 0fa697e0d..6aec3027a 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -48,7 +48,7 @@ SampleApp::Application.configure do config.assets.debug = false # Set the logging destination(s) - # config.log_to = %w[stdout file] + config.log_to = %w[stdout file] # Show the logging configuration on STDOUT config.show_log_configuration = true From dcea2386312787bbf9857ba75f6fb803dbbe0232 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 25 Jan 2014 10:37:15 -0500 Subject: [PATCH 10/39] VRFS-1020 share dialog work --- web/app/assets/javascripts/session.js | 1 + web/app/assets/javascripts/shareDialog.js | 102 +++++++++ web/app/assets/javascripts/web/recordings.js | 26 +-- web/app/assets/javascripts/web/sessions.js | 26 +-- web/app/assets/javascripts/web/web.js | 3 + web/app/assets/stylesheets/client/client.css | 2 + .../stylesheets/client/screen_common.css.scss | 201 +++++++----------- .../stylesheets/client/shareDialog.css.scss | 11 + .../assets/stylesheets/client/widget.css.scss | 185 ++++++++++++++++ web/app/assets/stylesheets/web/web.css | 2 + web/app/views/clients/_session.html.erb | 3 +- web/app/views/clients/_shareDialog.html.erb | 120 +++++++++++ web/app/views/clients/index.html.erb | 3 + web/app/views/music_sessions/show.html.erb | 2 + 14 files changed, 516 insertions(+), 171 deletions(-) create mode 100644 web/app/assets/javascripts/shareDialog.js create mode 100644 web/app/assets/stylesheets/client/shareDialog.css.scss create mode 100644 web/app/assets/stylesheets/client/widget.css.scss create mode 100644 web/app/views/clients/_shareDialog.html.erb diff --git a/web/app/assets/javascripts/session.js b/web/app/assets/javascripts/session.js index e017d1de6..d85a15b30 100644 --- a/web/app/assets/javascripts/session.js +++ b/web/app/assets/javascripts/session.js @@ -1319,6 +1319,7 @@ configureTrackDialog.showVoiceChatPanel(true); configureTrackDialog.showMusicAudioPanel(true); }); + $('#close-playback-recording').on('click', closeRecording); $(playbackControls) .on('pause', onPause) diff --git a/web/app/assets/javascripts/shareDialog.js b/web/app/assets/javascripts/shareDialog.js new file mode 100644 index 000000000..ddf0640ce --- /dev/null +++ b/web/app/assets/javascripts/shareDialog.js @@ -0,0 +1,102 @@ +(function(context,$) { + + "use strict"; + context.JK = context.JK || {}; + context.JK.ShareDialog = function(app) { + var logger = context.JK.logger; + var rest = context.JK.Rest(); + + function registerEvents(onOff) { + + } + + /*function showEmailDialog() { + $('#invitation-dialog').show(); + $('#invitation-textarea-container').show(); + $('#invitation-checkbox-container').hide(); + $('#btn-send-invitation').show(); + $('#btn-next-invitation').hide(); + clearTextFields(); + app.layout.showDialog('inviteUsers') + } + + function showGoogleDialog() { + $('#invitation-dialog').show(); + $('#invitation-textarea-container').hide(); + $('#invitation-checkbox-container').show(); + $('#btn-send-invitation').hide(); + $('#btn-next-invitation').show(); + clearTextFields(); + + app.layout.showDialog('inviteUsers') + + $('#invitation-checkboxes').html('
      Loading your contacts...
      '); + window._oauth_callback = function() { + window._oauth_win.close(); + window._oauth_win = null; + window._oauth_callback = null; + $.ajax({ + type: "GET", + url: "/gmail_contacts", + success: function(response) { + $('#invitation-checkboxes').html(''); + for (var i in response) { + $('#invitation-checkboxes').append(""); + } + + $('.invitation-checkbox').change(function() { + var checkedBoxes = $('.invitation-checkbox:checkbox:checked'); + var emails = ''; + for (var i = 0; i < checkedBoxes.length; i++) { + emails += $(checkedBoxes[i]).data('email') + ', '; + } + emails = emails.replace(/, $/, ''); + // track how many of these came from google + $('#txt-emails').val(emails).data('google_invite_count', checkedBoxes.length); + }); + }, + error: function() { + $('#invitation-checkboxes').html("Load failed!"); + } + }); + + }; + window._oauth_win = window.open("/auth/google_login", "_blank", "height=500,width=500,menubar=no,resizable=no,status=no"); + } + + function showFacebookDialog() { + window._oauth_callback = function() { + window._oauth_win.close(); + window._oauth_win = null; + window._oauth_callback = null; + }; + window._oauth_win = window.open("/auth/facebook_login", "_blank", "height=500,width=500,menubar=no,resizable=no,status=no"); + }*/ + + function clearTextFields() { + + } + + function beforeShow() { + registerEvents(true); + } + + function afterHide() { + registerEvents(false); + } + + function initialize(){ + var dialogBindings = { + 'beforeShow' : beforeShow, + 'afterHide': afterHide + }; + + app.bindDialog('shareSessionRecording', dialogBindings); + }; + + + this.initialize = initialize; + } + + return this; +})(window,jQuery); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/recordings.js b/web/app/assets/javascripts/web/recordings.js index a6e6d51eb..2ab8ba2bf 100644 --- a/web/app/assets/javascripts/web/recordings.js +++ b/web/app/assets/javascripts/web/recordings.js @@ -1,32 +1,10 @@ $(function() { - function search() { - var locationQuery = $('#location').val().length > 0 ? $('#location').val() : ''; + function like() { - var searchUrl = "/search"; - if (locationQuery.length > 0) { - searchUrl = searchUrl + "?location=" + encodeURIComponent(locationQuery); - - if ($('#activity').val().length > 0) { - searchUrl = searchUrl + "&activity=" + encodeURIComponent($('#activity').val()); - } - } - else { - if ($('#activity').val().length > 0) { - searchUrl = searchUrl + "?activity=" + encodeURIComponent($('#activity').val()); - } - } - - window.location.href = searchUrl; } // search click handler - $('#btnSearch').click(search); + $('#btnlike').click(like); - $("#location").keypress(function(evt) { - if (evt.which === 13) { - evt.preventDefault(); - search(); - } - }); }); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/sessions.js b/web/app/assets/javascripts/web/sessions.js index a6e6d51eb..2ab8ba2bf 100644 --- a/web/app/assets/javascripts/web/sessions.js +++ b/web/app/assets/javascripts/web/sessions.js @@ -1,32 +1,10 @@ $(function() { - function search() { - var locationQuery = $('#location').val().length > 0 ? $('#location').val() : ''; + function like() { - var searchUrl = "/search"; - if (locationQuery.length > 0) { - searchUrl = searchUrl + "?location=" + encodeURIComponent(locationQuery); - - if ($('#activity').val().length > 0) { - searchUrl = searchUrl + "&activity=" + encodeURIComponent($('#activity').val()); - } - } - else { - if ($('#activity').val().length > 0) { - searchUrl = searchUrl + "?activity=" + encodeURIComponent($('#activity').val()); - } - } - - window.location.href = searchUrl; } // search click handler - $('#btnSearch').click(search); + $('#btnlike').click(like); - $("#location").keypress(function(evt) { - if (evt.which === 13) { - evt.preventDefault(); - search(); - } - }); }); \ No newline at end of file diff --git a/web/app/assets/javascripts/web/web.js b/web/app/assets/javascripts/web/web.js index f1e3438e6..0cde1c7d7 100644 --- a/web/app/assets/javascripts/web/web.js +++ b/web/app/assets/javascripts/web/web.js @@ -6,6 +6,7 @@ //= require AAC_underscore //= require globals //= require invitationDialog +//= require shareDialog //= require layout //= require user_dropdown //= require jamkazam @@ -16,3 +17,5 @@ //= require landing/signup //= require web/downloads //= require web/congratulations +//= require web/sessions +//= require web/recordings diff --git a/web/app/assets/stylesheets/client/client.css b/web/app/assets/stylesheets/client/client.css index a852d46bf..77fa35555 100644 --- a/web/app/assets/stylesheets/client/client.css +++ b/web/app/assets/stylesheets/client/client.css @@ -32,6 +32,8 @@ *= require ./search *= require ./ftue *= require ./invitationDialog + *= require ./shareDialog + *= require ./widget *= require ./recordingFinishedDialog *= require ./localRecordingsDialog *= require ./createSession diff --git a/web/app/assets/stylesheets/client/screen_common.css.scss b/web/app/assets/stylesheets/client/screen_common.css.scss index 98fd15a4b..8b7b259d0 100644 --- a/web/app/assets/stylesheets/client/screen_common.css.scss +++ b/web/app/assets/stylesheets/client/screen_common.css.scss @@ -169,8 +169,8 @@ a { display:inline-block; } -small { - font-size:11px; +small, .small { + font-size:11px; } .button-grey { @@ -207,6 +207,11 @@ small { text-decoration:none; } +.smallbutton { + font-size:10px; + padding:2px 8px; +} + .button-orange:hover { background-color:#f16750; color:#FFF; @@ -230,49 +235,24 @@ a img { border:none; } -.clearall { - clear:both; -} +.clearall {clear:both;} +.left {float:left;} +.right {float:right;} +.center {text-align:center !important;} -.left { - float:left; -} - -.right { - float:right; -} - -.f8 { - font-size: 8px !important; -} - -.f9 { - font-size: 9px !important; -} - -.f10 { - font-size: 10px !important; -} - -.f11 { - font-size: 11px !important; -} - -.f12 { - font-size: 12px !important; -} - -.f13 { - font-size: 13px !important; -} - -.f14 { - font-size: 14px !important; -} - -.f15 { - font-size: 15px !important; -} +.f8 {font-size:8px !important} +.f9 {font-size:9px !important} +.f10 {font-size:10px !important} +.f11 {font-size:11px !important} +.f12 {font-size:12px !important} +.f13 {font-size:13px !important} +.f14 {font-size:14px !important} +.f15 {font-size:15px !important} +.f16 {font-size:16px !important} +.f17 {font-size:17px !important} +.f18 {font-size:18px !important} +.f19 {font-size:19px !important} +.f20 {font-size:20px !important} .m0 { margin: 0 !important; @@ -322,73 +302,54 @@ a img { margin-left:25px; } -.ml30 { - margin-left:30px; -} +.ml30 {margin-left:30px;} +.ml35 {margin-left:35px;} +.ml45 {margin-left:45px;} -.ml35 { - margin-left:35px; -} +.mt5 {margin-top:5px;} +.mt10 {margin-top:10px;} +.mt15 {margin-top:15px;} +.mt20 {margin-top:20px;} +.mt25 {margin-top:25px;} +.mt30 {margin-top:30px;} +.mt35 {margin-top:35px;} +.mt40 {margin-top:40px;} +.mt45 {margin-top:45px;} +.mt50 {margin-top:50px;} +.mt55 {margin-top:55px;} +.mt65 {margin-top:65px;} -.ml45 { - margin-left:45px; -} +.mb5 {margin-bottom:5px;} +.mb15 {margin-bottom:15px;} -.mt5 { - margin-top:5px; -} +.w0 {width:0% !important} +.w5 {width:5% !important} +.w10 {width:10% !important} +.w15 {width:15% !important} +.w20 {width:20% !important} +.w25 {width:25% !important} +.w30 {width:30% !important} +.w35 {width:35% !important} +.w40 {width:40% !important} +.w45 {width:45% !important} +.w50 {width:50% !important} +.w55 {width:55% !important} +.w60 {width:60% !important} +.w65 {width:65% !important} +.w70 {width:70% !important} +.w75 {width:75% !important} +.w80 {width:80% !important} +.w85 {width:85% !important} +.w90 {width:90% !important} +.w95 {width:95% !important} +.w100 {width:100% !important} -.mt10 { - margin-top:10px; -} - -.mt15 { - margin-top:15px; -} - -.mt20 { - margin-top:20px; -} - -.mt25 { - margin-top:25px; -} - -.mt30 { - margin-top:30px; -} - -.mt35 { - margin-top:35px; -} - -.mt40 { - margin-top:40px; -} - -.mt45 { - margin-top:45px; -} - -.mt50 { - margin-top:50px; -} - -.mt55 { - margin-top:55px; -} - -.mt65 { - margin-top:65px; -} - -.mb5 { - margin-bottom:5px; -} - -.mb15 { - margin-bottom:15px; -} +.p5 {padding:5px !important} +.p10 {padding:10px !important} +.p15 {padding:15px !important} +.p20 {padding:20px !important} +.p25 {padding:25px !important} +.p30 {padding:30px !important} .op50 { opacity: .5; @@ -443,20 +404,16 @@ a img { width:239px; } -.white { - color:#fff; -} - -.lightgrey { - color:#ccc; -} - -.grey { - color:#999; -} - -.darkgrey { - color:#333; -} +.white {color:#fff;} +.lightgrey {color:#ccc;} +.grey {color:#999;} +.darkgrey {color:#333;} +.orange {color:#ED3618 !important;} +.teal {color:#2b8897;} +.green-fill {background-color:#72a43b;} +.gold-fill {background-color:#cc9900;} +.red-fill {background-color:#660000;} +.orange-fill {background-color:#ed3618;} +.teal-fill {background-color:#0b6672;} /* End of Jeff's common.css file */ diff --git a/web/app/assets/stylesheets/client/shareDialog.css.scss b/web/app/assets/stylesheets/client/shareDialog.css.scss new file mode 100644 index 000000000..7a7d32c3e --- /dev/null +++ b/web/app/assets/stylesheets/client/shareDialog.css.scss @@ -0,0 +1,11 @@ +@import 'widget.css.scss' + +h3 { + display: block; + font-size: 1.17em !important; + -webkit-margin-before: 1em; + -webkit-margin-after: 1em; + -webkit-margin-start: 0px; + -webkit-margin-end: 0px; + font-weight: bold; +} \ No newline at end of file diff --git a/web/app/assets/stylesheets/client/widget.css.scss b/web/app/assets/stylesheets/client/widget.css.scss new file mode 100644 index 000000000..23c82020d --- /dev/null +++ b/web/app/assets/stylesheets/client/widget.css.scss @@ -0,0 +1,185 @@ +body.widgets { + background:#fff; + padding:20px; +} + +.widget { + width:430px; + height:180px; + background:#353535; + border:solid 1px; + text-align:left; +} + +.widget.session { + border-color:#0b6672; +} + +.widget.recording { + border-color:#ed3618; +} + +.widget-header { + color:#fff; + font-size:17px; + padding:8px; +} + +.widget-content { + width:100%; + color:#ccc; + position:relative; +} + +.widget-avatar { + top:15px; + left:15px; + position:absolute; + padding:2px; + width:110px; + height:110px; + background-color:#ed3618; + -webkit-border-radius:57px; + -moz-border-radius:57px; + border-radius:57px; + margin-bottom:10px; +} + +.widget-avatar img { + width:110px; + height:110px; + -webkit-border-radius:55px; + -moz-border-radius:55px; + border-radius:55px; +} + +.widget-playbutton { + position:absolute; + top:55px; + left:55px; + width:35px; + height:31px; + background-image:url(../images/shared/play_button.png); + background-repeat:no-repeat; +} + +.widget-pausebutton { + position:absolute; + top:55px; + left:55px; + width:35px; + height:31px; + background-image:url(../images/shared/pause_button.png); + background-repeat:no-repeat; +} + +.widget-title { + font-size:18px; + position:absolute; + top:20px; + left:153px; + width:260px; + height:22px; + overflow:hidden; + white-space:nowrap; + text-overflow:ellipsis; +} + +.widget-description { + font-size:13px; + position:absolute; + top:15px; + left:153px; + width:260px; + height:32px; + overflow:hidden; + text-overflow:ellipsis; +} + +.widget-controls { + position:absolute; + top:25px; + left:153px; + width:270px; + height:32px; +} + +.widget-members { + position:absolute; + left:153px; + top:60px; + width:280px; + height:38px; + overflow:hidden; +} + +.widget-social { + position:absolute; + top:75px; + left:153px; + width:270px; + height:20px; + font-size:13px; +} + +.widget-branding { + position: absolute; + top: 110px; + right: 8px; + width: 270px; + height: 34px; + font-size: 13px; + text-align:right; +} + +.widget .recording-controls { + margin-top:0px; + height:22px; + padding:8px 5px; +} + +.widget .recording-playback { + width:65%; +} + +.widget .recording-position { + margin-left:-30px; + width:95%; +} + +.widget .recording-current { + top:8px; +} + +.widget a { + color:#ccc; + text-decoration:none; +} + +img.space { + margin-left:28px; +} + +.widget a:hover { + color:#fff; +} + +.widget-avatar-small { + float:left; + padding:1px; + width: 36px; + height:36px; + background-color:#ed3618; + -webkit-border-radius:18px; + -moz-border-radius:18px; + border-radius:18px; + margin-right:15px; +} + +.widget-avatar-small img { + width: 36px; + height: 36px; + -webkit-border-radius:18px; + -moz-border-radius:18px; + border-radius:18px; +} diff --git a/web/app/assets/stylesheets/web/web.css b/web/app/assets/stylesheets/web/web.css index 59db0c313..fb5b53926 100644 --- a/web/app/assets/stylesheets/web/web.css +++ b/web/app/assets/stylesheets/web/web.css @@ -7,6 +7,8 @@ *= require client/user_dropdown *= require client/dialog *= require client/invitationDialog +*= require client/shareDialog +*= require client/widget *= require web/main *= require web/footer *= require web/recordings diff --git a/web/app/views/clients/_session.html.erb b/web/app/views/clients/_session.html.erb index 308178ef1..43085a35b 100644 --- a/web/app/views/clients/_session.html.erb +++ b/web/app/views/clients/_session.html.erb @@ -18,7 +18,7 @@ <%= 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 @@ -137,6 +137,7 @@ <%= render "addNewGear" %> <%= render "error" %> <%= render "sessionSettings" %> +<%= render "shareDialog" %> diff --git a/web/app/views/clients/_profile.html.erb b/web/app/views/clients/_profile.html.erb index 029292e0c..50828ba03 100644 --- a/web/app/views/clients/_profile.html.erb +++ b/web/app/views/clients/_profile.html.erb @@ -1,4 +1,4 @@ - +m
      @@ -145,30 +145,41 @@
      - From 7a782c21978b9f5d59d43ca3b06a988ed1591841 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 26 Jan 2014 13:25:34 -0500 Subject: [PATCH 23/39] VRFS-930 Musician fixes --- .../stylesheets/client/musician.css.scss | 22 ------------------- web/app/views/clients/_musicians.html.erb | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/web/app/assets/stylesheets/client/musician.css.scss b/web/app/assets/stylesheets/client/musician.css.scss index 821b354cc..fffe5970b 100644 --- a/web/app/assets/stylesheets/client/musician.css.scss +++ b/web/app/assets/stylesheets/client/musician.css.scss @@ -35,28 +35,6 @@ padding-right: 5px; padding-left: 5px; - #result_instruments { - font-weight: normal; - > img { - margin-right: 4px; - height:24px; - width:24px; - } - } - .result-name { - font-size: 12px; - font-weight: bold; - margin-bottom: 2px; - } - .stats { - margin-top: 4px; - img { - vertical-align: middle; - } - } - .lcol { - width: 148px; - } table.musicians { margin-top:12px; } diff --git a/web/app/views/clients/_musicians.html.erb b/web/app/views/clients/_musicians.html.erb index 8e21bdf57..c06ad294c 100644 --- a/web/app/views/clients/_musicians.html.erb +++ b/web/app/views/clients/_musicians.html.erb @@ -37,7 +37,7 @@
      {musician_name}
      {musician_location}
      -
      {instruments}
      +
      {instruments}
      {biography}
      From df748d5f5a4848ff8bd4e0a19583e4a74faf4538 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 26 Jan 2014 13:32:21 -0500 Subject: [PATCH 24/39] VRFS-930 Musician fixes Addresses horiz. scrollbar in the header --- web/app/assets/stylesheets/client/content.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/assets/stylesheets/client/content.css.scss b/web/app/assets/stylesheets/client/content.css.scss index c074227b8..440d926f2 100644 --- a/web/app/assets/stylesheets/client/content.css.scss +++ b/web/app/assets/stylesheets/client/content.css.scss @@ -313,7 +313,7 @@ a.arrow-down { padding:6px 0px 11px 0px; background-color:#4c4c4c; min-height:20px; - overflow-x:scroll; +// overflow-x:scroll; select { font-size:11px; margin-top:4px; From b98e6439d98160caf8ab74eaff1ec1600fc61404 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 26 Jan 2014 13:35:03 -0500 Subject: [PATCH 25/39] VRFS-930 Musician fixes "Oops". removed accidentally committed test text. --- web/app/assets/javascripts/findMusician.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/assets/javascripts/findMusician.js b/web/app/assets/javascripts/findMusician.js index 3599826ed..357943281 100644 --- a/web/app/assets/javascripts/findMusician.js +++ b/web/app/assets/javascripts/findMusician.js @@ -128,7 +128,7 @@ musician_name: mm.name, musician_location: mm.city + ', ' + mm.state, instruments: instr_logos, - biography: mm['biography'] || 'Lorum Ipsum Nulla facilisi. In vel sem. Morbi id urna in diam dignissim feugiat. Proin molestie tortor eu velit. Aliquam erat volutpat. Nullam ultrices, diam tempus vulputate egestas, eros pede varius leo, sed imperdiet lectus est ornare odio.', + biography: mm['biography'], follow_count: mm['follow_count'], friend_count: mm['friend_count'], recording_count: mm['recording_count'], From a7f10d81418a4d6fc727f0f5f288bf920e928510 Mon Sep 17 00:00:00 2001 From: Daniel Weigh Date: Sun, 26 Jan 2014 13:44:06 -0500 Subject: [PATCH 26/39] VRFS-930 Musician fixes VRFS-931 Band fixes Allows for (temporary?) hiding of buttons when FOLLOW is clicked. --- web/app/assets/javascripts/findBand.js | 3 ++- web/app/assets/javascripts/findMusician.js | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/assets/javascripts/findBand.js b/web/app/assets/javascripts/findBand.js index f35206798..3fcfb3960 100644 --- a/web/app/assets/javascripts/findBand.js +++ b/web/app/assets/javascripts/findBand.js @@ -182,7 +182,8 @@ processData: false, success: function(response) { // remove the orange look to indicate it's not selectable - $('div[data-band-id='+newFollowing.band_id+'] .search-m-follow').removeClass('button-orange'); +// @FIXME -- this will need to be tweaked when we allow unfollowing + $('div[data-band-id='+newFollowing.band_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey'); }, error: app.ajaxError }); diff --git a/web/app/assets/javascripts/findMusician.js b/web/app/assets/javascripts/findMusician.js index 357943281..91ecca218 100644 --- a/web/app/assets/javascripts/findMusician.js +++ b/web/app/assets/javascripts/findMusician.js @@ -178,7 +178,8 @@ function friendRequestCallback(user_id) { // remove the orange look to indicate it's not selectable - $('div[data-musician-id='+user_id+'] .search-m-friend').removeClass('button-orange'); +// @FIXME -- this will need to be tweaked when we allow unfollowing + $('div[data-musician-id='+user_id+'] .search-m-friend').removeClass('button-orange').addClass('button-grey'); } function followMusician(evt) { @@ -203,7 +204,8 @@ processData: false, success: function(response) { // remove the orange look to indicate it's not selectable - $('div[data-musician-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange'); +// @FIXME -- this will need to be tweaked when we allow unfollowing + $('div[data-musician-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange').addClass('button-grey'); }, error: app.ajaxError }); From 576e8deeee8228ab211ef58b668da5e12a827448 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 26 Jan 2014 19:51:56 +0000 Subject: [PATCH 27/39] * fixing recursion bug in eventmachine.rb --- ruby/lib/jam_ruby/lib/em_helper.rb | 2 +- web/config/initializers/dev_users.rb | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ruby/lib/jam_ruby/lib/em_helper.rb b/ruby/lib/jam_ruby/lib/em_helper.rb index 3669e7491..2e8c46c55 100644 --- a/ruby/lib/jam_ruby/lib/em_helper.rb +++ b/ruby/lib/jam_ruby/lib/em_helper.rb @@ -91,7 +91,7 @@ module JamWebEventMachine Thread.abort_on_exception = true # create a new thread separate from the Rails main thread that EventMachine can run on - start + run end end end diff --git a/web/config/initializers/dev_users.rb b/web/config/initializers/dev_users.rb index ed67ae501..8d81037fa 100644 --- a/web/config/initializers/dev_users.rb +++ b/web/config/initializers/dev_users.rb @@ -3,19 +3,19 @@ if Rails.env == "development" && Rails.application.config.bootstrap_dev_users # if we've run once before, don't run again unless User.find_by_email("seth@jamkazam.com") - # create one user per employee, +1 for peter2 because he asked for it - User.create_dev_user("Seth", "Call", "seth@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_seth.jpg') - User.create_dev_user("Brian", "Smith", "briansmith@jamkazam.com", "jam123", "Apex", "NC", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_brian.jpg') - User.create_dev_user("Peter", "Walker", "peter@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_peter.jpg') - User.create_dev_user("Peter", "Walker", "peter2@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_peter.jpg') - User.create_dev_user("David", "Wilson", "david@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_david.jpg') - User.create_dev_user("Jonathon", "Wilson", "jonathon@jamkazam.com", "jam123", "Bozeman", "MT", "US", [{:instrument_id => "keyboard", :proficiency_level => 4, :priority => 1}], 'http://www.jamkazam.com/assets/avatars/avatar_jonathon.jpg') - User.create_dev_user("Jonathan", "Kolyer", "jonathan@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) - User.create_dev_user("Oswald", "Becca", "os@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) - User.create_dev_user("Anthony", "Davis", "anthony@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) - User.create_dev_user("George", "Currie", "george@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) - User.create_dev_user("Chris", "Doughty", "chris@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) - User.create_dev_user("Daniel", "Weigh", "daniel@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + # create one user per employee, +1 for peter2 because he asked for it + User.create_dev_user("Seth", "Call", "seth@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_seth.jpg') + User.create_dev_user("Brian", "Smith", "briansmith@jamkazam.com", "jam123", "Apex", "NC", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_brian.jpg') + User.create_dev_user("Peter", "Walker", "peter@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_peter.jpg') + User.create_dev_user("Peter", "Walker", "peter2@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_peter.jpg') + User.create_dev_user("David", "Wilson", "david@jamkazam.com", "jam123", "Austin", "TX", "US", nil, 'http://www.jamkazam.com/assets/avatars/avatar_david.jpg') + User.create_dev_user("Jonathon", "Wilson", "jonathon@jamkazam.com", "jam123", "Bozeman", "MT", "US", [{:instrument_id => "keyboard", :proficiency_level => 4, :priority => 1}], 'http://www.jamkazam.com/assets/avatars/avatar_jonathon.jpg') + User.create_dev_user("Jonathan", "Kolyer", "jonathan@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + User.create_dev_user("Oswald", "Becca", "os@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + User.create_dev_user("Anthony", "Davis", "anthony@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + User.create_dev_user("George", "Currie", "george@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + User.create_dev_user("Chris", "Doughty", "chris@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) + User.create_dev_user("Daniel", "Weigh", "daniel@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil) end From 8f5a2a636911b6cbc6be6fa8eb6da5686094d4ee Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 26 Jan 2014 14:46:11 -0600 Subject: [PATCH 28/39] * tell NOKOGIRI to use system libraries in build environment --- admin/Gemfile | 1 + ruby/Gemfile | 17 ++++++++++------- web/Gemfile | 1 + websocket-gateway/Gemfile | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/admin/Gemfile b/admin/Gemfile index a14387965..7ca5eda28 100644 --- a/admin/Gemfile +++ b/admin/Gemfile @@ -11,6 +11,7 @@ else gem 'jam_db', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jampb', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jam_ruby', "0.1.#{ENV["BUILD_NUMBER"]}" + ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true" end gem 'rails' diff --git a/ruby/Gemfile b/ruby/Gemfile index f8a1643ac..b73acf642 100644 --- a/ruby/Gemfile +++ b/ruby/Gemfile @@ -6,6 +6,15 @@ end devenv = ENV["BUILD_NUMBER"].nil? # Jenkins sets a build number environment variable +if devenv + gem 'jam_db', :path=> "../db/target/ruby_package" + gem 'jampb', :path => "../pb/target/ruby/jampb" +else + gem 'jam_db' + gem 'jampb' + ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true" +end + gem 'pg', '0.15.1', :platform => [:mri, :mswin, :mingw] gem 'jdbc_postgres', :platform => [:jruby] @@ -33,13 +42,7 @@ gem 'resque-lonely_job', '~> 1.0.0' gem 'oj' gem 'builder' -if devenv - gem 'jam_db', :path=> "../db/target/ruby_package" - gem 'jampb', :path => "../pb/target/ruby/jampb" -else - gem 'jam_db' - gem 'jampb' -end + group :test do gem "factory_girl", '4.1.0' diff --git a/web/Gemfile b/web/Gemfile index c99aa6213..9cf724965 100644 --- a/web/Gemfile +++ b/web/Gemfile @@ -17,6 +17,7 @@ else gem 'jampb', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jam_ruby', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jam_websockets', "0.1.#{ENV["BUILD_NUMBER"]}" + ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true" end gem 'builder' gem 'rails', '>=3.2.11' diff --git a/websocket-gateway/Gemfile b/websocket-gateway/Gemfile index 78131b08a..52e8dd565 100644 --- a/websocket-gateway/Gemfile +++ b/websocket-gateway/Gemfile @@ -15,6 +15,7 @@ else gem 'jam_db', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jampb', "0.1.#{ENV["BUILD_NUMBER"]}" gem 'jam_ruby', "0.1.#{ENV["BUILD_NUMBER"]}" + ENV['NOKOGIRI_USE_SYSTEM_LIBRARIES'] ||= "true" end From 998ebfdc6cbbf087ed8c3c94669bf60f4b87df6b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 26 Jan 2014 16:46:41 -0500 Subject: [PATCH 29/39] VRFS-986 landing page sidebar complete / session landing fixes --- ruby/lib/jam_ruby/models/band.rb | 11 +- .../jam_ruby/models/music_session_history.rb | 12 +- ruby/lib/jam_ruby/models/recorded_track.rb | 3 + ruby/lib/jam_ruby/models/track.rb | 10 ++ ruby/lib/jam_ruby/models/user.rb | 11 +- .../stylesheets/client/screen_common.css.scss | 123 ++++++++---------- web/app/assets/stylesheets/web/main.css.scss | 17 ++- .../assets/stylesheets/web/sessions.css.scss | 17 +++ web/app/views/music_sessions/show.html.erb | 28 ++-- web/app/views/recordings/show.html.erb | 2 +- .../views/shared/_landing_sidebar.html.erb | 67 ++++++---- web/app/views/shared/_track_details.html.erb | 6 +- web/config/environments/development.rb | 2 +- 13 files changed, 186 insertions(+), 123 deletions(-) diff --git a/ruby/lib/jam_ruby/models/band.rb b/ruby/lib/jam_ruby/models/band.rb index 1ae5b26a0..e40817623 100644 --- a/ruby/lib/jam_ruby/models/band.rb +++ b/ruby/lib/jam_ruby/models/band.rb @@ -63,8 +63,15 @@ module JamRuby end def recent_history - recordings = ClaimedRecording.joins(:recordings).where(:recordings => {:band_id => "#{self.id}"}).limit(10) - msh = MusicSessionHistory.where(:band_id => self.id).limit(10) + recordings = ClaimedRecording.joins(:recordings) + .where(:recordings => {:band_id => "#{self.id}"}) + .order('created_at DESC') + .limit(10) + + msh = MusicSessionHistory.where(:band_id => self.id) + .order('created_at DESC') + .limit(10) + recordings.concat(msh) recordings.sort! {|a,b| b.created_at <=> a.created_at}.first(5) end diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index 7b552c08b..3ca4c4b17 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -15,7 +15,7 @@ module JamRuby :foreign_key => :band_id, :inverse_of => :music_session_history) - has_many :music_session_user_history, :class_name => "JamRuby::MusicSessionUserHistory", :foreign_key => "music_session_id" + has_many :music_session_user_histories, :class_name => "JamRuby::MusicSessionUserHistory", :foreign_key => "music_session_id" has_many :comments, :class_name => "JamRuby::MusicSessionComment", :foreign_key => "music_session_id" has_many :likes, :class_name => "JamRuby::MusicSessionLiker", :foreign_key => "music_session_id" @@ -31,16 +31,22 @@ module JamRuby def tracks tracks = [] - self.music_session_user_history.each do |msuh| + binding.pry + self.music_session_user_histories.each do |msuh| user = User.find(msuh.user_id) instruments = msuh.instruments.split(SEPARATOR) instruments.each do |instrument| t = Track.new - t.user = user + binding.pry + t.musician = user + binding.pry t.instrument_id = instrument + binding.pry tracks << t + binding.pry end end + binding.pry tracks end diff --git a/ruby/lib/jam_ruby/models/recorded_track.rb b/ruby/lib/jam_ruby/models/recorded_track.rb index b67ec410d..69933a560 100644 --- a/ruby/lib/jam_ruby/models/recorded_track.rb +++ b/ruby/lib/jam_ruby/models/recorded_track.rb @@ -29,6 +29,9 @@ module JamRuby validate :validate_part_complete validate :validate_too_many_upload_failures + def musician + self.user + end def can_download?(some_user) !ClaimedRecording.find_by_user_id_and_recording_id(some_user.id, recording.id).nil? diff --git a/ruby/lib/jam_ruby/models/track.rb b/ruby/lib/jam_ruby/models/track.rb index 21f45c40f..d91f00f42 100644 --- a/ruby/lib/jam_ruby/models/track.rb +++ b/ruby/lib/jam_ruby/models/track.rb @@ -7,6 +7,8 @@ module JamRuby default_scope order('created_at ASC') + attr_accessor :musician + SOUND = %w(mono stereo) belongs_to :connection, :class_name => "JamRuby::Connection", :inverse_of => :tracks @@ -18,6 +20,14 @@ module JamRuby self.connection.user end + def musician + @musician + end + + def musician=(user) + @musician = user + end + def self.index(current_user, music_session_id) query = Track .joins( diff --git a/ruby/lib/jam_ruby/models/user.rb b/ruby/lib/jam_ruby/models/user.rb index 17c5cfc47..cb4c0c212 100644 --- a/ruby/lib/jam_ruby/models/user.rb +++ b/ruby/lib/jam_ruby/models/user.rb @@ -290,8 +290,15 @@ module JamRuby end def recent_history - recordings = ClaimedRecording.joins(:recording).where(:recordings => {:owner_id => "#{self.id}"}).limit(10) - msh = MusicSessionHistory.where(:user_id => self.id).limit(10) + recordings = ClaimedRecording.joins(:recording) + .where(:recordings => {:owner_id => "#{self.id}"}) + .order('created_at DESC') + .limit(10) + + msh = MusicSessionHistory.where(:user_id => self.id) + .order('created_at DESC') + .limit(10) + recordings.concat(msh) recordings.sort! {|a,b| b.created_at <=> a.created_at}.first(5) end diff --git a/web/app/assets/stylesheets/client/screen_common.css.scss b/web/app/assets/stylesheets/client/screen_common.css.scss index 0a986912d..fe9d3497b 100644 --- a/web/app/assets/stylesheets/client/screen_common.css.scss +++ b/web/app/assets/stylesheets/client/screen_common.css.scss @@ -150,64 +150,60 @@ textarea { /* Start of Jeff's common.css file */ body { - font-family: Raleway, Arial, Helvetica, sans-serif; - font-size: 14px; - font-weight: 300; - color: #FFF; - padding:3% 6%; - background-color: #262626; - position:relative; + font-family: Raleway, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: 300; + color: #FFF; + padding:3% 6%; + background-color: #262626; + position:relative; } h1, h2, h3, h4, h5, h6, p, div, table, form, img, tr, td, th { - margin:0; - border:0; - padding:0; + margin:0; + border:0; + padding:0; } -a { - display:inline-block; -} +a {display:inline-block;} +a img {border:none;} +.clearall {clear:both;} +.clearleft {clear:left;} +small, .small {font-size:11px;} +.bold {font-weight:bold;} -small, .small { - font-size:11px; -} - -.bold { - font-weight:bold; -} .button-grey { - margin:0px 8px 0px 8px; - background-color:#666; - border: solid 1px #868686; - outline:solid 2px #666; - padding:3px 10px; - font-family:raleway; - font-size:12px; - font-weight:300; - cursor:pointer; - color:#ccc; - text-decoration:none; + margin:0px 8px 0px 8px; + background-color:#666; + border: solid 1px #868686; + outline:solid 2px #666; + padding:3px 10px; + font-family:raleway; + font-size:12px; + font-weight:300; + cursor:pointer; + color:#ccc; + text-decoration:none; } .button-grey:hover { - background-color:#999; - color:#FFF; + background-color:#999; + color:#FFF; text-decoration:none; } .button-orange { - margin:0px 8px 0px 8px; - background-color: #ED3618; - border: solid 1px #F27861; - outline: solid 2px #ED3618; - padding:3px 10px; - font-family:raleway; - font-size:12px; - font-weight:300; - cursor:pointer; - color:#FC9; - text-decoration:none; + margin:0px 8px 0px 8px; + background-color: #ED3618; + border: solid 1px #F27861; + outline: solid 2px #ED3618; + padding:3px 10px; + font-family:raleway; + font-size:12px; + font-weight:300; + cursor:pointer; + color:#FC9; + text-decoration:none; } .smallbutton { @@ -216,8 +212,8 @@ small, .small { } .button-orange:hover { - background-color:#f16750; - color:#FFF; + background-color:#f16750; + color:#FFF; text-decoration:none; } @@ -234,17 +230,6 @@ small, .small { background-color:#666; } -a img { - border:none; -} - -.clearall { - clear:both; -} -.clearleft { - clear:left; -} - .f8 {font-size:8px !important} .f9 {font-size:9px !important} .f10 {font-size:10px !important} @@ -337,29 +322,29 @@ a img { } .op50 { - opacity: .5; - -ms-filter: "alpha(opacity=50)"; + opacity: .5; + -ms-filter: "alpha(opacity=50)"; } .op30 { - opacity: .3; - -ms-filter: "alpha(opacity=30)"; + opacity: .3; + -ms-filter: "alpha(opacity=30)"; } .nowrap { - display:inline-block; - white-space:nowrap; + display:inline-block; + white-space:nowrap; } .overlay { display:none; - position:fixed; - width:100%; - height:100%; - top:0px; - left:0px; + position:fixed; + width:100%; + height:100%; + top:0px; + left:0px; z-index: 999; - background-image:url('/assets/shared/bkg_overlay.png'); + background-image:url('/assets/shared/bkg_overlay.png'); } .overlay-small { diff --git a/web/app/assets/stylesheets/web/main.css.scss b/web/app/assets/stylesheets/web/main.css.scss index 49df23e0f..44fcf4ddb 100644 --- a/web/app/assets/stylesheets/web/main.css.scss +++ b/web/app/assets/stylesheets/web/main.css.scss @@ -58,12 +58,19 @@ body.web { padding:25px; padding-top:0px; line-height:130%; - } + + h2 { + font-size:18px !important; + line-height:normal; + color:#fff; + } + a { + text-decoration: underline !important; + } - .landing-sidebar h2 { - font-size:18px !important; - line-height:normal; - color:#fff; + em { + font-style: italic !important; + } } .landing-band { diff --git a/web/app/assets/stylesheets/web/sessions.css.scss b/web/app/assets/stylesheets/web/sessions.css.scss index 139597f9c..1e790e03a 100644 --- a/web/app/assets/stylesheets/web/sessions.css.scss +++ b/web/app/assets/stylesheets/web/sessions.css.scss @@ -1,2 +1,19 @@ +/*.session-controls { + background-color:#471f18; +} +.session-controls.inprogress { + background-color:#4C742E; +} +.session-status-ended, .session-status { + float:left; + font-size:18px; +} + +.session-status-inprogress { + float:left; + font-size:15px; + color:#cccc00; + margin-left:20px; +}*/ \ No newline at end of file diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 87a9146a6..1ba28d42f 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -12,39 +12,43 @@ <%= @music_session.band.name %> <% else %>
      - <% unless @music_session.creator.photo_url.blank? %> - <%= image_tag "#{@music_session.creator.photo_url}", {:alt => ""} %> + <% unless @music_session.user.photo_url.blank? %> + <%= image_tag "#{@music_session.user.photo_url}", {:alt => ""} %> <% else %> <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> <% end %>
      - <%= @music_session.creator.name %> + <%= @music_session.user.name %> <% end %>
      -
      SESSION: Live Session in Progress
      -
      <%= @cmusic_session.created_at.strftime("%b %e %Y, %l:%M %p") %>
      +
      SESSION
      +
      <%= @music_session.created_at.strftime("%b %e %Y, %l:%M %p") %>


      -

      <%= @music_session.name %>

      +
      <%= @music_session.description %>

      -
      TODO: Which field is this in the database??

      +
      <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> -
      LIVE SESSION IN PROGRESS
      -
      1:23
      + <% if @music_session.session_removed_at.blank? %> +
      SESSION IN PROGRESS
      +
      1:23
      + <% else %> +
      LIVE SESSION ENDED
      + <% end %>
      -
      <%= @music_session.genres.split('|').first.id.capitalize %>
      +
      <%= @music_session.genres.split('|').first.capitalize %>
      <%= @music_session.comment_count %> - <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>     + <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %>     <%= @music_session.like_count %> - <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %> + <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %>


      diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index a78b3e4b4..60b11a6d7 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -31,7 +31,7 @@ <%= image_tag "content/icon_like.png", {:width => 12, :height => 12} %> LIKE    <%= image_tag "content/icon_share.png", {:width => 13, :height => 15} %> SHARE
      -
      TODO: Which field is this in the database??

      +
      <%= @claimed_recording.description %>

      <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> diff --git a/web/app/views/shared/_landing_sidebar.html.erb b/web/app/views/shared/_landing_sidebar.html.erb index 36cb3abfb..93d786fdc 100644 --- a/web/app/views/shared/_landing_sidebar.html.erb +++ b/web/app/views/shared/_landing_sidebar.html.erb @@ -1,26 +1,43 @@ -

      -

      More by <%= user.name %>:


      -
      Now:
      - -
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.
      -

      -
      Yesterday:
      -
      RECORDING: You Hurt Me Bad
      -
      Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi.
      -

      -
      Dec. 18th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum.
      -

      -
      Dec. 12th:
      -
      RECORDING: Bustin' My Chops
      -
      Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
      -

      -
      Dec. 10th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim.
      -

      -
      Nov. 29th:
      -
      SESSION: Session Ended. Unavailable.
      -
      Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer.
      +

      + +

      More by <%= user.name %>:


      + + <% recent_history.each do |history_record| %> + + <% if history_record.instance_of? ClaimedRecording %> +
      + <%= history_record.created_at.strftime("%b #{history_record.created_at.day.ordinalize}") %>: +
      +
      + RECORDING: + Test +
      + + <% elsif history_record.instance_of? MusicSessionHistory %> +
      + + <% if history_record.session_removed_at.blank? %> + Now: + <% else %> + <%= history_record.session_removed_at.strftime("%b #{history_record.session_removed_at.day.ordinalize}") %>: + <% end %> + +
      +
      + SESSION:  + <% if history_record.session_removed_at.blank? %> + Live Session in Progress + <% else %> + Session Ended. Unavailable. + <% end %> +
      + <% end %> + +
      <%= history_record.description %>
      + <% if history_record != recent_history.last %> +

      + <% end %> + + <% end %> +
      \ No newline at end of file diff --git a/web/app/views/shared/_track_details.html.erb b/web/app/views/shared/_track_details.html.erb index 80bd42c68..50263187a 100644 --- a/web/app/views/shared/_track_details.html.erb +++ b/web/app/views/shared/_track_details.html.erb @@ -9,14 +9,14 @@
      - <% unless track.user.photo_url.blank? %> - <%= image_tag "#{track.user.photo_url}", {:alt => ""} %> + <% unless track.musician.photo_url.blank? %> + <%= image_tag "#{track.musician.photo_url}", {:alt => ""} %> <% else %> <%= image_tag "shared/avatar_generic.png", {:alt => ""} %> <% end %>
      -
      <%= track.user.name %>
      +
      <%= track.musician.name %>
      <%= image_tag "content/icon_instrument_#{track.instrument_id.tr(" ", "_")}45.png", {:width => 32, :alt => "", :title => "#{track.instrument_id}"} %> diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index aa26582a7..bd84734bb 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -48,7 +48,7 @@ SampleApp::Application.configure do config.assets.debug = false # Set the logging destination(s) - config.log_to = %w[stdout file] + # config.log_to = %w[stdout file] # Show the logging configuration on STDOUT config.show_log_configuration = true From 40a8dbd89ef3856c13d02f73e7c0c922fc8e81d3 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sun, 26 Jan 2014 16:48:15 -0500 Subject: [PATCH 30/39] remove binding.pry --- ruby/lib/jam_ruby/models/music_session_history.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index 3ca4c4b17..045515d38 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -31,22 +31,16 @@ module JamRuby def tracks tracks = [] - binding.pry self.music_session_user_histories.each do |msuh| user = User.find(msuh.user_id) instruments = msuh.instruments.split(SEPARATOR) instruments.each do |instrument| t = Track.new - binding.pry t.musician = user - binding.pry t.instrument_id = instrument - binding.pry tracks << t - binding.pry end end - binding.pry tracks end From 374a9da9575be6b17475c5d7f4b33050375a6533 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 28 Jan 2014 02:35:35 -0500 Subject: [PATCH 31/39] VRFS-986 landing page dev complete --- .../jam_ruby/models/music_session_comment.rb | 2 +- .../jam_ruby/models/music_session_history.rb | 2 +- .../jam_ruby/models/music_session_liker.rb | 2 +- web/app/assets/javascripts/jam_rest.js | 56 +++++++++++- .../api_music_sessions_controller.rb | 13 +-- .../controllers/api_recordings_controller.rb | 19 ++-- web/app/views/music_sessions/show.html.erb | 81 ++++++++++++++--- web/app/views/recordings/show.html.erb | 88 ++++++++++++++++--- web/app/views/shared/_comments.html.erb | 2 +- web/config/environments/development.rb | 2 +- 10 files changed, 226 insertions(+), 41 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session_comment.rb b/ruby/lib/jam_ruby/models/music_session_comment.rb index 71fa8ae9a..e9d213574 100644 --- a/ruby/lib/jam_ruby/models/music_session_comment.rb +++ b/ruby/lib/jam_ruby/models/music_session_comment.rb @@ -7,7 +7,7 @@ module JamRuby default_scope order('created_at DESC') - belongs_to :music_session, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" + belongs_to :music_session_history, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "creator_id" end diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index 045515d38..0ceca19bf 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -3,7 +3,7 @@ module JamRuby self.table_name = "music_sessions_history" - self.primary_key = 'id' + self.primary_key = 'music_session_id' belongs_to(:user, :class_name => 'JamRuby::User', diff --git a/ruby/lib/jam_ruby/models/music_session_liker.rb b/ruby/lib/jam_ruby/models/music_session_liker.rb index a7d89fc72..16ec64372 100644 --- a/ruby/lib/jam_ruby/models/music_session_liker.rb +++ b/ruby/lib/jam_ruby/models/music_session_liker.rb @@ -5,7 +5,7 @@ module JamRuby self.primary_key = 'id' - belongs_to :music_session, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" + belongs_to :music_session_history, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "liker_id" end diff --git a/web/app/assets/javascripts/jam_rest.js b/web/app/assets/javascripts/jam_rest.js index 556512a40..c8206317c 100644 --- a/web/app/assets/javascripts/jam_rest.js +++ b/web/app/assets/javascripts/jam_rest.js @@ -35,7 +35,6 @@ } function updateSession(id, newSession, onSuccess) { - logger.debug('Rest.updateSession'); return $.ajax('/api/sessions/' + id, { type: "PUT", data : newSession, @@ -44,6 +43,56 @@ }); } + function addSessionComment(sessionId, userId, comment) { + return $.ajax({ + url: '/api/sessions/' + sessionId + "/comments", + type: "POST", + data : JSON.stringify({"comment": comment, "user_id": userId}), + dataType : 'json', + contentType: 'application/json' + }); + } + + function addSessionLike(sessionId, userId) { + return $.ajax({ + url: '/api/sessions/' + sessionId + "/likes", + type: "POST", + data : JSON.stringify({"user_id": userId}), + dataType : 'json', + contentType: 'application/json' + }); + } + + function addRecordingComment(recordingId, userId, comment) { + return $.ajax({ + url: '/api/recordings/' + recordingId + "/comments", + type: "POST", + data : JSON.stringify({"comment": comment, "user_id": userId}), + dataType : 'json', + contentType: 'application/json' + }); + } + + function addRecordingLike(recordingId, userId) { + return $.ajax({ + url: '/api/recordings/' + recordingId + "/likes", + type: "POST", + data : JSON.stringify({"user_id": userId}), + dataType : 'json', + contentType: 'application/json' + }); + } + + function addRecordingPlay(recordingId, userId) { + return $.ajax({ + url: '/api/recordings/' + recordingId + "/plays", + type: "POST", + data : JSON.stringify({"user_id": userId}), + dataType : 'json', + contentType: 'application/json' + }); + } + function getBand(bandId) { return $.ajax({ type: "GET", @@ -705,6 +754,11 @@ this.getBandFollowing = getBandFollowing; this.getBands = getBands; this.updateSession = updateSession; + this.addSessionComment = addSessionComment; + this.addSessionLike = addSessionLike; + this.addRecordingComment = addRecordingComment; + this.addRecordingLike = addRecordingLike; + this.addRecordingPlay = addRecordingPlay; this.getSession = getSession; this.getClientDownloads = getClientDownloads; this.createInvitation = createInvitation; diff --git a/web/app/controllers/api_music_sessions_controller.rb b/web/app/controllers/api_music_sessions_controller.rb index ecfd62359..cf0aad771 100644 --- a/web/app/controllers/api_music_sessions_controller.rb +++ b/web/app/controllers/api_music_sessions_controller.rb @@ -89,7 +89,6 @@ class ApiMusicSessionsController < ApiController end def participant_create - @connection = MusicSessionManager.new.participant_create( current_user, params[:id], @@ -243,14 +242,17 @@ class ApiMusicSessionsController < ApiController def add_comment if params[:id].blank? render :json => { :message => "Session ID is required" }, :status => 400 + return end if params[:user_id].blank? render :json => { :message => "User ID is required" }, :status => 400 + return end if params[:comment].blank? render :json => { :message => "Comment is required" }, :status => 400 + return end comment = MusicSessionComment.new @@ -262,18 +264,17 @@ class ApiMusicSessionsController < ApiController if comment.errors.any? render :json => { :message => "Unexpected error occurred" }, :status => 500 + return else render :json => {}, :status => 201 + return end end def add_like if params[:id].blank? render :json => { :message => "Session ID is required" }, :status => 400 - end - - if params[:user_id].blank? - render :json => { :message => "User ID is required" }, :status => 400 + return end liker = MusicSessionLiker.new @@ -284,8 +285,10 @@ class ApiMusicSessionsController < ApiController if liker.errors.any? render :json => { :message => "Unexpected error occurred" }, :status => 500 + return else render :json => {}, :status => 201 + return end end diff --git a/web/app/controllers/api_recordings_controller.rb b/web/app/controllers/api_recordings_controller.rb index ce06547c6..1947b7baa 100644 --- a/web/app/controllers/api_recordings_controller.rb +++ b/web/app/controllers/api_recordings_controller.rb @@ -83,14 +83,17 @@ class ApiRecordingsController < ApiController def add_comment if params[:id].blank? render :json => { :message => "Recording ID is required" }, :status => 400 + return end if params[:user_id].blank? render :json => { :message => "User ID is required" }, :status => 400 + return end if params[:comment].blank? render :json => { :message => "Comment is required" }, :status => 400 + return end comment = RecordingComment.new @@ -102,18 +105,17 @@ class ApiRecordingsController < ApiController if comment.errors.any? render :json => { :message => "Unexpected error occurred" }, :status => 500 + return else render :json => {}, :status => 201 + return end end def add_like if params[:id].blank? render :json => { :message => "Recording ID is required" }, :status => 400 - end - - if params[:user_id].blank? - render :json => { :message => "User ID is required" }, :status => 400 + return end liker = RecordingLiker.new @@ -124,18 +126,17 @@ class ApiRecordingsController < ApiController if liker.errors.any? render :json => { :message => "Unexpected error occurred" }, :status => 500 + return else render :json => {}, :status => 201 + return end end def add_play if params[:id].blank? render :json => { :message => "Recording ID is required" }, :status => 400 - end - - if params[:user_id].blank? - render :json => { :message => "User ID is required" }, :status => 400 + return end play = RecordingPlay.new @@ -146,8 +147,10 @@ class ApiRecordingsController < ApiController if play.errors.any? render :json => { :message => "Unexpected error occurred" }, :status => 500 + return else render :json => {}, :status => 201 + return end end diff --git a/web/app/views/music_sessions/show.html.erb b/web/app/views/music_sessions/show.html.erb index 1ba28d42f..2bad9aa50 100644 --- a/web/app/views/music_sessions/show.html.erb +++ b/web/app/views/music_sessions/show.html.erb @@ -27,14 +27,16 @@
      <%= @music_session.created_at.strftime("%b %e %Y, %l:%M %p") %>


      <%= @music_session.description %>

      - + <% if @music_session.session_removed_at.blank? %> + + <% end %>
      - <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> + <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20, :alt => ""} %> <% if @music_session.session_removed_at.blank? %>
      SESSION IN PROGRESS
      1:23
      @@ -45,10 +47,13 @@
      <%= @music_session.genres.split('|').first.capitalize %>
      - <%= @music_session.comment_count %> - <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %>     - <%= @music_session.like_count %> - <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle", :style => "vertical-align:middle"} %> + + <%= @music_session.comment_count %> + <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle", :style => "vertical-align:middle", :alt => ""} %>     + + <%= @music_session.like_count %> + <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle", :style => "vertical-align:middle", :alt => ""} %> +


      @@ -68,9 +73,65 @@ <% content_for :after_black_bar do %>
      - <%= render :partial => "shared/comments", :locals => {:comments => @music_session.comments} %> + <%= render :partial => "shared/comments", :locals => {:comments => @music_session.comments, :id => "txtSessionComment"} %> <% end %> <%= javascript_include_tag "web/sessions" %> <%= render "clients/shareDialog" %> + + diff --git a/web/app/views/recordings/show.html.erb b/web/app/views/recordings/show.html.erb index 60b11a6d7..0bdb1e444 100644 --- a/web/app/views/recordings/show.html.erb +++ b/web/app/views/recordings/show.html.erb @@ -28,17 +28,17 @@

      <%= @claimed_recording.name %>


      <%= @claimed_recording.description %>

      - <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20} %> + <%= image_tag "content/icon_playbutton.png", {:width => 20, :height => 20, :alt => ""} %>
      0:00
      -
      <%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16} %>
      +
      <%= image_tag "content/slider_playcontrols.png", {:width => 5, :height => 16, :alt => ""} %>
      4:59
      @@ -47,12 +47,12 @@
      <%= @claimed_recording.genre_id.capitalize %>
      - <%= @claimed_recording.recording.play_count %> - <%= image_tag "content/icon_arrow.png", {:width => 7, :height => 12, :align => "absmiddle"} %>     - <%= @claimed_recording.recording.comment_count %> - <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle"} %>     - <%= @claimed_recording.recording.like_count %> - <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle"} %> + <%= @claimed_recording.recording.play_count %> + <%= image_tag "content/icon_arrow.png", {:width => 7, :height => 12, :align => "absmiddle", :alt => ""} %>     + <%= @claimed_recording.recording.comment_count %> + <%= image_tag "content/icon_comment.png", {:width => 13, :height => 12, :align => "absmiddle", :alt => ""} %>     + <%= @claimed_recording.recording.like_count %> + <%= image_tag "content/icon_like.png", {:width => 12, :height => 12, :align => "absmiddle", :alt => ""} %>


      @@ -72,9 +72,73 @@ <% content_for :after_black_bar do %>
      - <%= render :partial => "shared/comments", :locals => {:comments => @claimed_recording.recording.comments} %> + <%= render :partial => "shared/comments", :locals => {:comments => @claimed_recording.recording.comments, :id => "txtRecordingComment"} %> <% end %> <%= javascript_include_tag "web/recordings" %> -<%= render "clients/shareDialog" %> \ No newline at end of file +<%= render "clients/shareDialog" %> + + diff --git a/web/app/views/shared/_comments.html.erb b/web/app/views/shared/_comments.html.erb index 955d8baae..1094e747e 100644 --- a/web/app/views/shared/_comments.html.erb +++ b/web/app/views/shared/_comments.html.erb @@ -4,7 +4,7 @@ <%= image_tag "shared/avatar_generic.png", {:alt => ""} %>
      - +

      diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index bd84734bb..aa26582a7 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -48,7 +48,7 @@ SampleApp::Application.configure do config.assets.debug = false # Set the logging destination(s) - # config.log_to = %w[stdout file] + config.log_to = %w[stdout file] # Show the logging configuration on STDOUT config.show_log_configuration = true From 3ad56b41426f355377193502d344e67aec5d48e2 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 28 Jan 2014 10:30:16 -0500 Subject: [PATCH 32/39] fix session bug --- ruby/lib/jam_ruby/models/music_session_comment.rb | 9 +++++++-- ruby/lib/jam_ruby/models/music_session_history.rb | 13 ++++++++++++- ruby/lib/jam_ruby/models/music_session_liker.rb | 9 +++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session_comment.rb b/ruby/lib/jam_ruby/models/music_session_comment.rb index e9d213574..5771bdc30 100644 --- a/ruby/lib/jam_ruby/models/music_session_comment.rb +++ b/ruby/lib/jam_ruby/models/music_session_comment.rb @@ -7,8 +7,13 @@ module JamRuby default_scope order('created_at DESC') - belongs_to :music_session_history, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" - belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "creator_id" + belongs_to(:music_session_history, + :class_name => "JamRuby::MusicSessionHistory", + :foreign_key => "music_session_id") + + belongs_to(:user, + :class_name => "JamRuby::User", + :foreign_key => "creator_id") end end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/music_session_history.rb b/ruby/lib/jam_ruby/models/music_session_history.rb index 0ceca19bf..d1b41016a 100644 --- a/ruby/lib/jam_ruby/models/music_session_history.rb +++ b/ruby/lib/jam_ruby/models/music_session_history.rb @@ -3,7 +3,7 @@ module JamRuby self.table_name = "music_sessions_history" - self.primary_key = 'music_session_id' + self.primary_key = 'id' belongs_to(:user, :class_name => 'JamRuby::User', @@ -130,5 +130,16 @@ module JamRuby .order('created_at DESC') end + def comments + @comments ||= JamRuby::MusicSessionComment + .where(:music_session_id => self.music_session_id) + .order('created_at DESC') + end + + def likes + @likes ||= JamRuby::MusicSessionLiker + .where(:music_session_id => self.music_session_id) + end + end end diff --git a/ruby/lib/jam_ruby/models/music_session_liker.rb b/ruby/lib/jam_ruby/models/music_session_liker.rb index 16ec64372..9b4cb69df 100644 --- a/ruby/lib/jam_ruby/models/music_session_liker.rb +++ b/ruby/lib/jam_ruby/models/music_session_liker.rb @@ -5,8 +5,13 @@ module JamRuby self.primary_key = 'id' - belongs_to :music_session_history, :class_name => "JamRuby::MusicSessionHistory", :foreign_key => "music_session_id" - belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "liker_id" + belongs_to(:music_session_history, + :class_name => "JamRuby::MusicSessionHistory", + :foreign_key => "music_session_id") + + belongs_to(:user, + :class_name => "JamRuby::User", + :foreign_key => "liker_id") end end \ No newline at end of file From 555b53e3c372488acdeadbc5c2d7fdb3966fc2fc Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 28 Jan 2014 10:31:57 -0500 Subject: [PATCH 33/39] format code --- ruby/lib/jam_ruby/models/music_session_comment.rb | 8 ++++---- ruby/lib/jam_ruby/models/music_session_liker.rb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ruby/lib/jam_ruby/models/music_session_comment.rb b/ruby/lib/jam_ruby/models/music_session_comment.rb index 5771bdc30..b23383b33 100644 --- a/ruby/lib/jam_ruby/models/music_session_comment.rb +++ b/ruby/lib/jam_ruby/models/music_session_comment.rb @@ -8,12 +8,12 @@ module JamRuby default_scope order('created_at DESC') belongs_to(:music_session_history, - :class_name => "JamRuby::MusicSessionHistory", - :foreign_key => "music_session_id") + :class_name => "JamRuby::MusicSessionHistory", + :foreign_key => "music_session_id") belongs_to(:user, - :class_name => "JamRuby::User", - :foreign_key => "creator_id") + :class_name => "JamRuby::User", + :foreign_key => "creator_id") end end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/music_session_liker.rb b/ruby/lib/jam_ruby/models/music_session_liker.rb index 9b4cb69df..538822c6e 100644 --- a/ruby/lib/jam_ruby/models/music_session_liker.rb +++ b/ruby/lib/jam_ruby/models/music_session_liker.rb @@ -6,12 +6,12 @@ module JamRuby self.primary_key = 'id' belongs_to(:music_session_history, - :class_name => "JamRuby::MusicSessionHistory", - :foreign_key => "music_session_id") + :class_name => "JamRuby::MusicSessionHistory", + :foreign_key => "music_session_id") belongs_to(:user, - :class_name => "JamRuby::User", - :foreign_key => "liker_id") + :class_name => "JamRuby::User", + :foreign_key => "liker_id") end end \ No newline at end of file From 38a8ca08bcdc7b870fd0536fd5d37430f3bce1d5 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Jan 2014 10:59:14 -0600 Subject: [PATCH 34/39] * renabling logging --- web/config/environments/development.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/config/environments/development.rb b/web/config/environments/development.rb index bd84734bb..aa26582a7 100644 --- a/web/config/environments/development.rb +++ b/web/config/environments/development.rb @@ -48,7 +48,7 @@ SampleApp::Application.configure do config.assets.debug = false # Set the logging destination(s) - # config.log_to = %w[stdout file] + config.log_to = %w[stdout file] # Show the logging configuration on STDOUT config.show_log_configuration = true From 873037101c41ffc2d5d34383d4f9713dfb58dd0e Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Jan 2014 11:04:42 -0600 Subject: [PATCH 35/39] * removing errant m VRFS-1027 --- 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 50828ba03..ca54d4010 100644 --- a/web/app/views/clients/_profile.html.erb +++ b/web/app/views/clients/_profile.html.erb @@ -1,4 +1,4 @@ -m +
      From 3d453468f28966e15e10a19989087d3d6f92ca62 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Jan 2014 13:24:34 -0600 Subject: [PATCH 36/39] * adding ability to run everything within jam-web for jobs --- .../resque/scheduled/icecast_source_check.rb | 3 --- web/config/initializers/resque.rb | 14 +++++++++++++- web/config/routes.rb | 9 +++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb b/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb index d832f4d2d..d17320cb4 100644 --- a/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb +++ b/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb @@ -11,13 +11,10 @@ module JamRuby class IcecastSourceCheck extend Resque::Plugins::LonelyJob - @queue = :icecast_source_check - @@log = Logging.logger[IcecastSourceCheck] - def self.perform @@log.debug("waking up") diff --git a/web/config/initializers/resque.rb b/web/config/initializers/resque.rb index 5c3c402fc..5077fea0f 100644 --- a/web/config/initializers/resque.rb +++ b/web/config/initializers/resque.rb @@ -1 +1,13 @@ -Resque.redis = Rails.application.config.redis_host \ No newline at end of file +Resque.redis = Rails.application.config.redis_host + + +if !$rails_rake_task && Rails.env == 'development' && ENV['RUN_JOBS_INLINE'] == '1' + + Thread.new do + system('INTERVAL=1 bundle exec rake all_jobs') + end + + Thread.new do + system('bundle exec rake scheduler') + end +end \ No newline at end of file diff --git a/web/config/routes.rb b/web/config/routes.rb index dc7a1cfcd..1a77090a3 100644 --- a/web/config/routes.rb +++ b/web/config/routes.rb @@ -71,6 +71,14 @@ SampleApp::Application.routes.draw do # email update match '/confirm_email' => 'users#finalize_update_email', :as => 'confirm_email' # NOTE: if you change this, you break outstanding email changes because links in user inboxes are broken + # embed resque-web if this is development mode + if Rails.env == "development" + require 'resque/server' + require 'resque-retry' + require 'resque-retry/server' + mount Resque::Server.new, :at => "/resque" if Rails.env == "development" + end + scope '/corp' do match '/about', to: 'corps#about', as: 'corp_about' match '/contact', to: 'corps#contact', as: 'corp_contact' @@ -324,4 +332,5 @@ SampleApp::Application.routes.draw do match '/icecast/listener_add' => 'api_icecast#listener_add', :via => :post match '/icecast/listener_remove' => 'api_icecast#listener_remove', :via => :post end + end From 55850ae602edb28b045d6c098edf8dc18cf535d4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Jan 2014 13:26:11 -0600 Subject: [PATCH 37/39] * adding ability to run everything within jam-web for jobs --- runadmin | 6 ++++++ runjobs | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100755 runadmin create mode 100755 runjobs diff --git a/runadmin b/runadmin new file mode 100755 index 000000000..648a2a9ac --- /dev/null +++ b/runadmin @@ -0,0 +1,6 @@ +#!/bin/bash + +pushd admin +# run jam-admin rails server +bundle exec rails s +popd diff --git a/runjobs b/runjobs new file mode 100755 index 000000000..babe280ff --- /dev/null +++ b/runjobs @@ -0,0 +1,6 @@ +#!/bin/bash + +pushd web +# run all_jobs rake task; this waits on new jobs from the resque queue, i.e., audiomixer, icecast, etc +bundle exec rake all_jobs +popd From 3903822ca5912f86227c8bcd55b74cb6188a5521 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 29 Jan 2014 14:33:47 -0600 Subject: [PATCH 38/39] * overriding lock timeout for LonelyJobs --- .../jam_ruby/resque/icecast_config_writer.rb | 5 +++ .../resque/scheduled/IcecastSourceCheck.rb | 32 ------------------- .../resque/scheduled/audiomixer_retry.rb | 6 ++++ .../resque/scheduled/icecast_config_retry.rb | 6 ++++ .../resque/scheduled/icecast_source_check.rb | 6 ++++ 5 files changed, 23 insertions(+), 32 deletions(-) delete mode 100644 ruby/lib/jam_ruby/resque/scheduled/IcecastSourceCheck.rb diff --git a/ruby/lib/jam_ruby/resque/icecast_config_writer.rb b/ruby/lib/jam_ruby/resque/icecast_config_writer.rb index bbecffa29..a02761e7b 100644 --- a/ruby/lib/jam_ruby/resque/icecast_config_writer.rb +++ b/ruby/lib/jam_ruby/resque/icecast_config_writer.rb @@ -30,6 +30,11 @@ module JamRuby "icecast-#{server_id}" end + def self.lock_timeout + # this should be enough time to make sure the job has finished, but not so long that the system isn't recovering from a abandoned job + 60 + end + def self.perform(icecast_server_id) icecast = IcecastConfigWriter.new() icecast.icecast_server_id = icecast_server_id diff --git a/ruby/lib/jam_ruby/resque/scheduled/IcecastSourceCheck.rb b/ruby/lib/jam_ruby/resque/scheduled/IcecastSourceCheck.rb deleted file mode 100644 index 4d1577637..000000000 --- a/ruby/lib/jam_ruby/resque/scheduled/IcecastSourceCheck.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'json' -require 'resque' -require 'resque-retry' -require 'net/http' -require 'digest/md5' - -module JamRuby - - # http://blog.bignerdranch.com/1643-never-use-resque-for-serial-jobs/ - # periodically scheduled to find sources that need to be brought down, or alternatively, it seems the client failed to start sourcing - class IcecastSourceCheck - - @queue = :icecast_source_check - - @@log = Logging.logger[IcecastSourceCheck] - - def self.perform - @@log.debug("waking up") - - # if we haven't seen updated_at be tickled in 5 minutes, but config_changed is still set to TRUE, this record has gotten stale - IcecastMount.find_each(:conditions => "sourced_needs_changing_at < (NOW() - interval '#{APP_CONFIG.icecast_max_sourced_changed} second')", :batch_size => 100) do |server| - server.with_lock do - IcecastConfigWriter.enqueue(server.server_id) - end - - end - - @@log.debug("done") - end - end - -end \ No newline at end of file diff --git a/ruby/lib/jam_ruby/resque/scheduled/audiomixer_retry.rb b/ruby/lib/jam_ruby/resque/scheduled/audiomixer_retry.rb index 34e7571cb..7b9b338c9 100644 --- a/ruby/lib/jam_ruby/resque/scheduled/audiomixer_retry.rb +++ b/ruby/lib/jam_ruby/resque/scheduled/audiomixer_retry.rb @@ -8,11 +8,17 @@ module JamRuby # periodically scheduled to find jobs that need retrying class AudioMixerRetry + extend Resque::Plugins::LonelyJob @queue = :audiomixer_retry @@log = Logging.logger[AudioMixerRetry] + def self.lock_timeout + # this should be enough time to make sure the job has finished, but not so long that the system isn't recovering from a abandoned job + 120 + end + def self.perform AudioMixer.queue_jobs_needing_retry end diff --git a/ruby/lib/jam_ruby/resque/scheduled/icecast_config_retry.rb b/ruby/lib/jam_ruby/resque/scheduled/icecast_config_retry.rb index 340e9a05f..cbc7c6209 100644 --- a/ruby/lib/jam_ruby/resque/scheduled/icecast_config_retry.rb +++ b/ruby/lib/jam_ruby/resque/scheduled/icecast_config_retry.rb @@ -8,11 +8,17 @@ module JamRuby # periodically scheduled to find jobs that need retrying class IcecastConfigRetry + extend Resque::Plugins::LonelyJob @queue = :icecast_config_retry @@log = Logging.logger[IcecastConfigRetry] + def self.lock_timeout + # this should be enough time to make sure the job has finished, but not so long that the system isn't recovering from a abandoned job + 120 + end + def self.perform @@log.debug("waking up") diff --git a/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb b/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb index d17320cb4..236c6814e 100644 --- a/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb +++ b/ruby/lib/jam_ruby/resque/scheduled/icecast_source_check.rb @@ -15,6 +15,11 @@ module JamRuby @@log = Logging.logger[IcecastSourceCheck] + def self.lock_timeout + # this should be enough time to make sure the job has finished, but not so long that the system isn't recovering from a abandoned job + 120 + end + def self.perform @@log.debug("waking up") @@ -25,6 +30,7 @@ module JamRuby @@log.debug("done") end + def run # if we haven't seen updated_at be tickled in 5 minutes, but config_changed is still set to TRUE, this record has gotten stale IcecastMount.find_each(lock: true, :conditions => "sourced_needs_changing_at < (NOW() - interval '#{APP_CONFIG.icecast_max_sourced_changed} second')", :batch_size => 100) do |mount| if mount.music_session_id From b457babf7973ef14944cdd4f512943c1f2f95887 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Wed, 29 Jan 2014 21:37:36 -0500 Subject: [PATCH 39/39] VRFS-1020 share dialog work --- web/app/assets/javascripts/shareDialog.js | 6 +++++- web/app/views/clients/_session.html.erb | 2 +- web/app/views/music_sessions/show.html.erb | 6 +++++- web/app/views/recordings/show.html.erb | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/web/app/assets/javascripts/shareDialog.js b/web/app/assets/javascripts/shareDialog.js index ddf0640ce..dff0ce41b 100644 --- a/web/app/assets/javascripts/shareDialog.js +++ b/web/app/assets/javascripts/shareDialog.js @@ -10,6 +10,10 @@ } + function showDialog() { + app.layout.showDialog('share-dialog'); + } + /*function showEmailDialog() { $('#invitation-dialog').show(); $('#invitation-textarea-container').show(); @@ -94,8 +98,8 @@ app.bindDialog('shareSessionRecording', dialogBindings); }; - this.initialize = initialize; + this.showDialog = showDialog; } return this; diff --git a/web/app/views/clients/_session.html.erb b/web/app/views/clients/_session.html.erb index 43085a35b..82a24976a 100644 --- a/web/app/views/clients/_session.html.erb +++ b/web/app/views/clients/_session.html.erb @@ -137,7 +137,7 @@ <%= render "addNewGear" %> <%= render "error" %> <%= render "sessionSettings" %> -<%= render "shareDialog" %> +<%= render :partial => "shareDialog", :locals => {} %>