Merge branch 'develop' into VRFS-1110

This commit is contained in:
Jonathan Kolyer 2014-03-13 10:53:47 +00:00
commit f56fcd6fab
1 changed files with 35 additions and 25 deletions

View File

@ -477,20 +477,25 @@
// FRIENDS
rest.getFriends({id: userId})
.done(function (response) {
$.each(response, function (index, val) {
var template = $('#template-profile-social').html();
var friendHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: "user-id",
hoverAction: val.musician ? "musician" : "fan",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
location: val.location,
type: "Friends"
});
if (response && response.length > 0) {
$.each(response, function (index, val) {
var template = $('#template-profile-social').html();
var friendHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: "user-id",
hoverAction: val.musician ? "musician" : "fan",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
location: val.location,
type: "Friends"
});
$('#profile-social-friends').append(friendHtml);
});
$('#profile-social-friends').append(friendHtml);
});
}
else {
$('#profile-social-friends').html(' ');
}
context.JK.bindHoverEvents();
})
.fail(app.ajaxError)
@ -498,19 +503,24 @@
rest.getFollowings({id: userId})
.done(function (response) {
$.each(response, function (index, val) {
var template = $('#template-profile-social').html();
var followingHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: val.type === "user" ? "user-id" : "band-id",
hoverAction: val.type === "user" ? (val.musician ? "musician" : "fan") : "band",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
location: val.location
});
if (response && response.length > 0) {
$.each(response, function (index, val) {
var template = $('#template-profile-social').html();
var followingHtml = context.JK.fillTemplate(template, {
userId: val.id,
hoverAttributeId: val.type === "user" ? "user-id" : "band-id",
hoverAction: val.type === "user" ? (val.musician ? "musician" : "fan") : "band",
avatar_url: context.JK.resolveAvatarUrl(val.photo_url),
userName: val.name,
location: val.location
});
$('#profile-social-followings').append(followingHtml);
});
$('#profile-social-followings').append(followingHtml);
});
}
else {
$('#profile-social-followings').html(' ');
}
context.JK.bindHoverEvents();
})
.fail(app.ajaxError);