Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop
This commit is contained in:
commit
cbac485e7e
|
|
@ -42,16 +42,16 @@ create table icecast_admin_authentications (
|
|||
-- The default username for all source connections is 'source' but
|
||||
-- this option allows to specify a default password. This and the username
|
||||
-- can be changed in the individual mount sections.
|
||||
source_password character NOT NULL DEFAULT 'icejam321',
|
||||
source_password VARCHAR NOT NULL DEFAULT 'icejam321',
|
||||
|
||||
-- Used in the master server as part of the authentication when a slave requests
|
||||
-- the list of streams to relay. The default username is 'relay'
|
||||
relay_user character NOT NULL DEFAULT 'relay',
|
||||
relay_password character NOT NULL DEFAULT 'jkrelayhack',
|
||||
relay_user VARCHAR NOT NULL DEFAULT 'relay',
|
||||
relay_password VARCHAR NOT NULL DEFAULT 'jkrelayhack',
|
||||
|
||||
--The username/password used for all administration functions.
|
||||
admin_user character NOT NULL DEFAULT 'jkadmin',
|
||||
admin_password character NOT NULL DEFAULT 'jKadmin123',
|
||||
admin_user VARCHAR NOT NULL DEFAULT 'jkadmin',
|
||||
admin_password VARCHAR NOT NULL DEFAULT 'jKadmin123',
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
|
|
|
|||
|
|
@ -12,9 +12,4 @@ describe IcecastAdminAuthentication do
|
|||
admin.save.should be_true
|
||||
end
|
||||
|
||||
it "non-string password should be checked" do
|
||||
admin.source_password = 1
|
||||
admin.save.should be_false
|
||||
admin.errors[:source_password].should == ['is not a string']
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
(function(context,$) {
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
context.JK = context.JK || {};
|
||||
context.JK.FindMusicianScreen = function(app) {
|
||||
context.JK = context.JK || {};
|
||||
context.JK.FindMusicianScreen = function(app) {
|
||||
|
||||
var logger = context.JK.logger;
|
||||
var musicians = {};
|
||||
var musicianList;
|
||||
var instrument_logo_map = context.JK.getInstrumentIconMap24();
|
||||
var did_show_musician_page = false;
|
||||
var page_num=1, page_count=0;
|
||||
var did_show_musician_page = false;
|
||||
var page_num=1, page_count=0;
|
||||
|
||||
function loadMusicians(queryString) {
|
||||
// squelch nulls and undefines
|
||||
|
|
@ -24,157 +24,165 @@
|
|||
}
|
||||
|
||||
function search() {
|
||||
did_show_musician_page = true;
|
||||
did_show_musician_page = true;
|
||||
var queryString = 'srch_m=1&page='+page_num+'&';
|
||||
|
||||
// order by
|
||||
var orderby = $('#musician_order_by').val();
|
||||
var orderby = $('#musician_order_by').val();
|
||||
if (typeof orderby != 'undefined' && orderby.length > 0) {
|
||||
queryString += "orderby=" + orderby + '&';
|
||||
}
|
||||
|
||||
// instrument filter
|
||||
var instrument = $('#musician_instrument').val();
|
||||
var instrument = $('#musician_instrument').val();
|
||||
if (typeof instrument != 'undefined' && !(instrument === '')) {
|
||||
queryString += "instrument=" + instrument + '&';
|
||||
}
|
||||
|
||||
// distance filter
|
||||
var query_param = $('#musician_query_distance').val();
|
||||
if (query_param !== null && query_param.length > 0) {
|
||||
var matches = query_param.match(/(\d+)/);
|
||||
if (0 < matches.length) {
|
||||
var distance = matches[0];
|
||||
queryString += "distance=" + distance + '&';
|
||||
}
|
||||
var matches = query_param.match(/(\d+)/);
|
||||
if (0 < matches.length) {
|
||||
var distance = matches[0];
|
||||
queryString += "distance=" + distance + '&';
|
||||
}
|
||||
}
|
||||
loadMusicians(queryString);
|
||||
}
|
||||
|
||||
function refreshDisplay() {
|
||||
clearResults();
|
||||
search();
|
||||
clearResults();
|
||||
search();
|
||||
}
|
||||
|
||||
function afterLoadMusicians(mList) {
|
||||
// display the 'no musicians' banner if appropriate
|
||||
var $noMusiciansFound = $('#musicians-none-found');
|
||||
musicianList = mList;
|
||||
musicianList = mList;
|
||||
|
||||
if(musicianList.length == 0) {
|
||||
$noMusiciansFound.show();
|
||||
musicians = [];
|
||||
} else {
|
||||
musicians = [];
|
||||
}
|
||||
else {
|
||||
$noMusiciansFound.hide();
|
||||
musicians = musicianList['musicians'];
|
||||
if (!(typeof musicians === 'undefined')) {
|
||||
$('#musician-filter-city').text(musicianList['city']);
|
||||
if (0 == page_count) {
|
||||
page_count = musicianList['page_count'];
|
||||
}
|
||||
renderMusicians();
|
||||
}
|
||||
musicians = musicianList['musicians'];
|
||||
if (!(typeof musicians === 'undefined')) {
|
||||
$('#musician-filter-city').text(musicianList['city']);
|
||||
if (0 == page_count) {
|
||||
page_count = musicianList['page_count'];
|
||||
}
|
||||
renderMusicians();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a list of musicians
|
||||
*/
|
||||
function renderMusicians() {
|
||||
var ii, len;
|
||||
var mTemplate = $('#template-find-musician-row').html();
|
||||
var fTemplate = $('#template-musician-follow-info').html();
|
||||
var aTemplate = $('#template-musician-action-btns').html();
|
||||
var mVals, mm, renderings='';
|
||||
var instr_logos, instr;
|
||||
var follows, followVals, aFollow;
|
||||
|
||||
for (ii=0, len=musicians.length; ii < len; ii++) {
|
||||
mm = musicians[ii];
|
||||
instr_logos = '';
|
||||
for (var jj=0, ilen=mm['instruments'].length; jj<ilen; jj++) {
|
||||
var mTemplate = $('#template-find-musician-row').html();
|
||||
var fTemplate = $('#template-musician-follow-info').html();
|
||||
var aTemplate = $('#template-musician-action-btns').html();
|
||||
var mVals, mm, renderings='';
|
||||
var instr_logos, instr;
|
||||
var follows, followVals, aFollow;
|
||||
|
||||
for (ii=0, len=musicians.length; ii < len; ii++) {
|
||||
mm = musicians[ii];
|
||||
instr_logos = '';
|
||||
for (var jj=0, ilen=mm['instruments'].length; jj<ilen; jj++) {
|
||||
if (mm['instruments'][jj].instrument_id in instrument_logo_map) {
|
||||
instr = instrument_logo_map[mm['instruments'][jj].instrument_id];
|
||||
instr = instrument_logo_map[mm['instruments'][jj].instrument_id];
|
||||
}
|
||||
instr_logos += '<img src="' + instr + '" width="24" height="24" /> ';
|
||||
}
|
||||
follows = '';
|
||||
followVals = {};
|
||||
for (var jj=0, ilen=mm['followings'].length; jj<ilen; jj++) {
|
||||
aFollow = mm['followings'][jj];
|
||||
followVals = {
|
||||
musician_name: aFollow.name,
|
||||
profile_url: '/#/profile/' + aFollow.user_id,
|
||||
avatar_url: context.JK.resolveAvatarUrl(aFollow.photo_url),
|
||||
};
|
||||
}
|
||||
follows = '';
|
||||
followVals = {};
|
||||
for (var jj=0, ilen=mm['followings'].length; jj<ilen; jj++) {
|
||||
aFollow = mm['followings'][jj];
|
||||
followVals = {
|
||||
musician_name: aFollow.name,
|
||||
profile_url: '/#/profile/' + aFollow.user_id,
|
||||
avatar_url: context.JK.resolveAvatarUrl(aFollow.photo_url),
|
||||
};
|
||||
follows += context.JK.fillTemplate(fTemplate, followVals);
|
||||
if (2 == jj) break;
|
||||
}
|
||||
var actionVals = {
|
||||
profile_url: "/#/profile/" + mm.id,
|
||||
button_friend: mm['is_friend'] ? '' : 'button-orange',
|
||||
button_follow: mm['is_following'] ? '' : 'button-orange',
|
||||
button_message: 'button-orange'
|
||||
};
|
||||
if (2 == jj) break;
|
||||
}
|
||||
var actionVals = {
|
||||
profile_url: "/#/profile/" + mm.id,
|
||||
button_friend: mm['is_friend'] ? '' : 'button-orange',
|
||||
button_follow: mm['is_following'] ? '' : 'button-orange',
|
||||
button_message: 'button-orange'
|
||||
};
|
||||
var musician_actions = context.JK.fillTemplate(aTemplate, actionVals);
|
||||
|
||||
mVals = {
|
||||
avatar_url: context.JK.resolveAvatarUrl(mm.photo_url),
|
||||
profile_url: "/#/profile/" + mm.id,
|
||||
musician_name: mm.name,
|
||||
musician_location: mm.city + ', ' + mm.state,
|
||||
instruments: instr_logos,
|
||||
biography: mm['biography'],
|
||||
follow_count: mm['follow_count'],
|
||||
friend_count: mm['friend_count'],
|
||||
recording_count: mm['recording_count'],
|
||||
session_count: mm['session_count'],
|
||||
musician_id: mm['id'],
|
||||
musician_follow_template: follows,
|
||||
musician_action_template: musician_actions
|
||||
};
|
||||
var musician_row = context.JK.fillTemplate(mTemplate, mVals);
|
||||
mVals = {
|
||||
avatar_url: context.JK.resolveAvatarUrl(mm.photo_url),
|
||||
profile_url: "/#/profile/" + mm.id,
|
||||
musician_name: mm.name,
|
||||
musician_location: mm.city + ', ' + mm.state,
|
||||
instruments: instr_logos,
|
||||
biography: mm['biography'],
|
||||
follow_count: mm['follow_count'],
|
||||
friend_count: mm['friend_count'],
|
||||
recording_count: mm['recording_count'],
|
||||
session_count: mm['session_count'],
|
||||
musician_id: mm['id'],
|
||||
musician_follow_template: follows,
|
||||
musician_action_template: musician_actions
|
||||
};
|
||||
var musician_row = context.JK.fillTemplate(mTemplate, mVals);
|
||||
renderings += musician_row;
|
||||
}
|
||||
$('#musician-filter-results').append(renderings);
|
||||
}
|
||||
$('#musician-filter-results').append(renderings);
|
||||
|
||||
$('.search-m-friend').on('click', friendMusician);
|
||||
$('.search-m-follow').on('click', followMusician);
|
||||
$('.search-m-friend').on('click', friendMusician);
|
||||
$('.search-m-follow').on('click', followMusician);
|
||||
}
|
||||
|
||||
function beforeShow(data) {
|
||||
}
|
||||
|
||||
function afterShow(data) {
|
||||
if (!did_show_musician_page) {
|
||||
refreshDisplay();
|
||||
}
|
||||
if (!did_show_musician_page) {
|
||||
refreshDisplay();
|
||||
}
|
||||
}
|
||||
|
||||
function clearResults() {
|
||||
musicians = {};
|
||||
$('#musician-filter-results').empty();
|
||||
page_num = 1;
|
||||
page_count = 0;
|
||||
$('#musician-filter-results').empty();
|
||||
page_num = 1;
|
||||
page_count = 0;
|
||||
}
|
||||
|
||||
function friendMusician(evt) {
|
||||
// if the musician is already a friend, remove the button-orange class, and prevent
|
||||
// the link from working
|
||||
if (0 == $(this).closest('.button-orange').size()) return false;
|
||||
$(this).click(function(ee) {ee.preventDefault();});
|
||||
|
||||
function friendMusician(evt) {
|
||||
// if the musician is already a friend, remove the button-orange class, and prevent
|
||||
// the link from working
|
||||
if (0 === $(this).closest('.button-orange').size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).click(function(ee) {ee.preventDefault();});
|
||||
|
||||
evt.stopPropagation();
|
||||
var uid = $(this).parent().data('musician-id');
|
||||
var uid = $(this).parent().data('musician-id');
|
||||
context.JK.sendFriendRequest(app, uid, friendRequestCallback);
|
||||
}
|
||||
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');
|
||||
}
|
||||
function followMusician(evt) {
|
||||
// if the musician is already followed, remove the button-orange class, and prevent
|
||||
// the link from working
|
||||
if (0 == $(this).closest('.button-orange').size()) return false;
|
||||
$(this).click(function(ee) {ee.preventDefault();});
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
function followMusician(evt) {
|
||||
// if the musician is already followed, remove the button-orange class, and prevent
|
||||
// the link from working
|
||||
if (0 === $(this).closest('.button-orange').size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$(this).click(function(ee) {ee.preventDefault();});
|
||||
|
||||
evt.stopPropagation();
|
||||
var newFollowing = {};
|
||||
|
|
@ -188,31 +196,28 @@
|
|||
data: JSON.stringify(newFollowing),
|
||||
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');
|
||||
// remove the orange look to indicate it's not selectable
|
||||
$('div[data-musician-id='+newFollowing.user_id+'] .search-m-follow').removeClass('button-orange');
|
||||
},
|
||||
error: app.ajaxError
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function events() {
|
||||
$('#musician_query_distance').change(refreshDisplay);
|
||||
$('#musician_instrument').change(refreshDisplay);
|
||||
$('#musician_order_by').change(refreshDisplay);
|
||||
|
||||
$('#musician-filter-results').bind('scroll', function() {
|
||||
$('#musician-filter-results').bind('scroll', function() {
|
||||
if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
|
||||
if (page_num < page_count) {
|
||||
page_num += 1;
|
||||
search();
|
||||
}
|
||||
if (page_num < page_count) {
|
||||
page_num += 1;
|
||||
search();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize,
|
||||
*/
|
||||
function initialize() {
|
||||
var screenBindings = {
|
||||
'beforeShow': beforeShow,
|
||||
|
|
@ -231,5 +236,4 @@
|
|||
|
||||
return this;
|
||||
};
|
||||
|
||||
})(window,jQuery);
|
||||
|
|
|
|||
|
|
@ -375,12 +375,6 @@
|
|||
$('.profile-nav a.active').removeClass('active');
|
||||
$('.profile-nav a.#profile-social-link').addClass('active');
|
||||
|
||||
/*if (isMusician()) {
|
||||
$('.profile-social-left').show();
|
||||
} else {
|
||||
$('.profile-social-left').hide();
|
||||
}*/
|
||||
|
||||
bindSocial();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue