mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-15 03:38:08 +01:00
fix some small issues
This commit is contained in:
parent
3116d46820
commit
74a2b2a49f
6 changed files with 389 additions and 334 deletions
|
|
@ -593,6 +593,7 @@ class TodosController < ApplicationController
|
|||
|
||||
@todo.show_from = (@todo.show_from || @todo.user.date) + numdays.days
|
||||
@saved = @todo.save
|
||||
@status_message = t('todos.action_saved_to_tickler')
|
||||
|
||||
determine_down_count
|
||||
determine_remaining_in_context_count(@todo.context_id)
|
||||
|
|
@ -911,6 +912,17 @@ class TodosController < ApplicationController
|
|||
from.calendar {
|
||||
@target_context_count = @new_due_id.blank? ? 0 : count_old_due_empty(@new_due_id)
|
||||
}
|
||||
from.context {
|
||||
context = current_user.contexts.find(context_id)
|
||||
|
||||
remaining_actions_in_context = context.todos(true).active
|
||||
remaining_actions_in_context = remaining_actions_in_context.not_hidden if !context.hide?
|
||||
@remaining_in_context = remaining_actions_in_context.count
|
||||
|
||||
actions_in_target = current_user.contexts.find(@todo.context_id).todos(true).active
|
||||
actions_in_target = actions_in_target.not_hidden if !context.hide?
|
||||
@target_context_count = actions_in_target.count
|
||||
}
|
||||
end
|
||||
@remaining_in_context = current_user.contexts.find(context_id).todos(true).active.not_hidden.count if !@remaining_in_context
|
||||
@target_context_count = current_user.contexts.find(@todo.context_id).todos(true).active.not_hidden.count if !@target_context_count
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ module TodosHelper
|
|||
container_id = "hidden-empty-nd" if (@remaining_hidden_count == 0 && !@todo.hidden? && @todo_hidden_state_changed) ||
|
||||
(@remaining_hidden_count == 0 && @todo.completed? && @original_item_was_hidden)
|
||||
container_id = "tickler-empty-nd" if (@todo_was_activated_from_deferred_state && @remaining_deferred_or_pending_count == 0) ||
|
||||
(@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && @todo.completed?)
|
||||
(@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?
|
||||
}
|
||||
page.context { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<% if !@saved -%>
|
||||
TracksPages.page_notify('error', "Could not mark this todo complete", 5);
|
||||
TracksPages.page_notify('error', "<%= t('todos.error_toggle_complete') %>", 5);
|
||||
<% else -%>
|
||||
<% if @wants_redirect_after_complete && @todo.completed? -%>
|
||||
redirect_after_complete();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue