<div id="sidebar">
        <% # show active items before hidden / completed items -%>

	<%= render :partial => "sidebar/project_list",
	           :locals => { :list_name => 'Active Projects',
	           				:projects => @projects.select{|p| p.active? } } -%>
	
	<%= render :partial => "sidebar/context_list",
	           :locals => { :list_name => 'Active Contexts',
	           				:contexts => @contexts.reject{|c| c.hide? } } -%>

	<% if prefs.show_hidden_projects_in_sidebar -%>
        <%= render :partial => "sidebar/project_list",
                   :locals => { :list_name => 'Hidden Projects',
			 			  :projects => @projects.select{|p| p.hidden? } } -%>
	<% end -%>

	<% if prefs.show_completed_projects_in_sidebar -%>
        <%= render :partial => "sidebar/project_list",
                   :locals => { :list_name => 'Completed Projects',
             			  :projects => @projects.select{|p| p.completed? } } -%>
	<% end -%>

	<% if prefs.show_hidden_contexts_in_sidebar -%>
	<%= render :partial => "sidebar/context_list",
	           :locals => { :list_name => 'Hidden Contexts',
	           				:contexts => @contexts.select{|c| c.hide? } } -%>
	<% end -%>
	
	<div class="integrations-link"><ul>
	  <li><%= link_to 'Integrate Tracks', integrations_path %></li>
	  <li><%= link_to 'REST API Docs', url_for(:controller => 'integrations', :action => 'rest_api') %></li>
	</ul></div>

</div>