<%= csrf_meta_tag %> <%= favicon %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'share','new_user', 'user_leftside','prettify','users',:media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%>
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %> <% if User.current.logged?%> <% if is_current_user%>
<% end %> <% end%>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %> <% end %>
<% if @user.user_extensions && @user.user_extensions.identity %>

<%= get_user_roll @user %>

<% end%>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
<%# 更新访问数,刷新的时候更新访问次数 %> <% update_visiti_count @user %> <%# over %>

<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>

<%= link_to(@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count, {:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
<%= link_to('博客', {:controller => 'blogs', :action => 'index', :user_id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
<%= link_to '关注', {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
<%= link_to '粉丝', {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
<% hidden_courses = Setting.find_by_name("hidden_courses") %> <% unvisiable = hidden_courses && hidden_courses.value == "1"%> <% if !unvisiable %>
<%= link_to '课程',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "homepageMenuText" %> <% if is_current_user%> <% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
    • <%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
    • <%= link_to "加入课程",join_private_courses_courses_path,:remote => true,:class => "menuGrey",:method => "post"%>
<% else%> <%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%> <% end%> <% end%>
<% end %> <%# if @user.courses.visible.count > 0 course_order_ids = "(" + CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM (SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ") GROUP BY ca.course_id) AS c ORDER BY c.updated_at DESC limit 5").map {|c| c.course_id}.join(",") + ")" courses = Course.where("id in #{course_order_ids}") else courses = [] end %> <% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
    <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
<% if !courses.empty? %>
<% end %>
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => "homepageMenuText" %> <% if is_current_user%> <%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%> <% end%>
<%# if @user.projects.visible.count > 0 project_order_ids = "(" + ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM (SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ") GROUP BY fa.project_id) AS p ORDER BY p.created_at DESC limit 5").map {|p| p.project_id}.join(",") + ")" projects = Project.where("projects.id in #{project_order_ids}") else projects = [] end %> <% projects = @user.projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
    <%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
<% if !projects.empty? %>
<% end %>
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
标签
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
访问计数 <%= @user.visits.to_i %>
<%= yield %>
<%= render :partial => 'layouts/new_feedback' %>
<%= render :partial => 'layouts/footer' %>