vrfs-774: removed the like button for results and commented out the message link for compliance with product spec
This commit is contained in:
parent
cc4f2512bd
commit
7f302a6f0e
|
|
@ -162,7 +162,6 @@ module JamRuby
|
|||
end
|
||||
|
||||
RESULT_FOLLOW = :follows
|
||||
RESULT_LIKE = :likes
|
||||
RESULT_FRIEND = :friends
|
||||
|
||||
COUNT_FRIEND = :count_friend
|
||||
|
|
@ -194,11 +193,6 @@ module JamRuby
|
|||
rel = rel.where(["users.id IN (#{mids}) AND follows.user_id = users.id"])
|
||||
rel.all.each { |val| @user_counters[val.uid] << RESULT_FOLLOW }
|
||||
|
||||
rel = User.select("users.id AS uid")
|
||||
rel = rel.joins("LEFT JOIN users_likers AS likers ON likers.liker_id = '#{user.id}'")
|
||||
rel = rel.where(["users.id IN (#{mids}) AND likers.user_id = users.id"])
|
||||
rel.all.each { |val| @user_counters[val.uid] << RESULT_LIKE }
|
||||
|
||||
rel = User.select("users.id AS uid")
|
||||
rel = rel.joins("LEFT JOIN friendships AS friends ON friends.friend_id = '#{user.id}'")
|
||||
rel = rel.where(["users.id IN (#{mids}) AND friends.user_id = users.id"])
|
||||
|
|
@ -249,12 +243,6 @@ module JamRuby
|
|||
end if @user_counters
|
||||
false
|
||||
end
|
||||
def is_liker?(musician)
|
||||
if mm = @user_counters[musician.id]
|
||||
return mm.include?(RESULT_LIKE)
|
||||
end if @user_counters
|
||||
false
|
||||
end
|
||||
|
||||
def self.new_musicians(usr, since_date=Time.now - 1.week, max_count=50, radius=M_MILES_DEFAULT)
|
||||
rel = User.musicians
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
profile_url: "/#/profile/" + mm.id,
|
||||
button_friend: mm['is_friend'] ? '' : 'button-orance',
|
||||
button_follow: mm['is_following'] ? '' : 'button-orange',
|
||||
button_like: mm['is_liker'] ? '' : 'button-orange'
|
||||
button_message: 'button-orange'
|
||||
};
|
||||
var musician_actions = context.JK.fillTemplate(aTemplate, actionVals);
|
||||
|
||||
|
|
@ -138,7 +138,6 @@
|
|||
$('#musician-filter-results').append(renderings);
|
||||
|
||||
$('.search-m-friend').on('click', friendMusician);
|
||||
$('.search-m-like').on('click', likeMusician);
|
||||
$('.search-m-follow').on('click', followMusician);
|
||||
}
|
||||
|
||||
|
|
@ -196,30 +195,6 @@
|
|||
error: app.ajaxError
|
||||
});
|
||||
}
|
||||
function likeMusician(evt) {
|
||||
// if the musician is already liked, 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 newLike = {};
|
||||
newLike.user_id = $(this).parent().data('musician-id');
|
||||
var url = "/api/users/" + context.JK.currentUserId + "/likes";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
contentType: 'application/json',
|
||||
url: url,
|
||||
data: JSON.stringify(newLike),
|
||||
processData: false,
|
||||
success: function(response) {
|
||||
// remove the orange look to indicate it's not selectable
|
||||
$('div[data-musician-id='+newLike.user_id+'] .search-m-like').removeClass('button-orange');
|
||||
},
|
||||
error: app.ajaxError
|
||||
});
|
||||
}
|
||||
|
||||
function events() {
|
||||
$("#musician_query_distance").keypress(function(evt) {
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ unless @search.musicians.nil? || @search.musicians.size == 0
|
|||
@search.is_follower?(musician)
|
||||
end
|
||||
|
||||
node :is_liker do |musician|
|
||||
@search.is_liker?(musician)
|
||||
end
|
||||
|
||||
child :musician_instruments => :instruments do
|
||||
attributes :instrument_id, :description, :proficiency_level, :priority
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
</script>
|
||||
|
||||
<script type="text/template" id="template-musician-action-btns">
|
||||
<a href="{profile_url}" class="button-orange smallbutton m0">PROFILE</a><a href="#" class="{button_like} smallbutton search-m-like">LIKE</a><a href="#" class="{button_friend} smallbutton m0 search-m-friend">FRIEND</a><a href="#" class="{button_follow} smallbutton search-m-follow">FOLLOW</a>
|
||||
<a href="{profile_url}" class="button-orange smallbutton m0">PROFILE</a><% if current_user.musician? %><a href="#" class="{button_friend} smallbutton m0 search-m-friend">CONNECT</a><% end %><a href="#" class="{button_follow} smallbutton search-m-follow">FOLLOW</a><!--<a href="#" class="{button_message} smallbutton search-m-like">MESSAGE</a>-->
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="template-musician-follow-info">
|
||||
|
|
|
|||
Loading…
Reference in New Issue