diff --git a/app/assets/javascripts/tracks.js b/app/assets/javascripts/tracks.js index 5d867ff0..87361fb8 100644 --- a/app/assets/javascripts/tracks.js +++ b/app/assets/javascripts/tracks.js @@ -329,12 +329,6 @@ var TracksPages = { refresh_page(); }); - $("a#show_empty_containers").click(function () { - var show = ($(this).attr("x_show_empty_containers") == "true"); - $.cookie('show_empty_containers', !show); - refresh_page(); - }); - /* fade flashes and alerts in automatically */ $(".alert").fadeOut(8000); } diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 24ec64f2..db0239f2 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -9,7 +9,6 @@ class TodosController < ApplicationController def index @source_view = params['_source_view'] || 'todo' @group_view_by = cookies['group_view_by'] || 'context' - @show_empty_containers = (cookies['show_empty_containers']=="true") || false init_data_for_sidebar unless mobile? @@ -934,7 +933,6 @@ class TodosController < ApplicationController @tag_title = @single_tag ? @tag_name : tag_title(@tag_expr) @group_view_by = cookies['group_view_by'] || 'context' - @show_empty_containers = (cookies['show_empty_containers']=="true") || false end def get_ids_from_tag_expr(tag_expr) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e4397553..1b63eeb0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,17 +17,6 @@ module ApplicationHelper end end - def show_empty_containers_menu_entry - @show_empty_containers ||= false - @group_view_by ||= 'context' - content_tag(:li) do - link_to( - t("layouts.navigation.show_empty_containers_#{@group_view_by}"), - '#', - {:id => "show_empty_containers", :accesskey => "s", :title => t('layouts.navigation.show_empty_containers_title'), :x_show_empty_containers => @show_empty_containers} ) - end - end - def container_toggle(id) link_to( image_tag("blank.png", :alt => t('common.collapse_expand')), diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 87926aba..6c0179c7 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -66,7 +66,8 @@ module TodosHelper :object => todos_without_project, :locals => {:settings => { :collapsible => true, - :container_name => "without_project" + :container_name => "without_project", + :parent_container_type => "home" } } end @@ -457,13 +458,13 @@ module TodosHelper end def item_container_id (todo) - return "hiddenitems" if source_view_is(:tag) && todo.hidden? - return "c#{todo.context_id}items" if source_view_is :deferred - return @new_due_id if source_view_is :calendar - return "tickleritems" if !source_view_is(:todo) && (todo.deferred? || todo.pending?) - return "completed_containeritems" if todo.completed? - return "p#{todo.project_id}items" if source_view_is :project - return "c#{todo.context_id}items" + return "hidden_items" if source_view_is(:tag) && todo.hidden? + return "c#{todo.context_id}_items" if source_view_is :deferred + return @new_due_id if source_view_is :calendar + return "tickler_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?) + return "completed_container_items" if todo.completed? + return "p#{todo.project_id}_items" if source_view_is :project + return "c#{todo.context_id}_items" end def empty_container_msg_div_id(todo = @todo || @successor) @@ -472,12 +473,12 @@ module TodosHelper source_view do |page| page.project { return "tickler-empty-nd" if empty_criteria_met - return "p#{todo.project_id}empty-nd" + return "p#{todo.project_id}-empty-d" } page.tag { return "tickler-empty-nd" if empty_criteria_met return "hidden-empty-nd" if @todo.hidden? - return "c#{todo.context_id}empty-nd" + return "c#{todo.context_id}-empty-d" } page.calendar { return "tickler-empty-nd" if empty_criteria_met @@ -485,11 +486,11 @@ module TodosHelper } page.context { return "tickler-empty-nd" if empty_criteria_met - return "c#{todo.context_id}empty-nd" + return "c#{todo.context_id}-empty-d" } end - return "c#{todo.context_id}empty-nd" + return "c#{todo.context_id}-empty-d" end def empty_criteria_met diff --git a/app/views/contexts/_context.html.erb b/app/views/contexts/_context.html.erb index 096625a7..101fd33c 100644 --- a/app/views/contexts/_context.html.erb +++ b/app/views/contexts/_context.html.erb @@ -13,7 +13,7 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d"), @tag_name] d :collapsible => settings[:collapsible], :container_name => 'context', :title => show_context_name(context), - :show_empty_containers => @show_empty_containers + :show_empty_containers => settings[:show_empty_containers] }} %> diff --git a/app/views/contexts/show.html.erb b/app/views/contexts/show.html.erb index 7aca31c7..b800c1ab 100644 --- a/app/views/contexts/show.html.erb +++ b/app/views/contexts/show.html.erb @@ -4,7 +4,7 @@ done_todo_options = {:append_descriptor => suffix_completed, :suppress_context => true, :parent_container_type => 'context'} -%>
- <%= render :partial => @context, :locals => { :settings => {:collapsible => false }} %> + <%= render :partial => @context, :locals => { :settings => {:collapsible => false, :show_empty_containers => true }} %> <%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f9acfdab..46e6a1ae 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -73,7 +73,6 @@
  • <%= navigation_link( t('layouts.navigation.stats'), stats_path, :title => t('layouts.navigation.stats_title')) %>

  • <%= group_view_by_menu_entry %> - <%= show_empty_containers_menu_entry %>
  • <%= t('layouts.navigation.admin') %> diff --git a/app/views/todos/index.html.erb b/app/views/todos/index.html.erb index 260128bf..547d6296 100644 --- a/app/views/todos/index.html.erb +++ b/app/views/todos/index.html.erb @@ -3,8 +3,8 @@ <%= show_grouped_todos %> - <% if @group_view_by == 'context' -%> - <%= show_todos_without_project(@todos_with_project) unless @todos_without_project.nil? -%> + <% if @group_view_by == 'project' -%> + <%= show_todos_without_project(@todos_without_project) unless @todos_without_project.nil? -%> <% end -%> <%= show_done_todos(@done, {:collapsible => true}) unless @done.nil? %> diff --git a/app/views/todos/update.js.erb b/app/views/todos/update.js.erb index f5c214fb..2e270f3d 100644 --- a/app/views/todos/update.js.erb +++ b/app/views/todos/update.js.erb @@ -106,7 +106,7 @@ function html_for_todo() { } function html_for_new_context() { - return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @new_context, :locals => { :collapsible => true })) : "" %>"; + return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @new_context, :locals => { :settings => {:collapsible => true }})) : "" %>"; } function html_for_error_messages() { @@ -118,7 +118,7 @@ function update_predecessors(next_steps) { <% if @removed_predecessors @removed_predecessors.each do |p| -%> if ($('#<%=item_container_id(p)%>')) { - $('#<%=dom_id(p)%>').html('<%=escape_javascript(render(:partial => p, :locals => { :parent_container_type => parent_container_type }))%>'); + $('#<%=dom_id(p)%>').html('<%=escape_javascript(render(:partial => p, :locals => { :settings => {:parent_container_type => parent_container_type }}))%>'); } <% end -%> <% end -%> @@ -131,7 +131,7 @@ function regenerate_predecessor_family() { until parents.empty? parent = parents.pop parents += parent.predecessors -%> - $('#<%= dom_id(parent) %>').html("<%= escape_javascript(render(:partial => parent, :locals => { :parent_container_type => parent_container_type })) %>"); + $('#<%= dom_id(parent) %>').html("<%= escape_javascript(render(:partial => parent, :locals => { :settings => {:parent_container_type => parent_container_type }})) %>"); <%end -%> } \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index fccd20a6..7a22bf9c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -434,7 +434,7 @@ en: actions: completed: Completed actions tag_completed: "Completed actions tagged with '%{param}'" - without_project: "Actions without project" + home_without_project: "Actions without project" project_project: "Actions in this project" project_deferred_pending: Deferred/pending actions in this project context_deferred_pending: Deferred/pending actions in this context diff --git a/features/context_edit.feature b/features/context_edit.feature index 18aad0fe..580e74fe 100644 --- a/features/context_edit.feature +++ b/features/context_edit.feature @@ -12,7 +12,7 @@ Feature: Edit a context And I have a project called "test project" And I have 2 todos in project "test project" in context "@pc" with tags "starred" prefixed by "test_project " - @javascript + @javascript Scenario: In place edit of context name Given I have a context called "Errands" When I go to the context page for "Errands" @@ -22,7 +22,7 @@ Feature: Edit a context Then I should see that a context named "Errands" is not present And I should see that a context named "OutAndAbout" is present - @javascript + @javascript Scenario: Editing the context of a todo will remove the todo When I go to the the context page for "@pc" Then the badge should show 2 @@ -30,7 +30,7 @@ Feature: Edit a context Then I should not see the todo "todo 1" And the badge should show 1 - @javascript + @javascript Scenario: Editing the description of a a todo will update that todo When I go to the the context page for "@pc" And I edit the description of "test_project todo 1" to "changed"