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 000000000..9ec7ebb66 Binary files /dev/null and b/web/app/assets/images/content/icon_like.png differ 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" %>
-