添加关注与取消关注

Branch_szzh
sw 10 years ago
parent 498775b0a8
commit a2ec65a0c9

@ -1,7 +1,11 @@
<% if User.current.logged?%> <% if User.current.logged?%>
<%if(target.watched_by?(User.current))%> <% if User.current == target%>
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollow", :method => "delete",:remote => "true", :title => "取消关注"%> <%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn")%>
<% else %> <% else%>
<%= link_to "",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "homepageFollowCancel", :method => "post",:remote => "true", :title => "添加关注"%> <%if(target.watched_by?(User.current))%>
<% end %> <%= 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 %> <% end %>

@ -39,10 +39,6 @@
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a> <a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div> </div>
</div> </div>
<% else %>
<div id="watch_user_btn" class="none">
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
<% end %> <% end %>
<% end%> <% end%>
</div> </div>
@ -57,9 +53,7 @@
<p class="mb20 c_dark f14"> <p class="mb20 c_dark f14">
<%= get_technical_title @user %> <%= get_technical_title @user %>
</p> </p>
<%= link_to("编辑资料", my_account_path, :class => "fl UsersEditBtn") if is_current_user%> <%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
<a href="javascript:void(0);" class="UsersAttBtn" style="display:none;">添加关注</a>
<a href="javascript:void(0);" class="UsersApBtn" style="display:none;">取消关注</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div> <div>

Loading…
Cancel
Save