<div class="project-state-group" id="list-<%= state %>-projects-container" <%= " style=\"display:none\"" if project_state_group.empty? %>>
  <h2><span id="<%= state %>-projects-count" class="badge"><%= project_state_group.length %></span><%= state.titlecase %> Projects</h2>
  <div class="alpha_sort">
    <%= link_to("Sort Alphabetically", alphabetize_projects_path(:state => state),
                 :class => "alphabetize_link", :title => "Sort these projects alphabetically") %>
    <%  apply_behavior '.alphabetize_link:click', :prevent_default => true do |page|
          page << "if (confirm('Are you sure that you want to sort these projects alphabetically? This will replace the existing sort order.')) {"
          page << "  new Ajax.Request(this.href, { asynchronous : true, evalScripts : true, method : 'post' })"
          page << "}"
        end
     %></div>
  
  <div id="list-<%= state %>-projects">
    <%= render :partial => 'project_listing', :collection => project_state_group %>
  </div>
  <%= sortable_element "list-#{state}-projects", get_listing_sortable_options("list-#{state}-projects") %>
</div>