From 2675be8f4c769677a0c0bd217535020e2e1634e4 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Fri, 29 Apr 2011 18:40:04 +0200 Subject: [PATCH] fix #1156 where todos with ' in the name were not rendered correctly in title of pending annotation --- app/helpers/todos_helper.rb | 17 +++++++++-------- app/views/todos/_successor.html.erb | 11 +---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index cd59eda1..a02657c4 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -96,9 +96,10 @@ module TodosHelper def date_span(todo=@todo) if todo.completed? - "#{format_date( todo.completed_at )}" + content_tag(:span, {:class => :grey}) { format_date( todo.completed_at ) } elsif todo.pending? - "#{t('todos.pending')} " + title = t('todos.depends_on')+ ": " + todo.uncompleted_predecessors.map(&:description).join(', ') + content_tag(:a, {:title => title}) { content_tag(:span, {:class => :orange}) { t('todos.pending') } } elsif todo.deferred? show_date( todo.show_from ) else @@ -116,7 +117,7 @@ module TodosHelper def grip_span(todo=@todo) unless todo.completed? - image_tag('grip.png', :width => '7', :height => '16', :border => '0', + image_tag('grip.png', :width => '7', :height => '16', :border => '0', :title => t('todos.drag_action_title'), :class => 'grip') end @@ -135,9 +136,9 @@ module TodosHelper def tag_list_mobile(todo=@todo) tags_except_starred = todo.tags.reject{|t| t.name == Todo::STARRED_TAG_NAME} # removed the link. TODO: add link to mobile view of tagged actions - tag_list = tags_except_starred.collect{|t| - "" + - link_to(t.name, {:action => "tag", :controller => "todos", :id => t.name+".m"}) + + tag_list = tags_except_starred.collect{|t| + "" + + link_to(t.name, {:action => "tag", :controller => "todos", :id => t.name+".m"}) + ""}.join('') if tag_list.empty? then "" else "#{tag_list}" end end @@ -377,10 +378,10 @@ module TodosHelper source_view do |page| page.project { container_id = "p#{@original_item_project_id}empty-nd" if @remaining_in_context == 0 - container_id = "tickler-empty-nd" if ( + container_id = "tickler-empty-nd" if ( ( (@todo_was_activated_from_deferred_state || @todo_was_activated_from_pending_state) && @remaining_deferred_or_pending_count == 0) || (@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && @todo.completed?) ) - container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? + container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } page.deferred { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } page.calendar { container_id = "empty_#{@original_item_due_id}" if @old_due_empty } diff --git a/app/views/todos/_successor.html.erb b/app/views/todos/_successor.html.erb index a82fad19..e00fa0ca 100644 --- a/app/views/todos/_successor.html.erb +++ b/app/views/todos/_successor.html.erb @@ -13,14 +13,6 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag' <%= remote_delete_dependency(successor, predecessor) %> -<%# link_to_remote( - image_tag("blank.png", :title => t('todos.remove_dependency'), :align => "absmiddle", :class => "delete_item"), - {:url => {:controller => 'todos', :action => 'remove_predecessor', :id => successor.id}, - :method => 'delete', - :with => "'#{parameters}&predecessor=#{predecessor.id}'", - :before => successor_start_waiting_js(successor)}, - {:style => "background: transparent;"}) %> - <% unless successor.pending_successors.empty? %>
<%= render :partial => "todos/successor", @@ -34,5 +26,4 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag' <% end %>
- - + \ No newline at end of file