diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index c4dc99fd..2ceb6c5a 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -17,7 +17,7 @@ class ProjectController < ApplicationController # def list @page_title = "TRACKS::List Projects" - @projects = Project.find(:all, :conditions => nil, :order => "position ASC") + @projects = Project.find(:all, :conditions => nil, :order => "done ASC, position ASC") end # Filter the projects to show just the one passed in the URL diff --git a/tracks/app/views/context/_context_listing.rhtml b/tracks/app/views/context/_context_listing.rhtml index b8440af7..9ce946ee 100644 --- a/tracks/app/views/context/_context_listing.rhtml +++ b/tracks/app/views/context/_context_listing.rhtml @@ -25,7 +25,7 @@ <% end %> <%= link_to_function(image_tag( "edit", :title => "Edit item", :width=>"10", :height=>"10", :border=>"0"), "Element.toggle('context-#{context.id}','context-#{context.id}-edit-form'); new Effect.Appear('context-#{context.id}-edit-form'); Form.focus_first('form-context-#{context.id}');" ) + " " + - link_to_remote( image_tag("delete", :title =>"Delete this context"), + link_to_remote( image_tag("delete", :title =>"Delete this context", :height=>"10", :width=>"10", :border=>"0"), :update => "context-#{context.id}-container", :loading => "new Effect.Squish('context-#{context.id}-container')", :url => { :controller => "context", :action => "destroy", :id => context.id }, :confirm => "Are you sure that you want to delete the context \'#{context.name}\'?" ) %> diff --git a/tracks/app/views/project/_project_listing.rhtml b/tracks/app/views/project/_project_listing.rhtml index 8da7488a..7dc69ee4 100644 --- a/tracks/app/views/project/_project_listing.rhtml +++ b/tracks/app/views/project/_project_listing.rhtml @@ -24,7 +24,7 @@ <% end -%> <%= link_to_function(image_tag( "edit", :title => "Edit item", :width=>"10", :height=>"10", :border=>"0"), "Element.toggle('project-#{project.id}','project-#{project.id}-edit-form'); new Effect.Appear('project-#{project.id}-edit-form'); Form.focus_first('form-project-#{project.id}');" ) + " " + - link_to_remote( image_tag("delete", :title =>"Delete this project"), + link_to_remote( image_tag("delete", :title =>"Delete this project",:width=>"10", :height=>"10", :border=>"0"), :update => "project-#{project.id}-container", :loading => "new Effect.Squish('project-#{project.id}-container')", :url => { :controller => "project", :action => "destroy", :id => project.id }, :confirm => "Are you sure that you want to delete the project \'#{project.name}\'?" ) %> diff --git a/tracks/db/tracks_1.0.2_content.sql b/tracks/db/tracks_1.0.2_content.sql index 516dcb03..a2f20eb5 100644 --- a/tracks/db/tracks_1.0.2_content.sql +++ b/tracks/db/tracks_1.0.2_content.sql @@ -24,9 +24,9 @@ INSERT INTO contexts (id,name,hide, position) VALUES (11,'waiting-for',0, 8); -- Dump of table projects -- ------------------------------------------------------------ -INSERT INTO projects (id,name, position) VALUES (1,'Build a working time machine', 0); -INSERT INTO projects (id,name, position) VALUES (2,'Make more money than Billy Gates', 1); -INSERT INTO projects (id,name, position) VALUES (3,'Evict dinosaurs from the garden', 2); +INSERT INTO projects (id,name,position,done) VALUES (1,'Build a working time machine',1,0); +INSERT INTO projects (id,name,position,done) VALUES (2,'Make more money than Billy Gates',2,0); +INSERT INTO projects (id,name,position,done) VALUES (3,'Evict dinosaurs from the garden',3,0); -- Dump of table todos diff --git a/tracks/db/tracks_1.0.2_postgres.sql b/tracks/db/tracks_1.0.2_postgres.sql index 6fec1849..8b0560d5 100644 --- a/tracks/db/tracks_1.0.2_postgres.sql +++ b/tracks/db/tracks_1.0.2_postgres.sql @@ -18,6 +18,7 @@ create table projects ( id serial not null, name varchar(255) not null default '', position int NOT NULL, + done int not null default 0, primary key (id) ); diff --git a/tracks/db/tracks_1.0.2_sqlite.sql b/tracks/db/tracks_1.0.2_sqlite.sql index 354d93cb..b613ced1 100644 --- a/tracks/db/tracks_1.0.2_sqlite.sql +++ b/tracks/db/tracks_1.0.2_sqlite.sql @@ -8,7 +8,7 @@ CREATE TABLE 'contexts' ( 'id' INTEGER PRIMARY KEY, 'name' varchar(255) NOT NULL default '', 'hide' tinyint(4) NOT NULL default '0', - position int NOT NULL + 'position' int NOT NULL ) ; @@ -19,7 +19,8 @@ CREATE TABLE 'contexts' ( CREATE TABLE 'projects' ( 'id' INTEGER PRIMARY KEY, 'name' varchar(255) NOT NULL default '', - position int NOT NULL + 'position' int NOT NULL, + 'done' tinyint(4) NOT NULL default '0' ) ; diff --git a/tracks/db/tracks_1.0.2_tables_mysql.sql b/tracks/db/tracks_1.0.2_tables_mysql.sql index b085ea6e..b2fa2f86 100644 --- a/tracks/db/tracks_1.0.2_tables_mysql.sql +++ b/tracks/db/tracks_1.0.2_tables_mysql.sql @@ -27,6 +27,7 @@ CREATE TABLE `projects` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL default '', `position` int(11) NOT NULL, + `done` tinyint(4) NOT NULL default '0', PRIMARY KEY (`id`) ) TYPE=MyISAM;