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

11 lines
683 B
Plaintext

<% if User.current.logged?%>
<% if User.current == target%>
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn")%>
<% else%>
<%if(target.watched_by?(User.current))%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersApBtn", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %>
<%= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "UsersAttBtn", :method => "post",:remote => "true", :title => "添加关注"%>
<% end %>
<% end%>
<% end %>