mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-01 10:30:15 +01:00
* Consolidated toggle_check handling to todo_controller and rjs * Introduced user preference to show/hide hidden projects section in sidebar * Fixed a bug in parse_date_per_user_prefs that was causing due dates to be set in the todo model as Times and not Dates * Upgraded ARTS plugin * This changeset includes migrations, so remember to db:migrate. * Lots of code changes here, so bug reports will be gratefully accepted! git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@343 a4c988fc-2ded-0310-b66e-134b36920a42
36 lines
No EOL
2 KiB
Text
36 lines
No EOL
2 KiB
Text
if @saved
|
|
|
|
item_container_id = "c#{@item.context_id}"
|
|
parent_container_type = "context"
|
|
if source_view_is :context
|
|
empty_container_msg_div_id = "c#{@item.context_id}empty-nd"
|
|
elsif source_view_is :project
|
|
item_container_id = "p#{@item.project_id}"
|
|
empty_container_msg_div_id = "p#{@item.project_id}empty-nd"
|
|
parent_container_type = "project"
|
|
end
|
|
|
|
page.remove "item-#{@item.id}-container"
|
|
if @item.completed?
|
|
# Don't try to insert contents into a non-existent container!
|
|
unless @user.preference.hide_completed_actions?
|
|
page.insert_html :top, "completed", :partial => 'todo/item', :locals => { :parent_container_type => "completed" }
|
|
page.visual_effect :highlight, "item-#{@item.id}", {'startcolor' => "'#99ff99'"}
|
|
page[empty_container_msg_div_id].show if @down_count == '0' && !empty_container_msg_div_id.nil?
|
|
page.hide "empty-d" # If we've checked something as done, completed items can't be empty
|
|
end
|
|
if @remaining_undone_in_context == 0 && source_view_is(:todo)
|
|
page.visual_effect :fade, item_container_id, :duration => 0.4
|
|
end
|
|
else
|
|
page.call "todoItems.ensureVisibleWithEffectAppear", item_container_id
|
|
page.insert_html :bottom, item_container_id, :partial => 'todo/item', :locals => { :parent_container_type => parent_container_type }
|
|
page.visual_effect :highlight, "item-#{@item.id}", {'startcolor' => "'#99ff99'"}
|
|
page.show "empty-d" if @done_count == '0'
|
|
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil? # If we've checked something as undone, uncompleted items can't be empty
|
|
end
|
|
page.hide "status"
|
|
page.replace_html "badge_count", @down_count
|
|
else
|
|
page.replace_html "status", content_tag("div", content_tag("h2", "#{pluralize(@item.errors.count, "error")} prohibited this record from being saved") + content_tag("p", "There were problems with the following fields:") + content_tag("ul", @item.errors.each_full { |msg| content_tag("li", msg) }), "id" => "ErrorExplanation", "class" => "ErrorExplanation")
|
|
end |