<% if User.current.logged? && User.current == @user %>
<%= link_to image_tag(url_to_avatar(@user),width:"238", height: "200", :id => 'nh_source_tx'),
my_clear_user_avatar_temp_path, :remote => true %>
<% else %>
<%=image_tag(url_to_avatar(@user),width:"238", height: "200", :id=>'nh_source_tx') %>
<% end %>
<%= link_to @user.show_name, user_path(@user), :class => "mb5 fontGrey3" %>
<% if @user.user_extensions && @user.user_extensions.identity %>
(<%= get_user_roll @user %>)
<% end%>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<% end %>
<%= @user.login %>
<% if !(@user.user_extensions.school_id.blank? || @user.user_extensions.school.nil?) %>
<%= @user.user_extensions.school.name %>
<% end %>
-
技术文章
<%= @user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %>
-
关注
<%= User.watched_by(@user).count %>
-
粉丝
<%= @user.watcher_users.count %>
<% if User.current.logged?%>
<% if User.current == @user %>
<%= link_to '个人主页', homepage_user_path(@user), :class => "home-big-btn-grey", :target => '_blank' %>
<% else %>
<% if(@user.watched_by?(User.current)) %>
<%= link_to "取消关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
:class => "home-btn-grey fl mr12",
:method => "delete",
:remote => "true",
:title => "取消关注" %>
<% else %>
<%= link_to "添加关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
:class => "home-btn-grey fl mr12",
:method => "post",
:remote => "true",
:title => "添加关注" %>
<% end %>
<% if @user.base_homepage.nil? %>
TA的主页
<% else %>
<%= link_to "TA的主页", homepage_user_path(@user.login), :class => 'home-btn-grey fl', :target => '_blank' %>
<% end %>
<% end %>
<% end %>
<% if is_current_user %>
<% if hidden_unproject_infos && user_course_count > 0 %>
<%= link_to "课程社区", user_course_community_path(User.current), :class => "fl" , :target => "_blank", :style => "color:#666" %>
<%# if hidden_unproject_infos %>
-
<%= link_to user_course_count > 0 ? "课程#{user_course_count}".html_safe : "课程",
user_course_community_path(User.current), :id => "user_course_list", :target => "_blank" %>
<% if user_manage_homework_count > 0 %>
-
<%= link_to user_manage_homework_count > 0 ? "我发布的作业#{user_manage_homework_count}".html_safe : "我发布的作业",
user_manage_homeworks_user_path(@user), :target => "_blank" %>
<% end %>
<% if user_receive_homework_count > 0 %>
-
<%= link_to "我收到的作业#{user_receive_homework_count}".html_safe,
user_receive_homeworks_user_path(@user), :target => "_blank" %>
<% end %>
-
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl", :style => "color:#666" %>
-
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl", :style => "color:#666" %>
<%# end %>
<% end %>
<% if user_project_count > 0%>
<%= link_to "项目社区", user_project_community_path(User.current), :class => "fl", :target => "_blank", :style => "color:#666" %>
-
<%= link_to user_project_count > 0 ? "项目#{user_project_count}".html_safe : "项目",
user_project_community_path(User.current), :id => 'user_project_list', :target => "_blank" %>
<% if issues_author_is_self_count > 0 %>
-
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue#{issues_author_is_self_count}".html_safe : "我发布的issue",
user_manage_issues_user_path(@user), :target => "_blank" %>
<% end %>
<% if issues_assigned_is_self_count > 0 %>
-
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue#{issues_assigned_is_self_count}".html_safe : "我收到的issue",
user_receive_issues_user_path(@user), :target => "_blank" %>
<% end %>
<% end %>
<% if hidden_unproject_infos && user_contest_count > 0 %>
<%= link_to "竞赛社区", user_contest_community_path(User.current), :class => "fl" , :target => "_blank"%>
-
<%= link_to user_contest_count > 0 ? "竞赛#{user_contest_count}".html_safe : "竞赛",
user_contest_community_path(User.current), :id => "user_contest_list", :target => "_blank" %>
<%# end %>
<% end %>
<% else %>
Ta在确实
<%= time_tag(@user.created_on).html_safe %>
<% if hidden_unproject_infos && user_course_count > 0 %>
-
<%= link_to user_course_count > 0 ? "课程#{user_course_count}".html_safe : "课程",
user_course_community_path(@user), :id => "user_course_list", :class => "fl", :target => "_blank" %>
<% end %>
<% if user_project_count > 0 %>
-
<%= link_to user_project_count > 0 ? "项目#{user_project_count}".html_safe : "项目",
user_project_community_path(@user), :id => 'user_project_list', :class => "fl", :target => "_blank" %>
<% end %>
<% if hidden_unproject_infos && user_contest_count > 0 %>
-
<%= link_to user_contest_count > 0 ? "竞赛#{user_contest_count}".html_safe : "竞赛",
user_contest_community_path(@user), :id => 'user_contest_list', :class => "fl", :target => "_blank" %>
<% end %>
<% end %>
-
<%= link_to "留言", feedback_path(@user, :host=> Setting.host_user)%>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>