<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/views/todos/_inline_edit.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -8,8 +8,9 @@ Currently has translations for Russian, Chinese, Spanish, Italian, French, Germa
 Please check the issues page(thanks Mischa!) for current known bugs.
 
 == Release 0.0.3.9
-* Merging in of nowhereman's changes
-* Massive refactoring of the todo associations to make them simpler and more generic.
+* Merging in of nowhereman's changes(thanks for all the features!)
+* Re-implementation of todo editing functionality - now you can edit everything, not just text.
+* Massive refactoring of the todo associations to make them simpler and more generic, and to prepare for templates.
 * Russian translations added
 
 == Release 0.0.3.8</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ class TodosController &lt; ApplicationController
   #end
   
   #before_filter :find_project  #, :only =&gt; [:index] 
-  before_filter :find_todo, :only =&gt; [:destroy, :show, :toggle_complete, :edit]
+  before_filter :find_todo, :only =&gt; [:destroy, :show, :toggle_complete, :edit, :update]
   before_filter :authorize
 
   helper :todos
@@ -52,18 +52,15 @@ class TodosController &lt; ApplicationController
     #  raise ex, l(:todo_not_found_error)
     #end
     
-    if @todo
-      respond_to do |format|
-        format.html { render }
-        #format.js { render :action =&gt; 'show' }
-      end
-    else
-      flash.now[:error] = @todo.errors.collect{|k,m| m}.join
-      respond_to do |format|
-        format.html { redirect_to :action =&gt; 'index' }
-        #format.js { render :action =&gt; 'edit' }
-      end
+    respond_to do |format|
+      format.html { render }
+      format.js { 
+        @element_html = render_to_string :partial =&gt; 'todos/todo',
+                                         :locals =&gt; {:todo =&gt; @todo, :editable =&gt; true}                 
+        render :template =&gt; &quot;todos/todo.rjs&quot;
+      }
     end
+
   end
 
   def new
@@ -129,24 +126,43 @@ class TodosController &lt; ApplicationController
     #render :action =&gt; &quot;sort.rjs&quot;
   end
 
+  def update
+    if @todo.update_attributes(params[:todo])
+      if request.xhr?
+        show
+      else
+        flash[:notice] = &quot;Todo updated!&quot;
+        redirect_to :action =&gt; :index
+      end
+    else
+      render :text =&gt; &quot;Error in update&quot;
+    end
+  end
 
   def edit
-    if request.post?
-      #@todo = Todo.for_project(@project.id).find(params[:id])
-      if @todo.update_attributes(:text =&gt; params[:text])
-        @allowed_to_edit = User.current.allowed_to?(:edit_todos, parent_object)
-        respond_to do |format|
-          format.html { redirect_to :action =&gt; 'index' }
-          format.js { render :action =&gt; 'update', :controller =&gt; :todos  }
-        end
-      else
-        flash.now[:error] =  @todo.errors.collect{|k,m| m}.join
-        respond_to do |format|
-          format.html { redirect_to :action =&gt; 'index' }
-          format.js { render :action =&gt; 'edit', :controller =&gt; :todos }
-        end
+    if request.xhr?
+      respond_to do |format|
+        format.html { render :partial =&gt; &quot;todos/inline_edit.html&quot;, :locals =&gt; {:todo =&gt; @todo} }
       end
+    else
+      raise &quot;Non-ajax editing not supported...&quot;
     end
+    
+      #if @todo.update_attributes(:text =&gt; params[:text])
+      #  @allowed_to_edit = User.current.allowed_to?(:edit_todos, parent_object)
+      #  respond_to do |format|
+      #    format.html { render :partial =&gt; &quot;todos/inline_edit.html&quot;, :locals =&gt; {:todo =&gt; @todo} }
+          #format.js { render :action =&gt; 'update', :controller =&gt; :todos  }
+          #format.js { render :partial =&gt; &quot;todos/inline_edit.html&quot;, :locals =&gt; {:todo =&gt; @todo} }
+      #  end
+      #else
+      #  flash.now[:error] =  @todo.errors.collect{|k,m| m}.join
+      #  respond_to do |format|
+          #format.html { redirect_to :action =&gt; 'index' }
+      #    format.js { render :action =&gt; 'edit', :controller =&gt; :todos }
+      #  end
+      #end
+
   end
 
  protected</diff>
      <filename>app/controllers/todos_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,11 @@
       :html =&gt; {:class =&gt; 'icon-new'}, 
       :update =&gt; &quot;todo#{todo.id}-new-box&quot; ) 
         
+    %&gt;&lt;%= link_to_remote( image_tag('edit.png', :title =&gt; 'Edit'), 
+      :url =&gt; edit_polymorphic_url( [parent_object,todo]), :method =&gt; :get,
+      :html =&gt; {:class =&gt; 'icon-edit'}, 
+      :update =&gt; &quot;todo_#{todo.id}&quot; )
+      
     %&gt;&lt;%= link_to_remote( image_tag('delete.png', :title =&gt; l(:todo_delete_tooltip)), 
       :url =&gt; polymorphic_url([ parent_object,todo]), :method =&gt; :delete,
       :confirm =&gt; l(:text_are_you_sure), :html =&gt; {:class =&gt; 'icon-delete'}, </diff>
      <filename>app/views/todos/_todo.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -94,3 +94,15 @@ dt.todo {
     background-image:url(../images/todo.png);
 }
 
+.todos-edit {
+  border: 1px solid #e4e4e4; 
+  padding: 0.7em; 
+  margin:0.4em; 
+  background-color:#f6f6f6;
+  float: left;
+}
+.clearer {}
+.todos-edit form { display: inline; }
+
+
+</diff>
      <filename>assets/stylesheets/todos.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,6 @@
 #custom routes for this plugin
 ActionController::Routing::Routes.draw do |map|
-  #map.with_options :controller =&gt; 'todos' do |todos_routes|
 
-    #todos_routes.new_issue_todo 'projects/:project_id/issues/:issue_id/todos/:parent_id/new', :action =&gt; 'new'
-    #todos_routes.new_project_todo 'projects/:project_id/todos/:parent_id/new', :action =&gt; 'new'
-    #todos_routes.connect 'projects/:project_id/issues/:issue_id/todos/:parent_id/new(.:format)', :action =&gt; 'new'
-    #todos_routes.connect &quot;projects/:project_id/todos/:action/:id&quot;
-    #todos_routes.connect &quot;projects/:project_id/todos/:action/:id.:format&quot;
-    
-  #end
   map.resources :todos, :name_prefix =&gt; 'project_', :path_prefix =&gt; '/projects/:project_id',
     :member =&gt; {:toggle_complete =&gt; :post }, :collection =&gt; {:sort =&gt; :post}
   
@@ -26,4 +18,14 @@ ActionController::Routing::Routes.draw do |map|
   
   #  map.resources :comments, :path_prefix =&gt; '/articles/:article_id'
 
+    #map.with_options :controller =&gt; 'todos' do |todos_routes|
+
+    #todos_routes.new_issue_todo 'projects/:project_id/issues/:issue_id/todos/:parent_id/new', :action =&gt; 'new'
+    #todos_routes.new_project_todo 'projects/:project_id/todos/:parent_id/new', :action =&gt; 'new'
+    #todos_routes.connect 'projects/:project_id/issues/:issue_id/todos/:parent_id/new(.:format)', :action =&gt; 'new'
+    #todos_routes.connect &quot;projects/:project_id/todos/:action/:id&quot;
+    #todos_routes.connect &quot;projects/:project_id/todos/:action/:id.:format&quot;
+    
+  #end
+
 end</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ Redmine::Plugin.register :redmine_todos_plugin do
   name 'Redmine Todo Lists plugin'
   author 'David Lyons'
   description 'A plugin to create and manage agile-esque todo lists on a per project basis.'
-  version '0.0.3.8'
+  version '0.0.3.9'
   
 
   settings :default =&gt; {
@@ -39,11 +39,11 @@ Redmine::Plugin.register :redmine_todos_plugin do
     permission :view_todos, {:todos =&gt; [:index, :show] }
       
     permission :edit_todos,
-      {:todos =&gt; [:create, :destroy, :new, :toggle_complete, :sort, :edit],
-        :issues =&gt; [:create, :destroy, :new, :toggle_complete, :sort, :edit]}
+      {:todos =&gt; [:create, :destroy, :new, :toggle_complete, :sort, :edit, :update],
+        :issues =&gt; [:create, :destroy, :new, :toggle_complete, :sort, :edit, :update]}
   
     permission :use_personal_todos,
-      {:mytodos =&gt; [:index,:destroy, :new, :create, :toggle_complete, :index, :sort, :edit]}
+      {:mytodos =&gt; [:index,:destroy, :new, :create, :toggle_complete, :index, :sort, :edit, :update]}
          
   end
  </diff>
      <filename>init.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>14be91d1cd48b29fc583901509c6b463bda951d2</id>
    </parent>
  </parents>
  <author>
    <name>David Lyons</name>
    <email>dalyons@gmail.com</email>
  </author>
  <url>http://github.com/dalyons/redmine-todos-scrum-plugin/commit/e981add4a7ca858b115318d0f50091546b860a80</url>
  <id>e981add4a7ca858b115318d0f50091546b860a80</id>
  <committed-date>2009-09-30T23:43:18-07:00</committed-date>
  <authored-date>2009-09-30T23:43:18-07:00</authored-date>
  <message>Re-implemented editing functionality to be more fully featured</message>
  <tree>d164470d87eb9a24bb03cd226fc403dd28947df4</tree>
  <committer>
    <name>David Lyons</name>
    <email>dalyons@gmail.com</email>
  </committer>
</commit>
