mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-24 16:14:07 +01:00
initial changes to add an option to select either context or project as grouping of todos on home or tag page
* new menu item in view menu * js to toggle view * store setting in cookie to keep de choice of view persistent * refactor index and tag page of todos to look more alike * refactor context and project partials to look more alike
This commit is contained in:
parent
55aa387ab9
commit
f22dfc1f9b
15 changed files with 160 additions and 84 deletions
|
|
@ -1,21 +1,16 @@
|
|||
<%
|
||||
@not_done = @not_done_todos.select {|t| t.project_id == project.id }
|
||||
# invalidate the cache every day because of staleness or
|
||||
# rendering of "due in x days" that change without touching updated at of the todo
|
||||
cache [project, current_user.date.strftime("%Y%m%d")] do %>
|
||||
<div class="container">
|
||||
<h2 id="project_name_container">
|
||||
<% if collapsible -%>
|
||||
<a href="#" class="container_toggle" id="toggle_p<%= project.id %>"><%= image_tag("blank.png", :alt => t('common.collapse_expand')) %></a>
|
||||
<% end -%>
|
||||
<div id="project_name" style="width: 100%;"><%= project.name -%></div>
|
||||
</h2>
|
||||
<div id="<%= dom_id(project, "container")%>" class="list">
|
||||
<%= render :partial => "projects/project_settings", :object => project, :locals => { :collapsible => collapsible } %>
|
||||
</div>
|
||||
</div>
|
||||
cache [project, @source_view, current_user.date.strftime("%Y%m%d")] do
|
||||
%>
|
||||
<%= render :partial => "project_settings_container", :locals => {:project => project} if source_view_is :project %>
|
||||
|
||||
<div class="container">
|
||||
<h2><%= t('projects.actions_in_project_title') %></h2>
|
||||
<div id="p<%= project.id %>" class="container project" style="display:<%= (collapsible && @not_done.empty?) ? "none" : "block" %>">
|
||||
<h2>
|
||||
<%= container_toggle("toggle_p#{project.id}") if collapsible %>
|
||||
<%= source_view_is(:project) ? t('projects.actions_in_project_title') : show_project_name(project) %>
|
||||
</h2>
|
||||
<div id="p<%= project.id %>items" class="items toggle_target">
|
||||
<div id="p<%= project.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
|
||||
<div class="message"><p><%= t('projects.no_actions_in_project') %></p></div>
|
||||
|
|
@ -23,4 +18,5 @@ cache [project, current_user.date.strftime("%Y%m%d")] do %>
|
|||
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue