diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 70c54385..99367a0c 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -83,12 +83,14 @@ module TodosHelper def remote_toggle_checkbox check_box_tag('item_id', toggle_check_todo_path(@todo), @todo.completed?, :class => 'item-checkbox', - :disabled => @todo.pending?) + :title => @todo.pending? ? 'Blocked by ' + @todo.uncompleted_predecessors.map(&:description).join(', ') : "", :readonly => @todo.pending?) end def date_span if @todo.completed? "#{format_date( @todo.completed_at )}" + elsif @todo.pending? + "Pending " elsif @todo.deferred? show_date( @todo.show_from ) else @@ -96,6 +98,15 @@ module TodosHelper end end + def successors_span + unless @todo.successors.empty? + successors_count = @todo.successors.length + title = "Has #{pluralize(successors_count, 'pending action')}: #{@todo.successors.map(&:description).join(', ')}" + link_to(image_tag( 'blank.png', :width=>'10', :height=>'16', :border=>'0' ), + '#', {:class => 'show_successors', :title => title}) + end + end + def tag_list_text @todo.tags.collect{|t| t.name}.join(', ') end diff --git a/app/views/todos/_todo.html.erb b/app/views/todos/_todo.html.erb index 587aa8ff..d253f760 100644 --- a/app/views/todos/_todo.html.erb +++ b/app/views/todos/_todo.html.erb @@ -24,12 +24,12 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'