fixes #929. Manually applied revision:37a45313a0c0876272a871093e112c159c34b547 because it did not cleanly apply with cherry-pick

This commit is contained in:
Reinier Balt 2009-08-04 14:03:31 +02:00
parent ffc1c11676
commit ab9fa1fc46
2 changed files with 12 additions and 5 deletions

View file

@ -47,6 +47,7 @@ class TodosController < ApplicationController
def create
@source_view = params['_source_view'] || 'todo'
@tag_name = params['_tag_name']
p = TodoCreateParamsHelper.new(params, prefs)
p.parse_dates() unless mobile?
@ -702,10 +703,15 @@ class TodosController < ApplicationController
end
def determine_deferred_tag_count(tag)
tag_collection = Tag.find_by_name(tag).todos
@deferred_tag_count = tag_collection.count(:all,
:conditions => ['todos.user_id = ? and state = ?', current_user.id, 'deferred'],
:order => 'show_from ASC, todos.created_at DESC')
tags = Tag.find_by_name(tag)
if tags.nil?
# should normally not happen, but is a workaround for #929
@deferred_tag_count = 0
else
@deferred_tag_count = tags.todos.count(:all,
:conditions => ['todos.user_id = ? and state = ?', current_user.id, 'deferred'],
:order => 'show_from ASC, todos.created_at DESC')
end
end
def render_todos_html

View file

@ -110,7 +110,8 @@ $('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_proje
<%= text_field("todo", "show_from", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 7, "autocomplete" => "off") %>
</div>
<%= source_view_tag( @source_view ) %>
<%= source_view_tag( @source_view ) %>
<%= hidden_field_tag :_tag_name, @tag_name.underscore.gsub(/\s+/,'_') if source_view_is :tag %>
<div class="submit_box">
<div class="widgets">