socialforge/app/views/layouts/_user_watch_btn.html.erb

8 lines
584 B
Plaintext

<% if(User.current.logged? && User.current!=target)%>
<%if(target.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=>
'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr qx_btn mr10" data-method="delete" data-remote="true" title="取消关注">取消</a>
<% else %>
<a id="user_watch_id" href="<%= watch_path(:object_type=>'user',:object_id=>target.id,:target_id=>target.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">关注</a>
<% end %>
<% end %>