<div class="syllabus_box">
  <h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>项目列表</h2>
  <div class="syllabus_category">
    <a class="sortdownbtn sort_no fr"></a><a href="#" class="sortTxt fr">人气</a>
    <a class="sortupbtn fr"></a><a href="#" class="sortTxt fr ">时间</a>
    <span class="grayTxt fl ">我创建的项目</span>
    <div class="cl"></div>
  </div>
  <div class="syllabus_courses_box">
    <% @projects.each do |project|%>
        <div class="syllabus_courses_list" style="cursor: default">
          <div class="sy_courses_open">
            <span class="icons_project_list fl mt5 mr10"></span>
            <h3><%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目：":"私有项目：") + project.name%></h3>
            <% unless project.is_public? %>
                <span class="hw_icon_private fl"></span>
            <% end %>
            <% projectUser = User.where("id=?",project.user_id).first %>
            <%=link_to "<span class='fr grayTxt'>创建者：#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
            <div class="cl"></div>
          </div>
          <div>
            <p class="fl sy_p_grey">更新时间：<%= format_date(project.updated_on) %></p>
            <div class=" fr">
              <p class="list-info fr grayTxt">
                <%= link_to project.members.count, member_project_path(project), :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span>
                <%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span>
                <%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %><span class="mr5">资源</span>
              </p>
            </div>
          </div>
          <div class="cl"></div>
        </div>
    <% end %>

    <div class="syllabus_courses_list ">
      <p class="new_projectlist_more"><a href="javascript:void(0);" >共100个项目，点击全部展开</a></p>
    </div>
  </div><!--syllabus_courses_box end-->
</div><!--syllabus_box end-->

<div class="" style="height:20px; background:#eaebec;"></div>
<div class="syllabus_box">
  <div class="syllabus_category">
    <a class="sortdownbtn sort_no fr"></a><a href="#" class="sortTxt fr">人气</a>
    <a class="sortupbtn fr"></a><a href="#" class="sortTxt fr ">时间</a>
    <span class="grayTxt fl ">我参与的项目</span>
    <div class="cl"></div>
  </div>
  <div class="syllabus_courses_box">
    <% @projects.each do |project| %>
        <div class="syllabus_courses_list" style="cursor: default;">
          <div class="sy_courses_open">
            <span class="icons_project_list fl mt5 mr10"></span>
            <h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目：":"私有项目：") + project.name%></h3>
            <% unless project.is_public? %>
                <span class="hw_icon_private fl"></span>
            <% end %>
            <% projectUser = User.where("id=?",project.user_id).first %>
            <%=link_to "<span class='fr grayTxt'>创建者：#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
            <div class="cl"></div>
          </div>
          <div>
            <p class="fl sy_p_grey">更新时间：<%= format_date(project.updated_on) %></p>
            <div class=" fr">
              <p class="list-info fr grayTxt">
                <%= link_to project.members.count, member_project_path(project), :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span>
                <%= link_to project.project_score.issue_num, project_issues_path(project), :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span>
                <%= link_to project.project_score.attach_num, file_project_path(project), :class => "c_blue" %><span class="mr5">资源</span>
              </p>
            </div>
          </div>
          <div class="cl"></div>
        </div>
    <% end %>
    <div class="syllabus_courses_list ">
      <p class="new_projectlist_more"><a href="javascript:void(0);" >共100个项目，点击全部展开</a></p>
    </div>
  </div><!--syllabus_courses_box end-->
</div><!--syllabus_box end-->



<div class="listbox" id="project-list">
  <h2 class="list-h2">项目列表</h2>
  <div class="category">
    <span class="grayTxt ">排序：</span>
    <%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type,  :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
    <% if @type.to_i == 1 %>
        <%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type,  :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
    <% end %>
    <%= link_to "人气", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type,  :sort => @c_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
    <% if @type.to_i  == 2 %>
        <%= link_to "", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type,  :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
    <% end %>
    <div class="cl"></div>
  </div>

  <div class="bloglistbox">
    <% if @projects.any? %>
        <% @projects.each do |project|%>
            <ul class="list-file">
              <li>
                <span class="item_list fl"></span>
                <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目：":"私有项目：") + project.name%>
                <% projectUser = User.where("id=?",project.user_id).first%>
                <span class="fr grayTxt">
                    <%='创建者：'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
                </span>
              </li>
              <div class="cl"></div>
              <li class="ml15">
                <!--<span class="grayTxt">创建时间：<%#= format_time(project.created_on) %></span>-->
                <span class="grayTxt">更新：<%= format_time(project.updated_at) %></span>
                <p class="list-info fr grayTxt"><span><%= project.project_score.issue_num %></span><span>问题</span><span>|</span><span> <%= project.project_score.attach_num %></span><span>资源</span></p>
              </li>
              <div class="cl"></div>
            </ul>
        <% end %>
        <div>
          <ul class="wlist" id="pages" >
            <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
          </ul>
          <div class="cl"></div>
        </div>
    <% else %>
        <p class="nodata"><%= l(:label_no_data) %></p>
    <% end %>
  </div>
</div>

<script type="text/javascript">
    //如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
    $(function() {
        var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
        var rightHeight = $(".homepageRight").height();
        if (rightHeight < leftHeight) {
            var diffHeight = leftHeight - rightHeight;
            var tmpHeight = $(".listbox").height() + diffHeight;
            $(".listbox").css("height", tmpHeight);
        }
    });
</script>