tracks/tracks/app/views/shared/sidebar.rhtml

45 lines
2 KiB
Text
Raw Normal View History

<h3>Active Projects:</h3>
<ul>
<% for project in @projects.select{|p| p.active? } -%>
<li id="sidebar-project-<%= project.id %>" class="sidebar-project"><%= link_to( sanitize(project.name), { :controller => "project", :action => "show",
:name => urlize(project.name) } ) + " (" + count_undone_todos(project,"actions") + ")" %></li>
<% end -%>
</ul>
<% if @user.preference.show_hidden_projects_in_sidebar %>
<h3>Hidden Projects:</h3>
<ul>
<% for project in @projects.select{|p| p.hidden? } -%>
<li id="sidebar-project-<%= project.id %>" class="sidebar-project"><%= link_to( sanitize(project.name), { :controller => "project", :action => "show", :name => urlize(project.name) } ) + " (" + count_undone_todos(project,"actions") + ")" %></li>
<% end -%>
</ul>
<% end %>
<% if @user.preference.show_completed_projects_in_sidebar %>
<h3>Completed Projects:</h3>
<ul>
<% for project in @projects.select{|p| p.completed? } -%>
<li id="sidebar-project-<%= project.id %>" class="sidebar-project"><%= link_to( sanitize(project.name), { :controller => "project", :action => "show",
:name => urlize(project.name) } ) + " (" + count_undone_todos(project,"actions") + ")" %></li>
<% end -%>
</ul>
<% end %>
<h3>Active Contexts:</h3>
<ul>
<% for context in @contexts.reject{|c| c.hide? } -%>
<li id="sidebar-context-<%= context.id %>" class="sidebar-context"><%= link_to( sanitize(context.name), { :controller => "context", :action => "show",
:name => urlize(context.name) } ) + " (" + count_undone_todos(context,"actions") + ")" %></li>
<% end -%>
</ul>
<% if @user.preference.show_hidden_contexts_in_sidebar %>
<h3>Hidden Contexts:</h3>
<ul>
<% for context in @contexts.reject{|c| !c.hide? } -%>
<li id="sidebar-context-<%= context.id %>" class="sidebar-context"><%= link_to( sanitize(context.name), { :controller => "context", :action => "show",
:name => urlize(context.name) } ) + " (" + count_undone_todos(context,"actions") + ")" %></li>
<% end -%>
</ul>
<% end %>