Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Seth Call 2014-11-02 13:16:12 -06:00
commit e654aba980
25 changed files with 171 additions and 148 deletions

View File

@ -10,6 +10,7 @@ module JamRuby
TYPE_FILTERS = ['music_session', 'recording', 'all']
def self.index(user, params = {})
limit = params[:limit]
limit ||= 20
limit = limit.to_i
@ -19,13 +20,13 @@ module JamRuby
sort ||= 'date'
raise "not valid sort #{sort}" unless SORT_TYPES.include?(sort)
start = params[:start].presence
if sort == 'date'
start ||= FIXNUM_MAX
else
start ||= 0
end
start = start.to_i
# start = params[:start].presence
# if sort == 'date'
# start ||= FIXNUM_MAX
# else
# start ||= 0
# end
# start = start.to_i
time_range = params[:time_range]
time_range ||= 'all'
@ -46,13 +47,13 @@ module JamRuby
# handle sort
if sort == 'date'
query = query.where("feeds.id < #{start}")
# query = query.where("feeds.id < #{start}")
query = query.order('feeds.active DESC, feeds.id DESC')
elsif sort == 'plays'
query = query.offset(start)
# query = query.offset(start)
query = query.order("feeds.active DESC, COALESCE(recordings.play_count, music_sessions.play_count) DESC")
elsif sort == 'likes'
query = query.offset(start)
# query = query.offset(start)
query = query.order("feeds.active DESC, COALESCE(recordings.like_count, music_sessions.like_count) DESC")
else
raise "sort not implemented: #{sort}"
@ -73,7 +74,6 @@ module JamRuby
if target_user
query = query.joins("LEFT OUTER JOIN claimed_recordings ON recordings.id = claimed_recordings.recording_id AND claimed_recordings.discarded = FALSE AND (claimed_recordings.user_id = '#{target_user}' OR (recordings.band_id IN (SELECT band_id FROM bands_musicians where user_id='#{target_user}')))")
query = query.joins("LEFT OUTER JOIN music_sessions_user_history ON music_sessions.id = music_sessions_user_history.music_session_id AND music_sessions_user_history.user_id = '#{target_user}'")
query = query.group("feeds.id, feeds.recording_id, feeds.music_session_id, feeds.created_at, feeds.updated_at, recordings.id, music_sessions.id")
@ -110,17 +110,19 @@ module JamRuby
query = query.where('music_sessions.id is NULL OR music_sessions_user_history.id IS NOT NULL')
end
current_page = params[:next_page].nil? ? 1 : params[:next_page].to_i
next_page = current_page + 1
# will_paginate gem
query = query.paginate(:page => current_page, :per_page => limit)
if params[:hash]
if query.length == 0
{ query:query, next: nil}
{ query: query, next_page: nil}
elsif query.length < limit
{ query:query, next: nil}
{ query: query, next_page: nil}
else
if sort == 'date'
{ query:query, next: query.last.id}
else
{ query:query, next: start + limit}
end
{ query: query, next_page: next_page }
end
else
if query.length == 0
@ -128,11 +130,7 @@ module JamRuby
elsif query.length < limit
[query, nil]
else
if sort == 'date'
[query, query.last.id]
else
[query, start + limit]
end
[query, next_page]
end
end
end

View File

@ -9,7 +9,7 @@ describe Feed do
let (:band) { FactoryGirl.create(:band) }
it "no result" do
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 0
end
@ -17,7 +17,7 @@ describe Feed do
claimed_recording = FactoryGirl.create(:claimed_recording)
MusicSessionUserHistory.delete_all # the factory makes a music_session while making the recording/claimed_recording
MusicSession.delete_all # the factory makes a music_session while making the recording/claimed_recording
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 1
feeds[0].recording == claimed_recording.recording
end
@ -33,13 +33,13 @@ describe Feed do
# verify the mess above only made one recording
Recording.count.should == 1
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 1
end
it "one music session" do
music_session = FactoryGirl.create(:active_music_session)
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 1
feeds[0].music_session == music_session.music_session
end
@ -49,7 +49,7 @@ describe Feed do
MusicSessionUserHistory.delete_all # the factory makes a music_session while making the recording/claimed_recording
MusicSession.delete_all
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 0
end
@ -57,7 +57,7 @@ describe Feed do
it "sorts by active flag / index (date) DESC" do
claimed_recording = FactoryGirl.create(:claimed_recording)
feeds, start = Feed.index(user1)
feeds, next_page = Feed.index(user1)
feeds.length.should == 2
feeds[1].recording.should == claimed_recording.recording
feeds[0].music_session.should == claimed_recording.recording.music_session.music_session
@ -69,13 +69,13 @@ describe Feed do
FactoryGirl.create(:playable_play, playable: claimed_recording1.recording, claimed_recording: claimed_recording1, user:claimed_recording1.user)
feeds, start = Feed.index(user1, :sort => 'plays')
feeds, next_page = Feed.index(user1, :sort => 'plays')
feeds.length.should == 4
FactoryGirl.create(:playable_play, playable: claimed_recording2.recording, claimed_recording: claimed_recording2, user:claimed_recording1.user)
FactoryGirl.create(:playable_play, playable: claimed_recording2.recording, claimed_recording: claimed_recording2, user:claimed_recording2.user)
feeds, start = Feed.index(user1, :sort => 'plays')
feeds, next_page = Feed.index(user1, :sort => 'plays')
feeds.length.should == 4
feeds[2].recording.should == claimed_recording2.recording
feeds[3].recording.should == claimed_recording1.recording
@ -85,7 +85,7 @@ describe Feed do
FactoryGirl.create(:playable_play, playable: claimed_recording1.recording.music_session.music_session, user: user3)
feeds, start = Feed.index(user1, :sort => 'plays')
feeds, next_page = Feed.index(user1, :sort => 'plays')
feeds.length.should == 4
feeds[0].music_session.should == claimed_recording1.recording.music_session.music_session
feeds[2].recording.should == claimed_recording2.recording
@ -98,13 +98,13 @@ describe Feed do
FactoryGirl.create(:recording_like, recording: claimed_recording1.recording, claimed_recording: claimed_recording1, user:claimed_recording1.user)
feeds, start = Feed.index(user1, :sort => 'likes')
feeds, next_page = Feed.index(user1, :sort => 'likes')
feeds.length.should == 4
FactoryGirl.create(:recording_like, recording: claimed_recording2.recording, claimed_recording: claimed_recording2, user:claimed_recording1.user)
FactoryGirl.create(:recording_like, recording: claimed_recording2.recording, claimed_recording: claimed_recording2, user:claimed_recording2.user)
feeds, start = Feed.index(user1, :sort => 'likes')
feeds, next_page = Feed.index(user1, :sort => 'likes')
feeds.length.should == 4
feeds = feeds.where("feeds.music_session_id is null")
feeds[0].recording.should == claimed_recording2.recording
@ -114,7 +114,7 @@ describe Feed do
FactoryGirl.create(:music_session_like, music_session: claimed_recording1.recording.music_session.music_session, user: user2)
FactoryGirl.create(:music_session_like, music_session: claimed_recording1.recording.music_session.music_session, user: user3)
feeds, start = Feed.index(user1, :sort => 'likes')
feeds, next_page = Feed.index(user1, :sort => 'likes')
feeds.length.should == 4
feeds[0].music_session.should == claimed_recording1.recording.music_session.music_session
feeds[2].recording.should == claimed_recording2.recording
@ -127,7 +127,7 @@ describe Feed do
# creates both recording and history record in feed
claimed_recording1 = FactoryGirl.create(:claimed_recording)
feeds, start = Feed.index(user1, :type => 'music_session')
feeds, next_page = Feed.index(user1, :type => 'music_session')
feeds.length.should == 1
feeds[0].music_session == claimed_recording1.recording.music_session.music_session
end
@ -136,7 +136,7 @@ describe Feed do
# creates both recording and history record in feed
claimed_recording1 = FactoryGirl.create(:claimed_recording)
feeds, start = Feed.index(user1, :type => 'music_session')
feeds, next_page = Feed.index(user1, :type => 'music_session')
feeds.length.should == 1
feeds[0].music_session == claimed_recording1.recording.music_session.music_session
end
@ -151,7 +151,7 @@ describe Feed do
claimed_recording1.recording.feed.created_at = 32.days.ago
claimed_recording1.recording.feed.save!
feeds, start = Feed.index(user1, :type => 'recording', time_range: 'month')
feeds, next_page = Feed.index(user1, :type => 'recording', time_range: 'month')
feeds.length.should == 0
end
@ -163,7 +163,7 @@ describe Feed do
claimed_recording1.recording.feed.created_at = 48.hours.ago
claimed_recording1.recording.feed.save!
feeds, start = Feed.index(user1, :type => 'recording', time_range: 'today')
feeds, next_page = Feed.index(user1, :type => 'recording', time_range: 'today')
feeds.length.should == 0
end
@ -175,7 +175,7 @@ describe Feed do
claimed_recording1.recording.feed.created_at = 8.days.ago
claimed_recording1.recording.feed.save!
feeds, start = Feed.index(user1, :type => 'recording', time_range: 'week')
feeds, next_page = Feed.index(user1, :type => 'recording', time_range: 'week')
feeds.length.should == 0
end
@ -187,7 +187,7 @@ describe Feed do
claimed_recording1.recording.feed.created_at = 700.days.ago
claimed_recording1.recording.feed.save!
feeds, start = Feed.index(user1, :type => 'recording', time_range: 'all')
feeds, next_page = Feed.index(user1, :type => 'recording', time_range: 'all')
feeds.length.should == 1
end
end
@ -200,19 +200,21 @@ describe Feed do
ams.before_destroy
options = {limit: 1}
feeds, start = Feed.index(user1, options)
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording.recording
next_page.should == 2
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].music_session.should == claimed_recording.recording.music_session.music_session
next_page.should == 3
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 0
start.should be_nil
next_page.should be_nil
end
it "supports likes pagination" do
@ -221,19 +223,21 @@ describe Feed do
FactoryGirl.create(:music_session_like, music_session: claimed_recording1.recording.music_session.music_session, user: user1)
options = {limit: 1, sort: 'likes'}
feeds, start = Feed.index(user1, options)
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].music_session.should == claimed_recording1.recording.music_session.music_session
next_page.should == 2
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
next_page.should == 3
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 0
start.should be_nil
next_page.should be_nil
end
it "supports plays pagination" do
@ -242,19 +246,21 @@ describe Feed do
FactoryGirl.create(:playable_play, playable: claimed_recording1.recording.music_session.music_session, user: user1)
options = {limit: 1, sort: 'plays'}
feeds, start = Feed.index(user1, options)
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].music_session.should == claimed_recording1.recording.music_session.music_session
next_page.should == 2
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
next_page.should == 3
options[:start] = start
feeds, start = Feed.index(user1, options)
options[:next_page] = next_page
feeds, next_page = Feed.index(user1, options)
feeds.length.should == 0
start.should be_nil
next_page.should be_nil
end
end
@ -264,13 +270,13 @@ describe Feed do
claimed_recording1.is_public = false
claimed_recording1.save!
feeds, start = Feed.index(claimed_recording1.user)
feeds, next_page = Feed.index(claimed_recording1.user)
feeds.length.should == 1
claimed_recording1.recording.music_session.music_session.fan_access = false
claimed_recording1.recording.music_session.music_session.save!
feeds, start = Feed.index(claimed_recording1.user)
feeds, next_page = Feed.index(claimed_recording1.user)
feeds.length.should == 1
end
end
@ -287,7 +293,7 @@ describe Feed do
claimed_recording1.recording.save!
claimed_recording1.save!
feeds, start = Feed.index(user1, band: band.id)
feeds, next_page = Feed.index(user1, band: band.id)
feeds.length.should == 0
end
@ -297,11 +303,11 @@ describe Feed do
music_session = FactoryGirl.create(:active_music_session, band: band)
music_session.music_session.fan_access.should be_true
feeds, start = Feed.index(user1, band: band.id)
feeds, next_page = Feed.index(user1, band: band.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
feeds, start = Feed.index(user2, band: band.id)
feeds, next_page = Feed.index(user2, band: band.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
end
@ -312,13 +318,13 @@ describe Feed do
music_session = FactoryGirl.create(:active_music_session, band: band, fan_access: false)
music_session.music_session.fan_access.should be_false
feeds, start = Feed.index(user1, band: band.id)
feeds, next_page = Feed.index(user1, band: band.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
feeds[0].music_session.fan_access.should be_false
feeds, start = Feed.index(user2, band: band.id)
feeds, next_page = Feed.index(user2, band: band.id)
feeds.length.should == 1
end
@ -329,11 +335,11 @@ describe Feed do
claimed_recording1.recording.save!
claimed_recording1.save!
feeds, start = Feed.index(claimed_recording1.user, band: band.id)
feeds, next_page = Feed.index(claimed_recording1.user, band: band.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
feeds, start = Feed.index(user1, band: band.id)
feeds, next_page = Feed.index(user1, band: band.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
end
@ -348,11 +354,11 @@ describe Feed do
claimed_recording1.user.bands << band
claimed_recording1.user.save!
feeds, start = Feed.index(claimed_recording1.user, band: band.id)
feeds, next_page = Feed.index(claimed_recording1.user, band: band.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
feeds, start = Feed.index(user1, band: band.id)
feeds, next_page = Feed.index(user1, band: band.id)
feeds.length.should == 1
end
end
@ -366,7 +372,7 @@ describe Feed do
claimed_recording1.is_public = true
claimed_recording1.save!
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 0
end
@ -374,11 +380,11 @@ describe Feed do
music_session = FactoryGirl.create(:active_music_session)
FactoryGirl.create(:music_session_user_history, :history => music_session.music_session, :user => user1)
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
feeds, start = Feed.index(user2, user: user1.id)
feeds, next_page = Feed.index(user2, user: user1.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
end
@ -389,13 +395,13 @@ describe Feed do
music_session.music_session.fan_access.should be_false
FactoryGirl.create(:music_session_user_history, :history => music_session.music_session, :user => user1)
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 1
feeds[0].music_session.should == music_session.music_session
feeds[0].music_session.fan_access.should be_false
feeds, start = Feed.index(user2, user: user1.id)
feeds, next_page = Feed.index(user2, user: user1.id)
feeds.length.should == 1
end
@ -404,11 +410,11 @@ describe Feed do
claimed_recording1.is_public = true
claimed_recording1.save!
feeds, start = Feed.index(claimed_recording1.user, user: claimed_recording1.user.id)
feeds, next_page = Feed.index(claimed_recording1.user, user: claimed_recording1.user.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
feeds, start = Feed.index(user1, user: claimed_recording1.user.id)
feeds, next_page = Feed.index(user1, user: claimed_recording1.user.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
end
@ -418,11 +424,11 @@ describe Feed do
claimed_recording1.is_public = false
claimed_recording1.save!
feeds, start = Feed.index(claimed_recording1.user, user: claimed_recording1.user.id)
feeds, next_page = Feed.index(claimed_recording1.user, user: claimed_recording1.user.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1.recording
feeds, start = Feed.index(user1, user: claimed_recording1.user.id)
feeds, next_page = Feed.index(user1, user: claimed_recording1.user.id)
feeds.length.should == 1
end
@ -438,7 +444,7 @@ describe Feed do
claimed_recording1.recording.save!
claimed_recording1.save!
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1 .recording
@ -446,14 +452,14 @@ describe Feed do
claimed_recording1.is_public = false
claimed_recording1.save!
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 1
feeds[0].recording.should == claimed_recording1 .recording
# take user1 out of the band; shouldn't be able to see it
user1.bands.delete_all
feeds, start = Feed.index(user1, user: user1.id)
feeds, next_page = Feed.index(user1, user: user1.id)
feeds.length.should == 0
end
end

View File

@ -13,7 +13,6 @@
var userId = null;
var currentFeedPage = 0;
var feedBatchSize = 10;
var $next = null;
var $screen = null;
var $scroller = null;
var $content = null;
@ -21,15 +20,15 @@
var $refresh = null;
var $sortFeedBy = null;
var $includeDate = null;
var next = null;
var nextPage = null;
var $includeType = null;
var didLoadAllFeeds = false, isLoading = false;
function defaultQuery() {
var query = { limit: feedBatchSize };
if(next) {
query.since = next;
if(nextPage) {
query.next_page = nextPage;
}
if(userId) {
query.user = userId;
@ -54,15 +53,15 @@
currentFeedPage = 0;
$content.empty(); // TODO: do we need to delete audio elements?
$noMoreFeeds.hide();
next = null;
nextPage = null;
}
function handleFeedResponse(response) {
next = response.next;
nextPage = response.next_page;
renderFeeds(response);
if(response.next == null) {
didLoadAllFeeds = true;
if(nextPage == null) {
didLoadAllFeeds = true;
// if we less results than asked for, end searching
logger.debug("end of feeds")

View File

@ -10,6 +10,9 @@
var instrument_logo_map = context.JK.getInstrumentIconMap24();
var did_show_band_page = false;
var page_num=1, page_count=0;
var helpBubble = context.JK.HelpBubbleHelper;
var $screen = $('#bands-screen');
var $results = $screen.find('#band-filter-results');
function loadBands(queryString) {
// squelch nulls and undefines
@ -91,15 +94,18 @@
players = '';
playerVals = {};
for (var jj=0, ilen=bb['players'].length; jj<ilen; jj++) {
var toolTip = '';
aPlayer = bb['players'][jj];
var player_instrs = '';
var iter_pinstruments = aPlayer['instruments'].split(',');
for (var kk=0, klen=iter_pinstruments.length; kk<klen; kk++) {
var pinstr = iter_pinstruments[kk];
var toolTip = '';
if (pinstr in instrument_logo_map) {
instr = instrument_logo_map[pinstr].asset;
toolTip = pinstr;
}
player_instrs += '<img src="' + instr + '"/>';
player_instrs += '<img src="' + instr + '" title="' + toolTip + '"/>';
}
playerVals = {
@ -143,11 +149,18 @@
band_action_template: band_actions
};
var band_row = context.JK.fillTemplate(mTemplate, bVals);
renderings += band_row;
}
var $rendering = $(context.JK.fillTemplate(mTemplate, bVals))
$('#band-filter-results').append(renderings);
var $offsetParent = $results.closest('.content');
var data = {entity_type: 'band'};
var options = {positions: ['top', 'bottom', 'right', 'left'], offsetParent: $offsetParent};
context.JK.helpBubble($('.follower-count', $rendering), 'follower-count', data, options);
context.JK.helpBubble($('.recording-count', $rendering), 'recording-count', data, options);
context.JK.helpBubble($('.session-count', $rendering), 'session-count', data, options);
$results.append($rendering);
}
$('.search-m-follow').on('click', followBand);
context.JK.bindHoverEvents();

View File

@ -196,10 +196,12 @@
}
instr_logos = '';
for (var jj = 0, ilen = musician['instruments'].length; jj < ilen; jj++) {
var toolTip = '';
if (musician['instruments'][jj].instrument_id in instrument_logo_map) {
instr = instrument_logo_map[musician['instruments'][jj].instrument_id].asset;
toolTip = musician['instruments'][jj].instrument_id;
}
instr_logos += '<img src="' + instr + '"/>';
instr_logos += '<img src="' + instr + '" title="' + toolTip + '"/>';
}
var actionVals = {
profile_url: "/client#/profile/" + musician.id,
@ -238,12 +240,14 @@
var $rendering = $(context.JK.fillTemplate(mTemplate, mVals))
var $offsetParent = $results.closest('.content');
var data = {entity_type: 'musician'};
var options = {positions: ['top', 'bottom', 'right', 'left'], offsetParent: $offsetParent};
var scoreOptions = {offsetParent: $offsetParent};
context.JK.helpBubble($('.follower-count', $rendering), 'musician-follower-count', {}, options);
context.JK.helpBubble($('.friend-count', $rendering), 'musician-friend-count', {}, options);
context.JK.helpBubble($('.recording-count', $rendering), 'musician-recording-count', {}, options);
context.JK.helpBubble($('.session-count', $rendering), 'musician-session-count', {}, options);
context.JK.helpBubble($('.follower-count', $rendering), 'follower-count', data, options);
context.JK.helpBubble($('.friend-count', $rendering), 'friend-count', data, options);
context.JK.helpBubble($('.recording-count', $rendering), 'recording-count', data, options);
context.JK.helpBubble($('.session-count', $rendering), 'session-count', data, options);
helpBubble.scoreBreakdown($('.latency', $rendering), false, musician['full_score'], myAudioLatency, musician['audio_latency'], musician['score'], scoreOptions);
$results.append($rendering);

View File

@ -38,7 +38,7 @@
instrumentHtml = '<td><div class="nowrap">';
if (val.instruments) { // @FIXME: edge case for Test user that has no instruments?
$.each(val.instruments, function(index, instrument) {
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument.instrument_id) + '" width="24" height="24" />&nbsp;';
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument.instrument_id) + '" title="' + instrument.instrument_id + '" width="24" height="24" />&nbsp;';
});
}

View File

@ -35,7 +35,7 @@
// instruments
var instrumentHtml = '';
$.each(response.instruments, function(index, val) {
instrumentHtml += '<div class="left mr10 mb"><img src="' + context.JK.getInstrumentIcon24(val.instrument_id) + '" width="24" height="24" /></div>';
instrumentHtml += '<div class="left mr10 mb"><img src="' + context.JK.getInstrumentIcon24(val.instrument_id) + '" title="' + val.instrument_id + '" width="24" height="24" /></div>';
});
// followings

View File

@ -619,10 +619,12 @@
for (var j = 0; j < musician.instruments.length; j++) {
var instrument = musician.instruments[j];
var inst = '/assets/content/icon_instrument_default24.png';
var toolTip = '';
if (instrument.instrument_id in instrument_logo_map) {
inst = instrument_logo_map[instrument.instrument_id].asset;
toolTip = instrument.instrument_id;
}
instrumentLogoHtml += '<img src="' + inst + '" width="24" height="24" />&nbsp;';
instrumentLogoHtml += '<img src="' + inst + '" title="' + toolTip + '" width="24" height="24" />&nbsp;';
}
}
// this template is in _findSession.html.erb
@ -632,7 +634,8 @@
avatar_url: context.JK.resolveAvatarUrl(musician.photo_url),
profile_url: "/client#/profile/" + musician.id,
musician_name: musician.name,
instruments: instrumentLogoHtml
instruments: instrumentLogoHtml,
more_link: ''
});
}
}

View File

@ -110,10 +110,10 @@
*/
context.JK.helpBubble = function ($element, templateName, data, options) {
if (!data) {
data = {}
data = {};
}
if(!options) {
options = {}
options = {};
}
$element.on('remove', function() {
@ -123,7 +123,7 @@
var holder = null;
if (context._.isFunction(templateName)) {
holder = function wrapper() {
return context.JK.helpBubbleFunctionHelper.apply(this, [templateName])
return context.JK.helpBubbleFunctionHelper.apply(this, [templateName]);
}
}
else {

View File

@ -4,7 +4,7 @@ class ApiFeedsController < ApiController
def index
data = Feed.index(current_user,
start: params[:since],
next_page: params[:next_page],
limit: params[:limit],
sort: params[:sort],
time_range: params[:time_range],
@ -15,7 +15,7 @@ class ApiFeedsController < ApiController
@feeds = data[:query]
@next = data[:next]
@next = data[:next_page]
render "api_feeds/index", :layout => nil
end
end

View File

@ -1,4 +1,4 @@
node :next do |page|
node :next_page do |page|
@next
end

View File

@ -104,10 +104,10 @@
</div>
<div class="button-row">
<div class="lcol stats left">
{friend_count} <img src="../assets/content/icon_friend.png" width="22" height="12" align="absmiddle" />
{follower_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />
{recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />
{session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
{friend_count} <img src="../assets/content/icon_friend.png" title="friends" width="22" height="12" align="absmiddle" />
{follower_count} <img src="../assets/content/icon_followers.png" title="followers" width="22" height="12" align="absmiddle" />
{recording_count} <img src="../assets/content/icon_recordings.png" title="recordings" width="12" height="13" align="absmiddle" />
{session_count} <img src="../assets/content/icon_session_tiny.png" title="sessions" width="12" height="12" align="absmiddle" />
</div>
<div class="result-list-button-wrapper">
<a class="button-orange smallbutton" href="{profile_url}">PROFILE</a>

View File

@ -1,5 +1,5 @@
<!-- Band Screen -->
<%= content_tag(:div, :layout => 'screen', 'layout-id' => 'bands', :class => "screen secondary") do -%>
<%= content_tag(:div, :layout => 'screen', 'layout-id' => 'bands', :class => "screen secondary", :id => "bands-screen") do -%>
<%= content_tag(:div, :class => :content) do -%>
<%= content_tag(:div, :class => 'content-head') do -%>
<%= content_tag(:div, image_tag("content/icon_bands.png", {:height => 19, :width => 19}), :class => 'content-icon') %>
@ -46,9 +46,9 @@
</div>
<div class="button-row">
<div class="lcol stats left">
{follow_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" style="margin-right:4px;"/>
{recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" style="margin-right:4px;"/>
{session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
<span class="follower-count">{follow_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" style="margin-right:4px;"/></span>
<span class="recording-count">{recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" style="margin-right:4px;"/></span>
<span class="session-count">{session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" /></span>
</div>
<div class="result-list-button-wrapper" data-band-id={band_id}>
{band_action_template}

View File

@ -42,20 +42,20 @@
To be a valid output audio device, it must have at least 2 output ports.
</script>
<script type="text/template" id="template-help-musician-follower-count">
The number of followers that this user has.
<script type="text/template" id="template-help-follower-count">
The number of followers that this {{data.entity_type}} has.
</script>
<script type="text/template" id="template-help-musician-friend-count">
The number of friends that this user has.
<script type="text/template" id="template-help-friend-count">
The number of friends that this {{data.entity_type}} has.
</script>
<script type="text/template" id="template-help-musician-recording-count">
The number of recordings that this user has made.
<script type="text/template" id="template-help-recording-count">
The number of recordings that this {{data.entity_type}} has made.
</script>
<script type="text/template" id="template-help-musician-session-count">
The number of sessions that this user has played in.
<script type="text/template" id="template-help-session-count">
The number of sessions that this {{data.entity_type}} has played in.
</script>
<script type="text/template" id="template-help-musician-score-count">

View File

@ -57,9 +57,9 @@
<h3>{name}</h3>
<small>{location}<br /><strong>{genres}</strong></small><br />
<br clear="all" />
<span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
<span class="follower-count" title="followers"><span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" style="margin-right:4px;" /></span>
<span class="recording-count" title="recordings">{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" style="margin-right:4px;" /></span>
<span class="session-count"> title="sessions">{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" style="margin-right:4px;" /></span>
</div>
<br clear="all" /><br />
<br />

View File

@ -65,8 +65,8 @@
<div class="left ib">
<h3>{name}</h3>
<small>{location}</small><br /><br />
<span id="spnFriendCount">{friend_count}</span> <img src="/assets/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;
<span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />
<span class="friend-count" title="friends">{friend_count} <img src="/assets/content/icon_friend.png" align="absmiddle" style="margin-right:4px;" /></span>
<span class="follower-count" title="followers"><span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" style="margin-right:4px;" /></span>
</div>
<br clear="all" /><br />
<div class="f11">{biography}</div><br />

View File

@ -102,10 +102,10 @@
<small>{location}</small><br /><br />
{instruments}
<br clear="all" />
<span id="spnFriendCount">{friend_count}</span> <img src="/assets/content/icon_friend.png" align="absmiddle" />&nbsp;&nbsp;&nbsp;
<span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />&nbsp;&nbsp;&nbsp;
{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
<span class="friend-count" title="friends">{friend_count} <img src="/assets/content/icon_friend.png" align="absmiddle" style="margin-right:4px;" /></span>
<span class="follower-count" title="followers"><span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" style="margin-right:4px;" /></span>
<span class="recording-count" title="recordings">{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" style="margin-right:4px;" /></span>
<span class="session-count" title="sessions">{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" style="margin-right:4px;" /></span>
</div>
<br clear="all" /><br />
<div style="display:{session_display}" class="f12">

View File

@ -22,9 +22,9 @@
<br clear="all" />
<div class="f11 mt5 mb5">{description}</div>
<div class="small">
<span id="spnPlayCount">{play_count}</span> <img src="/assets/content/icon_arrow.png" width="7" height="12" align="absmiddle" style="vertical-align:middle;" />&nbsp;&nbsp;&nbsp;&nbsp;
<span id="spnCommentCount">{comment_count}</span> <img src="/assets/content/icon_comment.png" width="13" height="12" align="absmiddle" style="vertical-align:middle;" />&nbsp;&nbsp;&nbsp;&nbsp;
<span id="spnLikeCount">{like_count}</span> <img src="/assets/content/icon_like.png" width="12" height="12" align="absmiddle" style="vertical-align:middle;" />
<span id="spnPlayCount">{play_count}</span> <img src="/assets/content/icon_arrow.png" title="plays" width="7" height="12" align="absmiddle" style="vertical-align:middle; margin-right:4px;" />
<span id="spnCommentCount">{comment_count}</span> <img src="/assets/content/icon_comment.png" title="comments" width="13" height="12" align="absmiddle" style="vertical-align:middle; margin-right:4px;" />
<span id="spnLikeCount">{like_count}</span> <img src="/assets/content/icon_like.png" title="likes" width="12" height="12" align="absmiddle" style="vertical-align:middle; margin-right:4px;" />
</div>
<br /><br />
<a href="#" class="avatar_large left mr20"><img src="{creator_avatar_url}" /></a>

View File

@ -23,8 +23,8 @@
<div class="f11 mt5 mb5"><b>{name}</b></div>
<div class="f11 mt5 mb5">{description}</div>
<div class="small">
<span id="spnCommentCount">{comment_count}</span> <img src="/assets/content/icon_comment.png" width="13" height="12" align="absmiddle" style="vertical-align:middle;" />&nbsp;&nbsp;&nbsp;
<span id="spnLikeCount">{like_count}</span> <img src="/assets/content/icon_like.png" width="12" height="12" align="absmiddle" style="vertical-align:middle;" />
<span id="spnCommentCount">{comment_count}</span> <img src="/assets/content/icon_comment.png" title="comments" width="13" height="12" align="absmiddle" style="vertical-align:middle; margin-right:4px;" />
<span id="spnLikeCount">{like_count}</span> <img src="/assets/content/icon_like.png" title="likes" width="12" height="12" align="absmiddle" style="vertical-align:middle; margin-right:4px;" />
</div>
<br />
MUSICIANS:<br /><br />

View File

@ -43,7 +43,7 @@
</div>
<div class="musician-stats">
<span class="friend-count">{friend_count} <img src="../assets/content/icon_friend.png" alt="friends" width="14" height="12" align="absmiddle" style="margin-right:4px;"/></span>
<span class="follower-count">{follow_count} <img src="../assets/content/icon_followers.png" alt="follows" width="22" height="12" align="absmiddle" style="margin-right:4px;"/></span>
<span class="follower-count">{follow_count} <img src="../assets/content/icon_followers.png" alt="followers" width="22" height="12" align="absmiddle" style="margin-right:4px;"/></span>
<span class="recording-count">{recording_count} <img src="../assets/content/icon_recordings.png" alt="recordings" width="12" height="13" align="absmiddle" style="margin-right:4px;"/></span>
<span class="session-count">{session_count} <img src="../assets/content/icon_session_tiny.png" alt="sessions" width="12" height="12" align="absmiddle" style="margin-right:4px;"/></span>
</div>

View File

@ -200,9 +200,9 @@
</div>
<div class="button-row">
<div class="lcol stats left">
{follower_count} <img src="../assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />
{recording_count} <img src="../assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />
{session_count} <img src="../assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
{follower_count} <img src="../assets/content/icon_followers.png" title="followers" width="22" height="12" align="absmiddle" />
{recording_count} <img src="../assets/content/icon_recordings.png" title="recordings" width="12" height="13" align="absmiddle" />
{session_count} <img src="../assets/content/icon_session_tiny.png" title="sessions" width="12" height="12" align="absmiddle" />
</div>
<div class="result-list-button-wrapper">
<a class="button-orange smallbutton" href="{profile_url}">PROFILE</a>

View File

@ -71,7 +71,7 @@
.nowrap
- if user.total_instruments
- user.total_instruments.split('|').uniq.each do |instrument_id|
%img.instrument-icon{'instrument-id' =>instrument_id, height:24, width:24}
%img.instrument-icon{'instrument-id' =>instrument_id, 'title' => instrument_id, height:24, width:24}
- else
%img.instrument-icon{'instrument-id' =>'default', height:24, width:24}

View File

@ -76,7 +76,7 @@
.nowrap
= '{% if(user.instruments) { %}'
= '{% _.each(_.uniq(user.instruments), function(instrument_id) { %}'
%img.instrument-icon{'instrument-id' =>'{{instrument_id}}', height:24, width:24}
%img.instrument-icon{'instrument-id' =>'{{instrument_id}}', 'title' =>'{{instrument_id}}', height:24, width:24}
= '{% }) %}'
= '{% } else { %}'
%img.instrument-icon{'instrument-id' =>'default', height:24, width:24}

View File

@ -88,7 +88,7 @@
%td
.nowrap
- track.instrument_ids.uniq.each do |instrument_id|
%img.instrument-icon{'instrument-id' => instrument_id, height:24, width:24}
%img.instrument-icon{'instrument-id' => instrument_id, 'title' => instrument_id, height:24, width:24}
%br{:clear => "all"}/
%br/

View File

@ -96,7 +96,7 @@
.nowrap
= '{% if(track.instrument_ids) { %}'
= '{% _.each(_.uniq(track.instrument_ids), function(instrument_id) { %}'
%img.instrument-icon{'instrument-id' =>'{{instrument_id}}', height:24, width:24}
%img.instrument-icon{'instrument-id' =>'{{instrument_id}}', 'title' =>'{{instrument_id}}', height:24, width:24}
= '{% }) %}'
= '{% } else { %}'
%img.instrument-icon{'instrument-id' =>'default', height:24, width:24}