Merge user feeds & followers #118

Merged
aheathershaw merged 16 commits from feature/111-user-activity-feeds into master 2018-11-19 19:08:50 +00:00
2 changed files with 55 additions and 1 deletions
Showing only changes of commit e59311244a - Show all commits

View File

@ -41534,6 +41534,50 @@ module.exports = function(Chart) {
},{"25":25,"45":45,"6":6}]},{},[7])(7)
});
/**
* This model is used by gallery/explore_users.blade.php, to handle following/unfollowing users profiles.
* @constructor
*/
function ExploreUsersViewModel(urls)
{
this.el = '#explore-users-app';
this.data = {
};
this.computed = {
};
this.methods = {
followUser: function(e)
{
var userIDToFollow = $(e.target).data('user-id');
var urlToPost = urls.follow_user_url.replace('/-1/', '/' + userIDToFollow + '/');
$.post(urlToPost, '', function(data)
{
window.location.reload(true);
});
e.preventDefault();
return false;
},
unFollowUser: function(e)
{
var userIDToUnfollow = $(e.target).data('user-id');
var urlToPost = urls.unfollow_user_url.replace('/-1/', '/' + userIDToUnfollow + '/');
$.post(urlToPost, '', function(data)
{
window.location.reload(true);
});
e.preventDefault();
return false;
}
};
}
/**
* This model is used by gallery/photo.blade.php, to handle comments and individual photo actions.
* @constructor
@ -41673,6 +41717,16 @@ function UserViewModel(urls)
'<a href="' + data[i].params.photo_url + '">' + data[i].params.photo_name + '</a>'
);
}
// Album name
if (data[i].params.album_name && data[i].params.album_url)
{
data[i].description = data[i].description
.replace(
':album_name',
'<a href="' + data[i].params.album_url + '">' + data[i].params.album_name + '</a>'
);
}
}
self.feed_items = data;

File diff suppressed because one or more lines are too long