Colloquio.Views.User={};Colloquio.Views.User.UserView=Class.create(Colloquio.Views.CoreView,{FRIEND_REMOVE_LINK_ID:'friend_remove',USER_ACTIONS_PANEL_ID:'user-actions',SUCCESS_NOTICE_TEMPLATE:'You are no longer friends with #{user_name}.',initialize:function($super,user)
{this.user=user;var removeLink=$(this.FRIEND_REMOVE_LINK_ID);if(removeLink)
{this.removeLink=$(this.FRIEND_REMOVE_LINK_ID);var activators={};activators[this.FRIEND_REMOVE_LINK_ID]=this.USER_ACTIONS_PANEL_ID;this.confirmer=new Colloquio.Controls.InlineConfirmer(activators,{confirm:this._removeFriend.bind(this)});}},_removeFriend:function()
{new Ajax.Request(this._removeFriendUrl(),{asynchronous:true,evalScripts:true,method:'post',onSuccess:this._removeFriendSuccess.bind(this),onFailure:this._removeFriendFail.bind(this),parameters:'authenticity_token='+encodeURIComponent(window._authToken)});this.removeLink.remove();},_removeFriendSuccess:function()
{var template=new Template(this.SUCCESS_NOTICE_TEMPLATE);this.confirmer.reminder.update(template.evaluate({user_name:this.user.name}));},_removeFriendFail:function()
{this.removeLink.remove();this.confirmer.reminder.update('There was an error removing this friendship. Please try again later.');},_removeFriendUrl:function()
{return'/users/'+this.user.id+'/friend_remove';}});