diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index e480125e..8faef22e 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -61,14 +61,25 @@ class ProjectController < ApplicationController # def toggle_check self.init - + item = check_user_return_item item.toggle!('done') item.completed = Time.now () # For some reason, the before_save in todo.rb stopped working - if item.save + if item.save render :partial => 'project/show_items', :object => item end end + + # Toggles the 'done' status of a project + # + def toggle_project_done + check_user_set_project + + @project.toggle!('done') + if @project.save + redirect_to(:action => "list") + end + end # Delete a project # diff --git a/tracks/app/views/project/_empty.rhtml b/tracks/app/views/project/_empty.rhtml new file mode 100644 index 00000000..f92ff187 --- /dev/null +++ b/tracks/app/views/project/_empty.rhtml @@ -0,0 +1 @@ +
<%= message %>
\ No newline at end of file diff --git a/tracks/app/views/project/_project_listing.rhtml b/tracks/app/views/project/_project_listing.rhtml index 9cc403cc..6f500d9d 100644 --- a/tracks/app/views/project/_project_listing.rhtml +++ b/tracks/app/views/project/_project_listing.rhtml @@ -9,7 +9,7 @@ <%= link_to( sanitize("#{project.name}"), :action => "show", :name => urlize(project.name) ) %><%= " (" + project.count_undone_todos("actions") + ")" %> @@ -23,10 +30,17 @@There are no completed next actions yet in this project
- <% else %> - <%= render :partial => "show_items", :collection => @done %> - <% end %> +