mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-05 23:41:48 +01:00
fixes #929. Manually applied revision:37a45313a0c0876272a871093e112c159c34b547 because it did not cleanly apply with cherry-pick
This commit is contained in:
parent
ffc1c11676
commit
ab9fa1fc46
2 changed files with 12 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue