<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>