diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb
index 778a0435..3e2c5ce7 100644
--- a/tracks/app/controllers/context_controller.rb
+++ b/tracks/app/controllers/context_controller.rb
@@ -24,7 +24,7 @@ class ContextController < ApplicationController
#
def add_context
context = Context.new
- context.name = @params["new_context"]["name"]
+ context.attributes = @params["new_context"]
if context.save
flash["confirmation"] = "Succesfully created context"
diff --git a/tracks/app/controllers/todo_controller.rb b/tracks/app/controllers/todo_controller.rb
index 7480127d..082a2e0d 100644
--- a/tracks/app/controllers/todo_controller.rb
+++ b/tracks/app/controllers/todo_controller.rb
@@ -13,7 +13,7 @@ class TodoController < ApplicationController
def list
@page_title = "List tasks"
@projects = Project.find_all
- @places = Context.find_all
+ @places = Context.find_all( "hide=0", "id ASC")
@done = Todo.find_all( "done=1", "completed DESC", 5 )
@count = Todo.count( "done=0" )
end
diff --git a/tracks/app/views/context/_not_done.rhtml b/tracks/app/views/context/_not_done.rhtml
index a0a88ed8..4d9d8ff7 100644
--- a/tracks/app/views/context/_not_done.rhtml
+++ b/tracks/app/views/context/_not_done.rhtml
@@ -1,7 +1,7 @@
<% @item = not_done %>
| <%= check_box( "item", "done", "onclick" => "document.location.href='/todo/toggle_check/#{@item.id}'" ) %> |
- <%= link_to( $edit_img, { :action => "edit", :id => @item.id }, :title => "Edit item" ) + " " + link_to($delete_img, { :action => "destroy", :id => @item.id }, :title => "Delete item", :confirm => "Are you sure you want to delete this entry: #{@item.description}" ) + " " %> |
+ <%= link_to( $edit_img, { :action => "edit", :id => @item.id }, :title => "Edit item" ) + " " + link_to($delete_img, { :controller => "todo", :action => "destroy", :id => @item.id }, :title => "Delete item", :confirm => "Are you sure you want to delete this entry: #{@item.description}" ) + " " %> |
<%= due_date( @item.due ) %>
<%= @item.description %>
<% if @item.project_id %>
diff --git a/tracks/app/views/context/list.rhtml b/tracks/app/views/context/list.rhtml
index 5565cfa5..ecc6b0e4 100644
--- a/tracks/app/views/context/list.rhtml
+++ b/tracks/app/views/context/list.rhtml
@@ -10,6 +10,13 @@
<% end %>
| <%= @context.id.to_s %> |
<%= link_to( "#{@context.name.capitalize}", :action => "show", :id => @context.id ) %> |
+
+ <% if @context.hide == 1 %>
+ hidden
+ <% else %>
+ shown
+ <% end %>
+ |
<%= link_to($edit_img, { :action => "edit", :id => @context.id }, :title => "Edit item" ) + " " + link_to($delete_img, { :action => "destroy", :id => @context.id }, :title => "Delete item", :confirm => "Are you sure you want to delete this context: #{@context.name}. Any todos in this context will be deleted.") + " " %> |
<% row += 1 %>
@@ -24,6 +31,9 @@