diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 56c9213c..20afba9b 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -140,6 +140,15 @@ class TodosController < ApplicationController format.xml { render :xml => @todo.to_xml( :root => 'todo', :except => :user_id ) } end end + + def add_predecessor + logger.debug "add_predecessor" + @predecessor = Todo.find(params['predecessor']) + @successor = Todo.find(params['successor']) + respond_to do |format| + format.js + end + end # Toggles the 'done' status of the action # diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 23cda92f..111d0adf 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -106,6 +106,14 @@ module TodosHelper end end + def grip_span + unless @todo.completed? + image_tag('grip.png', :width => '7', :height => '16', :border => '0', + :title => 'Drag onto another action to make it depend on this action', + :class => 'grip') + 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 d253f760..59134ad9 100644 --- a/app/views/todos/_todo.html.erb +++ b/app/views/todos/_todo.html.erb @@ -22,6 +22,7 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag' <% end %>