mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
remove option to show empty containers and start fixing failing cucumber scenarios
This commit is contained in:
parent
22b371ef8c
commit
ede898120c
11 changed files with 24 additions and 43 deletions
|
|
@ -329,12 +329,6 @@ var TracksPages = {
|
||||||
refresh_page();
|
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 */
|
/* fade flashes and alerts in automatically */
|
||||||
$(".alert").fadeOut(8000);
|
$(".alert").fadeOut(8000);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ class TodosController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@source_view = params['_source_view'] || 'todo'
|
@source_view = params['_source_view'] || 'todo'
|
||||||
@group_view_by = cookies['group_view_by'] || 'context'
|
@group_view_by = cookies['group_view_by'] || 'context'
|
||||||
@show_empty_containers = (cookies['show_empty_containers']=="true") || false
|
|
||||||
|
|
||||||
init_data_for_sidebar unless mobile?
|
init_data_for_sidebar unless mobile?
|
||||||
|
|
||||||
|
|
@ -934,7 +933,6 @@ class TodosController < ApplicationController
|
||||||
@tag_title = @single_tag ? @tag_name : tag_title(@tag_expr)
|
@tag_title = @single_tag ? @tag_name : tag_title(@tag_expr)
|
||||||
|
|
||||||
@group_view_by = cookies['group_view_by'] || 'context'
|
@group_view_by = cookies['group_view_by'] || 'context'
|
||||||
@show_empty_containers = (cookies['show_empty_containers']=="true") || false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_ids_from_tag_expr(tag_expr)
|
def get_ids_from_tag_expr(tag_expr)
|
||||||
|
|
|
||||||
|
|
@ -17,17 +17,6 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
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)
|
def container_toggle(id)
|
||||||
link_to(
|
link_to(
|
||||||
image_tag("blank.png", :alt => t('common.collapse_expand')),
|
image_tag("blank.png", :alt => t('common.collapse_expand')),
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ module TodosHelper
|
||||||
:object => todos_without_project,
|
:object => todos_without_project,
|
||||||
:locals => {:settings => {
|
:locals => {:settings => {
|
||||||
:collapsible => true,
|
:collapsible => true,
|
||||||
:container_name => "without_project"
|
:container_name => "without_project",
|
||||||
|
:parent_container_type => "home"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -457,13 +458,13 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def item_container_id (todo)
|
def item_container_id (todo)
|
||||||
return "hiddenitems" if source_view_is(:tag) && todo.hidden?
|
return "hidden_items" if source_view_is(:tag) && todo.hidden?
|
||||||
return "c#{todo.context_id}items" if source_view_is :deferred
|
return "c#{todo.context_id}_items" if source_view_is :deferred
|
||||||
return @new_due_id if source_view_is :calendar
|
return @new_due_id if source_view_is :calendar
|
||||||
return "tickleritems" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
return "tickler_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
||||||
return "completed_containeritems" if todo.completed?
|
return "completed_container_items" if todo.completed?
|
||||||
return "p#{todo.project_id}items" if source_view_is :project
|
return "p#{todo.project_id}_items" if source_view_is :project
|
||||||
return "c#{todo.context_id}items"
|
return "c#{todo.context_id}_items"
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty_container_msg_div_id(todo = @todo || @successor)
|
def empty_container_msg_div_id(todo = @todo || @successor)
|
||||||
|
|
@ -472,12 +473,12 @@ module TodosHelper
|
||||||
source_view do |page|
|
source_view do |page|
|
||||||
page.project {
|
page.project {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "tickler-empty-nd" if empty_criteria_met
|
||||||
return "p#{todo.project_id}empty-nd"
|
return "p#{todo.project_id}-empty-d"
|
||||||
}
|
}
|
||||||
page.tag {
|
page.tag {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "tickler-empty-nd" if empty_criteria_met
|
||||||
return "hidden-empty-nd" if @todo.hidden?
|
return "hidden-empty-nd" if @todo.hidden?
|
||||||
return "c#{todo.context_id}empty-nd"
|
return "c#{todo.context_id}-empty-d"
|
||||||
}
|
}
|
||||||
page.calendar {
|
page.calendar {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "tickler-empty-nd" if empty_criteria_met
|
||||||
|
|
@ -485,11 +486,11 @@ module TodosHelper
|
||||||
}
|
}
|
||||||
page.context {
|
page.context {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "tickler-empty-nd" if empty_criteria_met
|
||||||
return "c#{todo.context_id}empty-nd"
|
return "c#{todo.context_id}-empty-d"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return "c#{todo.context_id}empty-nd"
|
return "c#{todo.context_id}-empty-d"
|
||||||
end
|
end
|
||||||
|
|
||||||
def empty_criteria_met
|
def empty_criteria_met
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d"), @tag_name] d
|
||||||
:collapsible => settings[:collapsible],
|
:collapsible => settings[:collapsible],
|
||||||
:container_name => 'context',
|
:container_name => 'context',
|
||||||
:title => show_context_name(context),
|
:title => show_context_name(context),
|
||||||
:show_empty_containers => @show_empty_containers
|
:show_empty_containers => settings[:show_empty_containers]
|
||||||
}}
|
}}
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
done_todo_options = {:append_descriptor => suffix_completed, :suppress_context => true, :parent_container_type => 'context'}
|
done_todo_options = {:append_descriptor => suffix_completed, :suppress_context => true, :parent_container_type => 'context'}
|
||||||
-%>
|
-%>
|
||||||
<div id="display_box">
|
<div id="display_box">
|
||||||
<%= 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) %>
|
<%= show_deferred_pending_todos(@deferred_todos, @pending_todos, deferred_pending_options) %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@
|
||||||
<li><%= navigation_link( t('layouts.navigation.stats'), stats_path, :title => t('layouts.navigation.stats_title')) %></li>
|
<li><%= navigation_link( t('layouts.navigation.stats'), stats_path, :title => t('layouts.navigation.stats_title')) %></li>
|
||||||
<li><hr/></li>
|
<li><hr/></li>
|
||||||
<%= group_view_by_menu_entry %>
|
<%= group_view_by_menu_entry %>
|
||||||
<%= show_empty_containers_menu_entry %>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#"><%= t('layouts.navigation.admin') %></a>
|
<li><a href="#"><%= t('layouts.navigation.admin') %></a>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
<%= show_grouped_todos %>
|
<%= show_grouped_todos %>
|
||||||
|
|
||||||
<% if @group_view_by == 'context' -%>
|
<% if @group_view_by == 'project' -%>
|
||||||
<%= show_todos_without_project(@todos_with_project) unless @todos_without_project.nil? -%>
|
<%= show_todos_without_project(@todos_without_project) unless @todos_without_project.nil? -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<%= show_done_todos(@done, {:collapsible => true}) unless @done.nil? %>
|
<%= show_done_todos(@done, {:collapsible => true}) unless @done.nil? %>
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ function html_for_todo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_for_new_context() {
|
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() {
|
function html_for_error_messages() {
|
||||||
|
|
@ -118,7 +118,7 @@ function update_predecessors(next_steps) {
|
||||||
<% if @removed_predecessors
|
<% if @removed_predecessors
|
||||||
@removed_predecessors.each do |p| -%>
|
@removed_predecessors.each do |p| -%>
|
||||||
if ($('#<%=item_container_id(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 -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
@ -131,7 +131,7 @@ function regenerate_predecessor_family() {
|
||||||
until parents.empty?
|
until parents.empty?
|
||||||
parent = parents.pop
|
parent = parents.pop
|
||||||
parents += parent.predecessors -%>
|
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
|
<%end
|
||||||
-%>
|
-%>
|
||||||
}
|
}
|
||||||
|
|
@ -434,7 +434,7 @@ en:
|
||||||
actions:
|
actions:
|
||||||
completed: Completed actions
|
completed: Completed actions
|
||||||
tag_completed: "Completed actions tagged with '%{param}'"
|
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_project: "Actions in this project"
|
||||||
project_deferred_pending: Deferred/pending actions in this project
|
project_deferred_pending: Deferred/pending actions in this project
|
||||||
context_deferred_pending: Deferred/pending actions in this context
|
context_deferred_pending: Deferred/pending actions in this context
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ Feature: Edit a context
|
||||||
And I have a project called "test project"
|
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 "
|
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
|
Scenario: In place edit of context name
|
||||||
Given I have a context called "Errands"
|
Given I have a context called "Errands"
|
||||||
When I go to the context page for "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
|
Then I should see that a context named "Errands" is not present
|
||||||
And I should see that a context named "OutAndAbout" is 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
|
Scenario: Editing the context of a todo will remove the todo
|
||||||
When I go to the the context page for "@pc"
|
When I go to the the context page for "@pc"
|
||||||
Then the badge should show 2
|
Then the badge should show 2
|
||||||
|
|
@ -30,7 +30,7 @@ Feature: Edit a context
|
||||||
Then I should not see the todo "todo 1"
|
Then I should not see the todo "todo 1"
|
||||||
And the badge should show 1
|
And the badge should show 1
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Editing the description of a a todo will update that todo
|
Scenario: Editing the description of a a todo will update that todo
|
||||||
When I go to the the context page for "@pc"
|
When I go to the the context page for "@pc"
|
||||||
And I edit the description of "test_project todo 1" to "changed"
|
And I edit the description of "test_project todo 1" to "changed"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue