<% content_for :header_tags do %>
    <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<%= javascript_include_tag 'projects_index', :plugin => 'redmine_tags' %>


<div class="contextual">
    <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
    <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
</div>



<div style="clear:both;"></div>
<% if User.current.logged? %>
  <%= render :partial => 'my_projects' %>
<% end %>

<div style="clear:both;"></div>
<h2>
  <%= l("label_project_all") %>
</h2>

<div style="clear:both;"></div>
<% form_remote_tag(:controller => :projects, :action => :index, :method => :get, :id => :project_filtering) do %>

<% if @filter_status=="true" %>
<fieldset id="filters_fieldset" class="collapsible">
  <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend>
<% else %>
  <fieldset id="filters_fieldset" class="collapsible collapsed">
    <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend>
      <div style="display: none;">
<% end %>
    <div>
      <p class='q'>
        <%= label_tag 'q', l('project_filtering_q_label') %>
        <%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %>
      </p>

      <div id='filter_tags'>
        <%= render :partial => 'filter_search_tags' %>
      </div>

      <p class='buttons'><%= submit_tag( l('button_filter'), :id => 'filter_button') -%></p>                  
    </div>
  </fieldset>
<% end %>

<div id="projects">
  <%= render :partial => 'filtered_projects' %>
</div>

<p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>


<% other_formats_links do |f| %>
	<%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<% end %>

<% html_title(l(:label_project_plural)) -%>
