Tickler actions are now displayed in their context container, as on the home page. Accordingly, only the project link ([P]) is now shown after the action description, as on the home page.

Fixes #499.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@538 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2007-05-06 11:38:16 +00:00
parent 22a9519bd7
commit 3175f8fc24
4 changed files with 27 additions and 34 deletions

View file

@ -255,9 +255,13 @@ class TodosController < ApplicationController
def list_deferred
@source_view = 'deferred'
@page_title = "TRACKS::Tickler"
@projects = @user.projects.find(:all, :include => [ :todos ])
@contexts_to_show = @contexts = @user.contexts.find(:all, :include => [ :todos ])
@user.deferred_todos.find_and_activate_ready
@tickles = @user.deferred_todos
@count = @tickles.size
@not_done_todos = @user.deferred_todos
@count = @not_done_todos.size
@default_project_context_name_map = build_default_project_context_name_map(@projects).to_json
end

View file

@ -71,7 +71,7 @@ module TodosHelper
"(#{@todo.context.name}#{", " + @todo.project.name unless @todo.project.nil?})"
else
str = ''
if (['project', 'tickler', 'tag'].include?(parent_container_type))
if (['project', 'tag'].include?(parent_container_type))
str << item_link_to_context( @todo )
end
if (['context', 'tickler', 'tag'].include?(parent_container_type)) && @todo.project_id
@ -143,7 +143,6 @@ module TodosHelper
end
def item_container_id
return "tickler-items" if source_view_is :deferred
if source_view_is :project
return "p#{@todo.project_id}" if @todo.active?
return "tickler" if @todo.deferred?

View file

@ -1,18 +1,8 @@
<div id="display_box">
<div id="tickler" class="container project">
<h2>Deferred actions</h2>
<%= render :partial => "contexts/context", :collection => @contexts,
:locals => { :collapsible => true } %>
<div id="tickler-items" class="items toggle_target">
<div id="tickler-empty-nd" style="display:<%= @tickles.empty? ? 'block' : 'none'%>;">
<div class="message"><p>Currently there are no deferred actions</p></div>
</div>
<%= render :partial => "todos/todo", :collection => @tickles, :locals => { :parent_container_type => 'tickler' } %>
</div><!-- [end:items] -->
</div><!-- [end:tickler] -->
</div><!-- End of display_box -->
<div id="input_box">

View file

@ -5,10 +5,10 @@
ActiveRecord::Schema.define(:version => 32) do
create_table "contexts", :force => true do |t|
t.column "name", :string, :default => "", :null => false
t.column "hide", :integer, :limit => 4, :default => 0, :null => false
t.column "position", :integer, :default => 0, :null => false
t.column "user_id", :integer, :default => 0, :null => false
t.column "name", :string, :default => "", :null => false
t.column "position", :integer, :null => false
t.column "hide", :boolean, :default => false
t.column "user_id", :integer, :default => 1
t.column "created_at", :datetime
t.column "updated_at", :datetime
end
@ -17,8 +17,8 @@ ActiveRecord::Schema.define(:version => 32) do
add_index "contexts", ["user_id", "name"], :name => "index_contexts_on_user_id_and_name"
create_table "notes", :force => true do |t|
t.column "user_id", :integer, :default => 0, :null => false
t.column "project_id", :integer, :default => 0, :null => false
t.column "user_id", :integer, :null => false
t.column "project_id", :integer, :null => false
t.column "body", :text
t.column "created_at", :datetime
t.column "updated_at", :datetime
@ -44,7 +44,7 @@ ActiveRecord::Schema.define(:version => 32) do
end
create_table "preferences", :force => true do |t|
t.column "user_id", :integer, :default => 0, :null => false
t.column "user_id", :integer, :null => false
t.column "date_format", :string, :limit => 40, :default => "%d/%m/%Y", :null => false
t.column "week_starts", :integer, :default => 0, :null => false
t.column "show_number_completed", :integer, :default => 5, :null => false
@ -66,8 +66,8 @@ ActiveRecord::Schema.define(:version => 32) do
create_table "projects", :force => true do |t|
t.column "name", :string, :default => "", :null => false
t.column "position", :integer, :default => 0, :null => false
t.column "user_id", :integer, :default => 0, :null => false
t.column "position", :integer, :null => false
t.column "user_id", :integer, :default => 1
t.column "description", :text
t.column "state", :string, :limit => 20, :default => "active", :null => false
t.column "created_at", :datetime
@ -84,7 +84,7 @@ ActiveRecord::Schema.define(:version => 32) do
t.column "updated_at", :datetime
end
add_index "sessions", ["session_id"], :name => "sessions_session_id_index"
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
create_table "taggings", :force => true do |t|
t.column "taggable_id", :integer
@ -104,16 +104,16 @@ ActiveRecord::Schema.define(:version => 32) do
add_index "tags", ["name"], :name => "index_tags_on_name"
create_table "todos", :force => true do |t|
t.column "context_id", :integer, :default => 0, :null => false
t.column "description", :string, :limit => 100, :default => "", :null => false
t.column "context_id", :integer, :null => false
t.column "project_id", :integer
t.column "description", :string, :default => "", :null => false
t.column "notes", :text
t.column "created_at", :datetime
t.column "due", :date
t.column "completed_at", :datetime
t.column "project_id", :integer
t.column "user_id", :integer, :default => 0, :null => false
t.column "user_id", :integer, :default => 1
t.column "show_from", :date
t.column "state", :string, :limit => 20, :default => "immediate", :null => false
t.column "state", :string, :limit => 20, :default => "immediate", :null => false
end
add_index "todos", ["user_id", "state"], :name => "index_todos_on_user_id_and_state"
@ -123,10 +123,10 @@ ActiveRecord::Schema.define(:version => 32) do
add_index "todos", ["user_id", "context_id"], :name => "index_todos_on_user_id_and_context_id"
create_table "users", :force => true do |t|
t.column "login", :string, :limit => 80
t.column "password", :string, :limit => 40
t.column "login", :string, :limit => 80, :default => "", :null => false
t.column "password", :string, :limit => 40, :default => "", :null => false
t.column "word", :string
t.column "is_admin", :integer, :limit => 4, :default => 0, :null => false
t.column "is_admin", :boolean, :default => false, :null => false
t.column "first_name", :string
t.column "last_name", :string
t.column "auth_type", :string, :default => "database", :null => false