mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-23 23:54:07 +01:00
get some wip cucumber tests running
This commit is contained in:
parent
1372bb110e
commit
c0115eacd7
11 changed files with 273 additions and 179 deletions
|
|
@ -107,6 +107,7 @@ class TodosController < ApplicationController
|
|||
end
|
||||
|
||||
@todo.reload if @saved
|
||||
@todo_was_created_deferred = @todo.deferred?
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :action => "index" }
|
||||
|
|
@ -415,7 +416,8 @@ class TodosController < ApplicationController
|
|||
@original_item_due = @todo.due
|
||||
@context_id = @todo.context_id
|
||||
@project_id = @todo.project_id
|
||||
|
||||
@todo_was_destroyed_from_deferred_state = @todo.deferred?
|
||||
|
||||
# activate successors if they only depend on this todo
|
||||
activated_successor_count = 0
|
||||
@pending_to_activate = []
|
||||
|
|
|
|||
|
|
@ -354,11 +354,11 @@ module TodosHelper
|
|||
|
||||
source_view do |page|
|
||||
page.project {
|
||||
return "tickler-empty-nd" if @todo_was_deferred_from_active_state || @todo_was_blocked_from_active_state
|
||||
return "tickler-empty-nd" if @todo_was_deferred_from_active_state || @todo_was_blocked_from_active_state || @todo_was_destroyed_from_deferred_state || @todo_was_created_deferred
|
||||
return "p#{todo.project_id}empty-nd"
|
||||
}
|
||||
page.tag {
|
||||
return "tickler-empty-nd" if @todo_was_deferred_from_active_state
|
||||
return "tickler-empty-nd" if @todo_was_deferred_from_active_state || @todo_was_destroyed_from_deferred_state || @todo_was_created_deferred
|
||||
return "hidden-empty-nd" if @todo.hidden?
|
||||
return "c#{todo.context_id}empty-nd"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,10 @@ function insert_new_context_with_new_todo() {
|
|||
|
||||
function add_todo_to_existing_context() {
|
||||
<% if source_view_is_one_of(:todo, :deferred, :tag) -%>
|
||||
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
|
||||
$('#no_todos_in_view').slideUp(100);
|
||||
<% unless source_view_is_one_of(:todo, :tag) && @todo.deferred? -%>
|
||||
$('#c<%= @todo.context_id %>').fadeIn(500, function() {});
|
||||
$('#no_todos_in_view').slideUp(100);
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
$('#<%=empty_container_msg_div_id%>').hide();
|
||||
$('#<%=item_container_id(@todo)%>').append(html_for_new_todo());
|
||||
|
|
|
|||
|
|
@ -31,18 +31,20 @@ function show_empty_messages() {
|
|||
}
|
||||
|
||||
function remove_todo_from_page() {
|
||||
<% if (@remaining_in_context == 0)
|
||||
<% if (@remaining_in_context == 0) && update_needs_to_hide_context
|
||||
# remove context with deleted todo
|
||||
-%>
|
||||
$('#c<%=@todo.context_id%>').fadeOut(1000, function() {
|
||||
$('#c<%=@todo.context_id%>').fadeOut(400, function() {
|
||||
$('#<%=dom_id(@todo)%>').remove();
|
||||
});
|
||||
<% else
|
||||
<%= show_empty_message_in_source_container -%>
|
||||
<% else
|
||||
# remove only the todo
|
||||
-%>
|
||||
$('#<%=dom_id(@todo)%>').slideUp(1000, function() {
|
||||
<%= show_empty_message_in_source_container %>
|
||||
$('#<%=dom_id(@todo)%>').slideUp(400, function() {
|
||||
$('#<%=dom_id(@todo)%>').remove();
|
||||
});
|
||||
});
|
||||
<% end -%>
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue