mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
get all scenario's running again, first pass.
This commit is contained in:
parent
ede898120c
commit
0a9755c8a3
27 changed files with 90 additions and 90 deletions
|
|
@ -73,10 +73,9 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def todos_container(settings={})
|
def todos_container(settings={})
|
||||||
container_name = settings[:container_name]
|
|
||||||
settings.reverse_merge!({
|
settings.reverse_merge!({
|
||||||
:id => "#{container_name}_container",
|
:id => "#{settings[:container_name]}_container",
|
||||||
:class => "container #{container_name}",
|
:class => "container #{settings[:container_name]}",
|
||||||
})
|
})
|
||||||
|
|
||||||
content_tag(:div,
|
content_tag(:div,
|
||||||
|
|
@ -93,7 +92,7 @@ module TodosHelper
|
||||||
})
|
})
|
||||||
header = settings[:link_in_header].nil? ? "" : content_tag(:div, :class=>"add_note_link"){settings[:link_in_header]}
|
header = settings[:link_in_header].nil? ? "" : content_tag(:div, :class=>"add_note_link"){settings[:link_in_header]}
|
||||||
header += content_tag(:h2) do
|
header += content_tag(:h2) do
|
||||||
toggle = settings[:collapsible] ? container_toggle("toggle_#{settings[:container_name]}") : ""
|
toggle = settings[:collapsible] ? container_toggle("toggle_#{settings[:id]}") : ""
|
||||||
"#{toggle} #{settings[:title]} #{settings[:append_descriptor]}".html_safe
|
"#{toggle} #{settings[:title]} #{settings[:append_descriptor]}".html_safe
|
||||||
end
|
end
|
||||||
header.html_safe
|
header.html_safe
|
||||||
|
|
@ -458,12 +457,12 @@ module TodosHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def item_container_id (todo)
|
def item_container_id (todo)
|
||||||
return "hidden_items" if source_view_is(:tag) && todo.hidden?
|
return "hidden_container_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 "tickler_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
return "deferred_pending_container_items" if !source_view_is(:todo) && (todo.deferred? || todo.pending?)
|
||||||
return "completed_container_items" 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
|
||||||
|
|
||||||
|
|
@ -472,20 +471,20 @@ module TodosHelper
|
||||||
|
|
||||||
source_view do |page|
|
source_view do |page|
|
||||||
page.project {
|
page.project {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return "p#{todo.project_id}-empty-d"
|
return "p#{todo.project_id}-empty-d"
|
||||||
}
|
}
|
||||||
page.tag {
|
page.tag {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return "hidden-empty-nd" if @todo.hidden?
|
return "hidden_container-empty-d" if @todo.hidden?
|
||||||
return "c#{todo.context_id}-empty-d"
|
return "c#{todo.context_id}-empty-d"
|
||||||
}
|
}
|
||||||
page.calendar {
|
page.calendar {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return "empty_#{@new_due_id}"
|
return "empty_#{@new_due_id}"
|
||||||
}
|
}
|
||||||
page.context {
|
page.context {
|
||||||
return "tickler-empty-nd" if empty_criteria_met
|
return "deferred_pending_container-empty-d" if empty_criteria_met
|
||||||
return "c#{todo.context_id}-empty-d"
|
return "c#{todo.context_id}-empty-d"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -513,25 +512,25 @@ module TodosHelper
|
||||||
container_id = ""
|
container_id = ""
|
||||||
source_view do |page|
|
source_view do |page|
|
||||||
page.project {
|
page.project {
|
||||||
container_id = "p#{@original_item_project_id}empty-nd" if @remaining_in_context == 0
|
container_id = "p#{@original_item_project_id}-empty-d" if @remaining_in_context == 0
|
||||||
container_id = "tickler-empty-nd" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0
|
container_id = "deferred_pending_container-empty-d" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0
|
||||||
container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
||||||
}
|
}
|
||||||
page.deferred { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 }
|
page.deferred { container_id = "c#{@original_item_context_id}empty-d" if @remaining_in_context == 0 }
|
||||||
page.calendar { container_id = "empty_#{@original_item_due_id}" if @old_due_empty }
|
page.calendar { container_id = "empty_#{@original_item_due_id}" if @old_due_empty }
|
||||||
page.tag {
|
page.tag {
|
||||||
container_id = "hidden-empty-nd" if (@remaining_hidden_count == 0 && !@todo.hidden? && @todo_hidden_state_changed) ||
|
container_id = "hidden_container-empty-d" if (@remaining_hidden_count == 0 && !@todo.hidden? && @todo_hidden_state_changed) ||
|
||||||
(@remaining_hidden_count == 0 && @todo.completed? && @original_item_was_hidden)
|
(@remaining_hidden_count == 0 && @todo.completed? && @original_item_was_hidden)
|
||||||
container_id = "tickler-empty-nd" if (todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0) ||
|
container_id = "deferred_pending_container-empty-d" if (todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0) ||
|
||||||
(@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && (@todo.completed? || @tag_was_removed))
|
(@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && (@todo.completed? || @tag_was_removed))
|
||||||
container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
||||||
}
|
}
|
||||||
page.context {
|
page.context {
|
||||||
container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0
|
container_id = "c#{@original_item_context_id}-empty-d" if @remaining_in_context == 0
|
||||||
container_id = "tickler-empty-nd" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0
|
container_id = "deferred_pending_container-empty-d" if todo_was_removed_from_deferred_or_blocked_container && @remaining_deferred_or_pending_count == 0
|
||||||
container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
container_id = "completed_container-empty-d" if @completed_count && @completed_count == 0 && !@todo.completed?
|
||||||
}
|
}
|
||||||
page.todo { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 }
|
page.todo { container_id = "c#{@original_item_context_id}-empty-d" if @remaining_in_context == 0 }
|
||||||
end
|
end
|
||||||
return container_id.blank? ? "" : "$(\"##{container_id}\").slideDown(100);".html_safe
|
return container_id.blank? ? "" : "$(\"##{container_id}\").slideDown(100);".html_safe
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ cache [project, @source_view, current_user.date.strftime("%Y%m%d")] do
|
||||||
:collapsible => settings[:collapsible],
|
:collapsible => settings[:collapsible],
|
||||||
:title => title,
|
:title => title,
|
||||||
:container_name => 'project',
|
:container_name => 'project',
|
||||||
:show_empty_containers => @show_empty_containers
|
:show_empty_containers => settings[:show_empty_containers]
|
||||||
}}
|
}}
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ function html_for_edit_form() {
|
||||||
function show_edit_form() {
|
function show_edit_form() {
|
||||||
$('<%= selector_edit %>').html(html_for_edit_form());
|
$('<%= selector_edit %>').html(html_for_edit_form());
|
||||||
$('<%= selector_edit %>').fadeIn(500);
|
$('<%= selector_edit %>').fadeIn(500);
|
||||||
$('div#project_name').editable('disable');
|
$('span#project_name').editable('disable');
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_focus() {
|
function set_focus() {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<div id="display_box">
|
<div id="display_box">
|
||||||
<%= project_next_prev %>
|
<%= project_next_prev %>
|
||||||
|
|
||||||
<%= render :partial => @project, :locals => {:settings => {:collapsible => false }} %>
|
<%= render :partial => @project, :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) %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@
|
||||||
<div class="project_description"><%= sanitize(@project.description) %></div>
|
<div class="project_description"><%= sanitize(@project.description) %></div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<ul class="c">
|
<ul class="c">
|
||||||
<%= render :partial => @not_done, :locals => { :parent_container_type => "project" }%>
|
<%= render :partial => @not_done_todos, :locals => { :parent_container_type => "project" }%>
|
||||||
</ul>
|
</ul>
|
||||||
<h2><%= t('projects.deferred_actions')%></h2>
|
<h2><%= t('projects.deferred_actions')%></h2>
|
||||||
<% if @deferred.empty? -%>
|
<% if @deferred_todos.empty? -%>
|
||||||
<%= t('projects.deferred_actions_empty') %>
|
<%= t('projects.deferred_actions_empty') %>
|
||||||
<% else -%>
|
<% else -%>
|
||||||
<ul class="c">
|
<ul class="c">
|
||||||
<%= render :partial => @deferred, :locals => { :parent_container_type => "project" }%>
|
<%= render :partial => @deferred_todos, :locals => { :parent_container_type => "project" }%>
|
||||||
</ul><% end
|
</ul><% end
|
||||||
-%>
|
-%>
|
||||||
<h2><%= t('projects.completed_actions')%></h2>
|
<h2><%= t('projects.completed_actions')%></h2>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ function update_project_page() {
|
||||||
remove_project_edit_form();
|
remove_project_edit_form();
|
||||||
update_and_show_project_settings();
|
update_and_show_project_settings();
|
||||||
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
TracksForm.set_project_name("<%= escape_javascript(@project.name)%>");
|
||||||
$("h2 div#project_name").html("<%= escape_javascript(@project.name)%>");
|
$("h2 span#project_name").html("<%= escape_javascript(@project.name)%>");
|
||||||
<% if @project.default_context %>
|
<% if @project.default_context %>
|
||||||
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>");
|
TracksForm.set_context_name_and_default_context_name("<%= escape_javascript(@project.default_context.name)%>");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<% if @not_done_todos.empty? -%>
|
<% if @not_done_todos.empty? -%>
|
||||||
<p><%= t('todos.no_incomplete_actions') %></p>
|
<p><%= t('todos.no_actions.not_done') %></p>
|
||||||
<% else -%>
|
<% else -%>
|
||||||
<%= render :partial => @contexts_to_show -%>
|
<%= render :partial => @contexts_to_show -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ function replace_updated_predecessor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_in_tickler_box() {
|
function show_in_tickler_box() {
|
||||||
$("#tickler-empty-nd").hide();
|
$("#deferred_pending_container-empty-d").hide();
|
||||||
$('#tickler').append( html_for_todo() );
|
$('#deferred_pending_container').append( html_for_todo() );
|
||||||
}
|
}
|
||||||
|
|
||||||
function regenerate_predecessor_family() {
|
function regenerate_predecessor_family() {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
function insert_new_context_with_new_todo() {
|
function insert_new_context_with_new_todo() {
|
||||||
<%-
|
<%-
|
||||||
empty_id = '#no_todos_in_view'
|
empty_id = '#no_todos_in_view'
|
||||||
empty_id = '#tickler-empty-nd' if source_view_is :tickler
|
empty_id = '#deferred_pending_container-empty-d' if source_view_is :tickler
|
||||||
-%>
|
-%>
|
||||||
$('<%=empty_id%>').slideUp(100);
|
$('<%=empty_id%>').slideUp(100);
|
||||||
$('#display_box').prepend(html_for_new_context());
|
$('#display_box').prepend(html_for_new_context());
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
<% unless source_view_is_one_of(:todo, :tag) && (@todo.deferred?||@todo.hidden?) -%>
|
<% unless source_view_is_one_of(:todo, :tag) && (@todo.deferred?||@todo.hidden?) -%>
|
||||||
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
|
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
|
||||||
$('#no_todos_in_view').slideUp(100);
|
$('#no_todos_in_view').slideUp(100);
|
||||||
<%= "$('#tickler-empty-nd').slideUp(100);".html_safe if source_view_is(:deferred) && @todo.deferred? %>
|
<%= "$('#deferred_pending_container-empty-nd').slideUp(100);".html_safe if source_view_is(:deferred) && @todo.deferred? %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
$('#<%=empty_container_msg_div_id%>').hide();
|
$('#<%=empty_container_msg_div_id%>').hide();
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_for_new_context() {
|
function html_for_new_context() {
|
||||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>";
|
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :settings => {:collapsible => true} })) : "" %>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_for_new_todo() {
|
function html_for_new_todo() {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ function insert_new_context_with_new_todo() {
|
||||||
function hide_empty_message() {
|
function hide_empty_message() {
|
||||||
$('#<%=empty_container_msg_div_id%>').hide();
|
$('#<%=empty_container_msg_div_id%>').hide();
|
||||||
<% if (source_view_is :project and @todo.pending?) or (source_view_is :deferred) -%>
|
<% if (source_view_is :project and @todo.pending?) or (source_view_is :deferred) -%>
|
||||||
$('#tickler-empty-nd').hide();
|
$('#deferred_pending_container-empty-d').hide();
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ function add_todo_to_existing_context() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_for_new_context() {
|
function html_for_new_context() {
|
||||||
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :collapsible => true })) : "" %>";
|
return "<%= @saved && @new_context_created ? escape_javascript(render(:partial => @todo.context, :locals => { :settings => {:collapsible => true} })) : "" %>";
|
||||||
}
|
}
|
||||||
|
|
||||||
<% else # if @saved -%>
|
<% else # if @saved -%>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ function show_empty_messages() {
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% if source_view_is(:deferred) && @down_count==0 -%>
|
<% if source_view_is(:deferred) && @down_count==0 -%>
|
||||||
$('#tickler-empty-nd').slideDown(100);
|
$('#deferred_pending_container-empty-d').slideDown(100);
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ function activate_pending_todos() {
|
||||||
$('#<%= dom_id(t) %>').fadeOut(400, function() {
|
$('#<%= dom_id(t) %>').fadeOut(400, function() {
|
||||||
$('#<%= dom_id(t) %>').remove();
|
$('#<%= dom_id(t) %>').remove();
|
||||||
$('#<%= item_container_id(t) %>').append("<%= html %>");
|
$('#<%= item_container_id(t) %>').append("<%= html %>");
|
||||||
<%= "$('#tickler-empty-nd').show();".html_safe if @remaining_deferred_or_pending_count==0 -%>
|
<%= "$('#deferred_pending_container-empty-d').show();".html_safe if @remaining_deferred_or_pending_count==0 -%>
|
||||||
});
|
});
|
||||||
<% else -%>
|
<% else -%>
|
||||||
$('#<%= item_container_id(t) %>').append("<%= html%>");
|
$('#<%= item_container_id(t) %>').append("<%= html%>");
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<%= show_todos_without_project(@todos_without_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, {:parent_container_type => 'home', :collapsible => true}) unless @done.nil? %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="input_box">
|
<div id="input_box">
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
<div id="display_box">
|
<div id="display_box">
|
||||||
|
|
||||||
<div id="tickler-empty-nd" style="display:<%= (@count == 0) ? 'block' : 'none'%>;">
|
<%= empty_message_holder("deferred_pending", @not_done_todos.empty?) %>
|
||||||
<div class="message"><p><%= t('todos.no_deferred_actions') %></p></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render :partial => @contexts, :locals => { :collapsible => true } %>
|
<%= render :partial => @contexts, :locals => { :settings => {:collapsible => true} } %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="input_box">
|
<div id="input_box">
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ function hide_empty_message() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_empty_deferred_message() {
|
function show_empty_deferred_message() {
|
||||||
$('#tickler-empty-nd').slideDown(100);
|
$('#deferred_pending_container-empty-d').slideDown(100);
|
||||||
}
|
}
|
||||||
function remove_successor() {
|
function remove_successor() {
|
||||||
<% # TODO: last todo in context --> remove context??
|
<% # TODO: last todo in context --> remove context??
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ function remove_todo(next_steps) {
|
||||||
function add_to_completed_container(next_steps) {
|
function add_to_completed_container(next_steps) {
|
||||||
<% unless current_user.prefs.hide_completed_actions? -%>
|
<% unless current_user.prefs.hide_completed_actions? -%>
|
||||||
$('#<%= item_container_id(@todo) %>').prepend(html_for_todo());
|
$('#<%= item_container_id(@todo) %>').prepend(html_for_todo());
|
||||||
$("#empty-d").slideUp(100);
|
$("#completed_container-empty-d").slideUp(100);
|
||||||
highlight_updated_todo(next_steps);
|
highlight_updated_todo(next_steps);
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +76,7 @@ function add_todo_to_context(next_steps) {
|
||||||
highlight_updated_todo(next_steps);
|
highlight_updated_todo(next_steps);
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @completed_count == 0 -%>
|
<% if @completed_count == 0 -%>
|
||||||
$("#empty-d").slideDown(100);
|
$("#completed_container-empty-d").slideDown(100);
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +130,7 @@ function activate_pending_todos(next_steps) {
|
||||||
$('#<%= dom_id(t) %>').fadeOut(400, function() {
|
$('#<%= dom_id(t) %>').fadeOut(400, function() {
|
||||||
$('#<%= dom_id(t) %>').remove();
|
$('#<%= dom_id(t) %>').remove();
|
||||||
$('#<%= item_container_id(t) %>').append("<%= html %>");
|
$('#<%= item_container_id(t) %>').append("<%= html %>");
|
||||||
<%= "$('#tickler-empty-nd').show();".html_safe if @remaining_deferred_or_pending_count==0 -%>
|
<%= "$('#deferred_pending_container-empty-d').show();".html_safe if @remaining_deferred_or_pending_count==0 -%>
|
||||||
});
|
});
|
||||||
<% else -%>
|
<% else -%>
|
||||||
$('#<%= item_container_id(t) %>').append("<%= html%>");
|
$('#<%= item_container_id(t) %>').append("<%= html%>");
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
end
|
end
|
||||||
animation << "hide_context" if update_needs_to_hide_context
|
animation << "hide_context" if update_needs_to_hide_context
|
||||||
animation << "highlight_updated_todo"
|
animation << "highlight_updated_todo"
|
||||||
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo)
|
animation << "update_empty_container" if source_view_is_one_of(:tag, :todo, :deferred)
|
||||||
animation << "update_predecessors"
|
animation << "update_predecessors"
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ function replace_todo(next_steps) {
|
||||||
function hide_context(next_steps) {
|
function hide_context(next_steps) {
|
||||||
<% context_id = @context_changed ? @original_item_context_id : @todo.context_id -%>
|
<% context_id = @context_changed ? @original_item_context_id : @todo.context_id -%>
|
||||||
$('#c<%= context_id %>').fadeOut(400, function(){ next_steps.go(); });
|
$('#c<%= context_id %>').fadeOut(400, function(){ next_steps.go(); });
|
||||||
<%= "$('#tickler-empty-nd').slideDown(400);".html_safe if source_view_is(:deferred) && @down_count == 0 %>
|
<%= "$('#deferred_pending_container_empty-nd').slideDown(400);".html_safe if source_view_is(:deferred) && @down_count == 0 %>
|
||||||
}
|
}
|
||||||
|
|
||||||
function highlight_updated_todo(next_steps) {
|
function highlight_updated_todo(next_steps) {
|
||||||
|
|
@ -82,9 +82,9 @@ function highlight_updated_todo(next_steps) {
|
||||||
|
|
||||||
function update_empty_container(next_steps) {
|
function update_empty_container(next_steps) {
|
||||||
<% if @down_count==0 -%>
|
<% if @down_count==0 -%>
|
||||||
$('#no_todos_in_view').slideDown(400, function(){ next_steps.go(); });
|
$('div#no_todos_in_view').slideDown(400, function(){ next_steps.go(); });
|
||||||
<% else -%>
|
<% else -%>
|
||||||
$('#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); });
|
$('div#no_todos_in_view').fadeOut(100, function(){ next_steps.go(); });
|
||||||
<% end -%>
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,8 +130,10 @@ function regenerate_predecessor_family() {
|
||||||
parents = @todo.predecessors
|
parents = @todo.predecessors
|
||||||
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 => { :settings => {: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
|
||||||
-%>
|
-%>
|
||||||
}
|
}
|
||||||
|
|
@ -433,6 +433,7 @@ en:
|
||||||
context: Currently there are no incomplete actions in this context
|
context: Currently there are no incomplete actions in this context
|
||||||
actions:
|
actions:
|
||||||
completed: Completed actions
|
completed: Completed actions
|
||||||
|
home_completed: Completed actions
|
||||||
tag_completed: "Completed actions tagged with '%{param}'"
|
tag_completed: "Completed actions tagged with '%{param}'"
|
||||||
home_without_project: "Actions without project"
|
home_without_project: "Actions without project"
|
||||||
project_project: "Actions in this project"
|
project_project: "Actions in this project"
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ Feature: Edit a context
|
||||||
And I should see empty message for deferred todos of context
|
And I should see empty message for deferred todos of context
|
||||||
And I should not see empty message for todos of context
|
And I should not see empty message for todos of context
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Making all deferred todos inactive will show empty message
|
Scenario: Making all deferred todos inactive will show empty message
|
||||||
Given I have a context "test" with 1 deferred todos
|
Given I have a context "test" with 1 deferred todos
|
||||||
When I go to the "test" context
|
When I go to the "test" context
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ Feature: dependencies
|
||||||
Then I should not see "test 1" within the dependencies of "test 2"
|
Then I should not see "test 1" within the dependencies of "test 2"
|
||||||
And I should not see "test 1" in the deferred container
|
And I should not see "test 1" in the deferred container
|
||||||
|
|
||||||
@javascript
|
@javascript @wip
|
||||||
Scenario: Completing a predecessor will activate successors
|
Scenario: Completing a predecessor will activate successors
|
||||||
Given I have a context called "@pc"
|
Given I have a context called "@pc"
|
||||||
And I have a project "dependencies" that has the following todos
|
And I have a project "dependencies" that has the following todos
|
||||||
|
|
@ -124,7 +124,7 @@ Feature: dependencies
|
||||||
Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!"
|
Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!"
|
||||||
And I should see "test 1" in project container for "dependencies"
|
And I should see "test 1" in project container for "dependencies"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: Marking a successor as complete will update predecessor
|
Scenario Outline: Marking a successor as complete will update predecessor
|
||||||
Given I have a context called "@pc"
|
Given I have a context called "@pc"
|
||||||
And I have a project "dependencies" that has the following todos
|
And I have a project "dependencies" that has the following todos
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ Feature: Edit a next action from every page
|
||||||
|
|
||||||
Scenarios:
|
Scenarios:
|
||||||
| page | page type |
|
| page | page type |
|
||||||
| "visible project" project | project |
|
|
||||||
| home page | home |
|
| home page | home |
|
||||||
|
| "visible project" project | project |
|
||||||
| tag page for "starred" | tag |
|
| tag page for "starred" | tag |
|
||||||
| context page for "visible context" | context |
|
| context page for "visible context" | context |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,6 @@ Feature: Edit a next action from the mobile view
|
||||||
And I should see "test action"
|
And I should see "test action"
|
||||||
When I follow "test action"
|
When I follow "test action"
|
||||||
And I press "Defer 1 day"
|
And I press "Defer 1 day"
|
||||||
Then I should see "There are no incomplete actions"
|
Then I should see "Currently there are no incomplete actions"
|
||||||
When I follow "Tickler"
|
When I follow "Tickler"
|
||||||
Then I should see "test action"
|
Then I should see "test action"
|
||||||
|
|
|
||||||
|
|
@ -72,21 +72,21 @@ Then /^I should see "([^"]*)" in the deferred container$/ do |todo_description|
|
||||||
todo = @current_user.todos.where(:description => todo_description).first
|
todo = @current_user.todos.where(:description => todo_description).first
|
||||||
todo.should_not be_nil
|
todo.should_not be_nil
|
||||||
|
|
||||||
page.should have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
|
page.should have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_description|
|
Then /^I should not see "([^"]*)" in the deferred container$/ do |todo_description|
|
||||||
todo = @current_user.todos.where(:description => todo_description).first
|
todo = @current_user.todos.where(:description => todo_description).first
|
||||||
todo.should_not be_nil
|
todo.should_not be_nil
|
||||||
|
|
||||||
page.should_not have_xpath("//div[@id='tickler']//div[@id='line_todo_#{todo.id}']")
|
page.should_not have_xpath("//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should (not see|see) "([^"]*)" in the action container$/ do |visible, todo_description|
|
Then /^I should (not see|see) "([^"]*)" in the action container$/ do |visible, todo_description|
|
||||||
todo = @current_user.todos.where(:description => todo_description).first
|
todo = @current_user.todos.where(:description => todo_description).first
|
||||||
todo.should_not be_nil
|
todo.should_not be_nil
|
||||||
|
|
||||||
id = @source_view=="project" ? "p#{todo.project_id}items" : "c#{todo.context_id}items"
|
id = @source_view=="project" ? "p#{todo.project_id}_items" : "c#{todo.context_id}_items"
|
||||||
|
|
||||||
xpath = "//div[@id='#{id}']//div[@id='line_todo_#{todo.id}']"
|
xpath = "//div[@id='#{id}']//div[@id='line_todo_#{todo.id}']"
|
||||||
page.send(visible=="see" ? :should : :should_not, have_xpath(xpath))
|
page.send(visible=="see" ? :should : :should_not, have_xpath(xpath))
|
||||||
|
|
@ -105,7 +105,7 @@ Then /^I should not see "([^"]*)" in the project container of "([^"]*)"$/ do |to
|
||||||
project = @current_user.projects.where(:name => project_name).first
|
project = @current_user.projects.where(:name => project_name).first
|
||||||
project.should_not be_nil
|
project.should_not be_nil
|
||||||
|
|
||||||
xpath = "//div[@id='p#{todo.project.id}items']//div[@id='line_todo_#{todo.id}']"
|
xpath = "//div[@id='p#{todo.project.id}_items']//div[@id='line_todo_#{todo.id}']"
|
||||||
page.should_not have_xpath(xpath)
|
page.should_not have_xpath(xpath)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_desc
|
||||||
project = @current_user.projects.where(:name => project_name).first
|
project = @current_user.projects.where(:name => project_name).first
|
||||||
project.should_not be_nil
|
project.should_not be_nil
|
||||||
|
|
||||||
xpath = "//div[@id='p#{project.id}items']//div[@id='line_todo_#{todo.id}']"
|
xpath = "//div[@id='p#{project.id}_items']//div[@id='line_todo_#{todo.id}']"
|
||||||
page.should have_xpath(xpath)
|
page.should have_xpath(xpath)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ Then /^I should see "([^"]*)" in the hidden container$/ do |todo_description|
|
||||||
todo = @current_user.todos.where(:description => todo_description).first
|
todo = @current_user.todos.where(:description => todo_description).first
|
||||||
todo.should_not be_nil
|
todo.should_not be_nil
|
||||||
|
|
||||||
xpath = "//div[@id='hidden']//div[@id='line_todo_#{todo.id}']"
|
xpath = "//div[@id='hidden_container']//div[@id='line_todo_#{todo.id}']"
|
||||||
page.should have_xpath(xpath)
|
page.should have_xpath(xpath)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,9 @@ end
|
||||||
|
|
||||||
Then /^I should (see|not see) empty message for (todo|completed todo|deferred todo)s of context/ do |visible, state|
|
Then /^I should (see|not see) empty message for (todo|completed todo|deferred todo)s of context/ do |visible, state|
|
||||||
css = "error"
|
css = "error"
|
||||||
css = "div#c#{@context.id}empty-nd" if state == "todo"
|
css = "div#c#{@context.id}-empty-d" if state == "todo"
|
||||||
css = "div#empty-d" if state == "completed todo"
|
css = "div#completed_container-empty-d" if state == "completed todo"
|
||||||
css = "div#tickler-empty-nd" if state == "deferred todo"
|
css = "div#deferred_pending_container-empty-d" if state == "deferred todo"
|
||||||
|
|
||||||
page.send(visible=="see" ? :should : :should_not, have_css(css, :visible=>true))
|
page.send(visible=="see" ? :should : :should_not, have_css(css, :visible=>true))
|
||||||
end
|
end
|
||||||
|
|
@ -158,13 +158,13 @@ When /^I try to edit the project name of "([^"]*)" to "([^"]*)"$/ do |project_cu
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I edit the project name in place to be "([^"]*)"$/ do |new_project_name|
|
When /^I edit the project name in place to be "([^"]*)"$/ do |new_project_name|
|
||||||
page.find("div#project_name").click
|
page.find("span#project_name").click
|
||||||
fill_in "value", :with => new_project_name
|
fill_in "value", :with => new_project_name
|
||||||
click_button "Ok"
|
click_button "Ok"
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I click to edit the project name in place$/ do
|
When /^I click to edit the project name in place$/ do
|
||||||
page.find("div#project_name").click
|
page.find("span#project_name").click
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I edit the project settings$/ do
|
When /^I edit the project settings$/ do
|
||||||
|
|
@ -236,13 +236,13 @@ end
|
||||||
|
|
||||||
Then /^I should (see|not see) empty message for (todos|deferred todos|completed todos) of project/ do |visible, state|
|
Then /^I should (see|not see) empty message for (todos|deferred todos|completed todos) of project/ do |visible, state|
|
||||||
css = "wrong state"
|
css = "wrong state"
|
||||||
css = "div#p#{@project.id}empty-nd" if state == "todos"
|
css = "div#p#{@project.id}-empty-d" if state == "todos"
|
||||||
css = "div#tickler-empty-nd" if state == "deferred todos"
|
css = "div#deferred_pending_container-empty-d" if state == "deferred todos"
|
||||||
css = "div#empty-d" if state == "completed todos"
|
css = "div#completed_container-empty-d" if state == "completed todos"
|
||||||
|
|
||||||
elem = find(css)
|
elem = find(css)
|
||||||
elem.should_not be_nil
|
elem.should_not be_nil
|
||||||
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
elem.send(visible=="see" ? :should : :should_not, be_visible)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I edit the default tags to "([^"]*)"$/ do |default_tags|
|
Then /^I edit the default tags to "([^"]*)"$/ do |default_tags|
|
||||||
|
|
@ -253,14 +253,14 @@ end
|
||||||
|
|
||||||
Then /^I should be able to change the project name in place$/ do
|
Then /^I should be able to change the project name in place$/ do
|
||||||
# Note that this is not changing the project name
|
# Note that this is not changing the project name
|
||||||
page.should have_css("div#project_name>form>input")
|
page.should have_css("span#project_name>form>input")
|
||||||
page.find("div#project_name > form > button[type=cancel]").click
|
page.find("span#project_name > form > button[type=cancel]").click
|
||||||
page.should_not have_css("div#project_name>form>input")
|
page.should_not have_css("span#project_name>form>input")
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not be able to change the project name in place$/ do
|
Then /^I should not be able to change the project name in place$/ do
|
||||||
step "I click to edit the project name in place"
|
step "I click to edit the project name in place"
|
||||||
page.should_not have_xpath("//div[@id='project_name']/form/input")
|
page.should_not have_xpath("//span[@id='project_name']/form/input")
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^the form for adding a note should not be visible$/ do
|
Then /^the form for adding a note should not be visible$/ do
|
||||||
|
|
@ -295,7 +295,7 @@ end
|
||||||
|
|
||||||
Then /^the project title should be "(.*)"$/ do |title|
|
Then /^the project title should be "(.*)"$/ do |title|
|
||||||
wait_until do
|
wait_until do
|
||||||
page.find("h2#project_name_container div#project_name").text == title
|
page.find("h2#project_name_container span#project_name").text == title
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,12 +153,12 @@ Then /^I should see "([^"]*)" in the completed section of the mobile site$/ do |
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should (see|not see) empty message for (completed todos|todos) of home/ do |visible, kind_of_todo|
|
Then /^I should (see|not see) empty message for (completed todos|todos) of home/ do |visible, kind_of_todo|
|
||||||
elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#empty-d")
|
elem = find(kind_of_todo=="todos" ? "div#no_todos_in_view" : "div#completed_container-empty-d")
|
||||||
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should (see|not see) the empty tickler message$/ do |see|
|
Then /^I should (see|not see) the empty tickler message$/ do |see|
|
||||||
elem = find("div#tickler-empty-nd")
|
elem = find("div#no_todos_in_view")
|
||||||
elem.send(see=="see" ? "should" : "should_not", be_visible)
|
elem.send(see=="see" ? "should" : "should_not", be_visible)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,17 +7,17 @@ Then /^I should see empty message for todos of tag$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not see empty message for completed todos of tag$/ do
|
Then /^I should not see empty message for completed todos of tag$/ do
|
||||||
page.should_not have_css("div#empty-d", :visible=>true)
|
page.should_not have_css("div#completed_container-empty-d", :visible=>true)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see empty message for completed todos of tag$/ do
|
Then /^I should see empty message for completed todos of tag$/ do
|
||||||
page.should have_css("div#empty-d", :visible=>true)
|
page.should have_css("div#completed_container-empty-d", :visible=>true)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not see empty message for deferred todos of tag$/ do
|
Then /^I should not see empty message for deferred todos of tag$/ do
|
||||||
page.should_not have_css("div#tickler-empty-nd", :visible=>true)
|
page.should_not have_css("div#deferred_pending_container-empty-d", :visible=>true)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see empty message for deferred todos of tag$/ do
|
Then /^I should see empty message for deferred todos of tag$/ do
|
||||||
page.should have_css("div#tickler-empty-nd", :visible=>true)
|
page.should have_css("div#deferred_pending_container-empty-d", :visible=>true)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ Feature: Manage deferred todos
|
||||||
And there exists a project "manage me" for user "testuser"
|
And there exists a project "manage me" for user "testuser"
|
||||||
And I have logged in as "testuser" with password "secret"
|
And I have logged in as "testuser" with password "secret"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I can add a deferred todo and it will show in the tickler
|
Scenario: I can add a deferred todo and it will show in the tickler
|
||||||
# also adding the first deferred todo will hide the empty message
|
# also adding the first deferred todo will hide the empty message
|
||||||
Given I have a context called "test"
|
Given I have a context called "test"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue