添加关注

This commit is contained in:
ouyangxuhua 2015-08-12 16:28:21 +08:00
parent d67d21eb42
commit 78ccfe6a03
1 changed files with 13 additions and 2 deletions

View File

@ -23,8 +23,19 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<%= l(:label_x_has_fans,:count=>user.watcher_users.count)%> <%= l(:label_x_has_fans,:count=>user.watcher_users.count, :remote => true)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %> <%= l(:label_has_watchers,:count=>User.watched_by(user.id).count, :remote => true) %>
<% if User.current.logged?%>
<% if User.current == user%>
<a href="<%= url_for(:controller => 'my', :action => 'account') %>" class="fr gz_btn mr10 ">编辑资料</a>
<%else%>
<%if(user.watched_by?(User.current))%>
<a id="user_watch_id" href="<%= watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.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=>user.id,:target_id=>user.id) %>" class="fr gz_btn mr10" data-method="post" data-remote="true" title="添加关注">添加关注</a>
<% end %>
<% end%>
<% end %>
</td> </td>
</tr> </tr>
</table> </table>