<% unless projects.empty? %>
<% if @type.to_i == 2 %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
<% else %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
<% end %>
<%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "sortTxt fr", :remote => true %>
<% if @type.to_i == 1 %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
<% else %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "sortdownbtn sort_no fr", :remote => true %>
<% end %>
<%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "sortTxt fr", :remote => true %>
<% end %>
<%= @user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目
<% if projects.empty? %>
<% if list_type == 1 %>
<%=@user == User.current ? "您" : "他" %>还没有创建项目~~
<%= link_to "创建项目", new_project_path(:host => Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
<% else %>
<%=@user == User.current ? "您" : "他" %>还没有加入项目~~
<%= link_to "加入项目", applied_join_project_path, :remote => true, :method => "post", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
<% end %>
<% else %>
<% projects.each_with_index do |project, i| %>
<% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public? %>
<%=render :partial => 'collect_project', :locals => {:project => project} %>
<%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %>
<%# unless project.is_public? %>
<%# end %>
<%= project.is_public? ? '公开' : '私有' %>
<% projectUser = User.where("id=?",project.user_id).first %>
<%= link_to "
创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}".html_safe, user_path(projectUser) %>
更新时间:<%= format_date(project.updatetime) %>
<%= link_to project.members.count, member_project_path(project), :class => "c_blue" %>成员 |
<%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %>问题 |
<%= link_to project.project_score.attach_num, project_files_path(project), :class => "c_blue" %>资源
<% end %>
<% if count > 5 %>
<% end %>
<% end %>