From db7084dabe8257705c6c1eaa90f97d729767c949 Mon Sep 17 00:00:00 2001 From: bsag Date: Sat, 20 Aug 2005 10:40:20 +0000 Subject: [PATCH] Added in most of Tony Shadwick's patches. The main change is that projects now have an optional description field, in which you can describe the aims or main point of the project. If present, it's displayed just below the project name on the [tracks_url]/show/[project_name] page. A placeholder page is also added for future configuration of users: [tracks_url]/user/index and [tracks_url]/user/admin. It doesn't do anything useful yet ;-). I added the database changes as a migrate task, so running: {{{ rake migrate }}} at the command line inside your tracks directory will automatically update your database (if you are using either MySQL or PostgreSQL. Fixes #84. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@137 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/project/_project_form.rhtml | 12 ++++++++++-- tracks/app/views/project/_project_listing.rhtml | 2 +- tracks/app/views/project/list.rhtml | 9 +++++---- tracks/app/views/project/show.rhtml | 3 +++ tracks/db/tracks_1.031_mysql.sql | 1 + tracks/db/tracks_1.031_postgres.sql | 1 + tracks/db/tracks_1.031_sqlite.sql | 1 + tracks/doc/CHANGELOG | 1 + tracks/public/stylesheets/standard.css | 16 ++++++++++++++++ tracks/test/fixtures/projects.yml | 6 ++++++ 10 files changed, 45 insertions(+), 7 deletions(-) diff --git a/tracks/app/views/project/_project_form.rhtml b/tracks/app/views/project/_project_form.rhtml index e9f818d0..adcaba7c 100644 --- a/tracks/app/views/project/_project_form.rhtml +++ b/tracks/app/views/project/_project_form.rhtml @@ -6,9 +6,17 @@ <%= @project.position %>
- -<%= text_field 'project', 'name', :class => 'project-name' %> +

<%= check_box 'project', 'done', :class => 'project-done' %> +

+

+
+<%= text_field 'project', 'name', :class => 'project-name' %> +

+

+
+<%= text_area 'project', 'description', "cols" => 30, "rows" => 4, :class => 'project-description' %> +

<% @project = nil %> \ 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 9607b23b..dcb9762e 100644 --- a/tracks/app/views/project/_project_listing.rhtml +++ b/tracks/app/views/project/_project_listing.rhtml @@ -38,7 +38,7 @@ @@ -30,4 +31,4 @@
<%= @flash["warning"] %>
<% end %> - \ No newline at end of file + \ No newline at end of file diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml index 3ce893cb..b9850d0f 100644 --- a/tracks/app/views/project/show.rhtml +++ b/tracks/app/views/project/show.rhtml @@ -2,6 +2,9 @@

<%= @project.name %>

+<% if @project.description -%> +
<%= @project.description %>
+<% end -%>
<% if @project.done == 1 -%> diff --git a/tracks/db/tracks_1.031_mysql.sql b/tracks/db/tracks_1.031_mysql.sql index c670bfd6..5925b665 100644 --- a/tracks/db/tracks_1.031_mysql.sql +++ b/tracks/db/tracks_1.031_mysql.sql @@ -26,6 +26,7 @@ CREATE TABLE `projects` ( `position` int(11) NOT NULL default '0', `done` tinyint(1) default '0', `user_id` int(11) NOT NULL default '1', + `description` varchar(255) default '', PRIMARY KEY (`id`) ) TYPE=InnoDB; diff --git a/tracks/db/tracks_1.031_postgres.sql b/tracks/db/tracks_1.031_postgres.sql index d49b0b58..7637f2a4 100644 --- a/tracks/db/tracks_1.031_postgres.sql +++ b/tracks/db/tracks_1.031_postgres.sql @@ -28,6 +28,7 @@ create table projects ( position int not null, done int not null default 0, user_id int not null default 1, + description varchar(255) default '', primary key (id) ); diff --git a/tracks/db/tracks_1.031_sqlite.sql b/tracks/db/tracks_1.031_sqlite.sql index 7ac8a5b2..65693bed 100644 --- a/tracks/db/tracks_1.031_sqlite.sql +++ b/tracks/db/tracks_1.031_sqlite.sql @@ -22,6 +22,7 @@ CREATE TABLE 'projects' ( 'name' varchar(255) NOT NULL default '', 'position' int NOT NULL, 'done' tinyint(4) NOT NULL default '0', + 'description' varchar(255) default '', 'user_id' int NOT NULL default '1' ) ; diff --git a/tracks/doc/CHANGELOG b/tracks/doc/CHANGELOG index 958dabf2..e5d159f0 100644 --- a/tracks/doc/CHANGELOG +++ b/tracks/doc/CHANGELOG @@ -24,6 +24,7 @@ Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/ 7. Added loginhash to settings.yml. 8. Modify signup to prevent is_admin being set by malicious user. Begin work on standardising layout for login controller. 9. BIGGEST NEW FEATURE: Tracks is now properly multi-user, thanks to the work of Nicholas Lee. Any new users that you sign up can't view any of your next actions, contexts, projects or notes, and they get a clean slate to add their own. Great Things are planned in this direction... +10. Projects now have a description field which you can edit in the form on [tracks_url]/projects. It's optional, but you can use it to remind you of the aims or purpose of the project. If you have a description, it's displayed in italics just under the project name. == Version 1.03 diff --git a/tracks/public/stylesheets/standard.css b/tracks/public/stylesheets/standard.css index 64cecd38..93a67562 100644 --- a/tracks/public/stylesheets/standard.css +++ b/tracks/public/stylesheets/standard.css @@ -121,6 +121,7 @@ a.show_notes:hover {background-image: url(../images/notes_on.png); background-re margin-top: 0px; margin-left: -5px; margin-right: -5px; + margin-bottom: 0px; /* CHECK */ color: #fff; text-shadow: rgba(0,0,0,.4) 0px 2px 5px; } @@ -422,6 +423,21 @@ div#list-projects, div#list-contexts { padding-bottom: 5px; } +div.project_description { + background: #eee; + padding: 5px; + margin-top: 0px; + margin-left: -5px; + margin-right: -5px; + color: #666; + font-style: italic; + font-size: 12px; + font-weight: normal; + /* Uncomment line below if you want the description to have + shadowed text */ + /* text-shadow: rgba(0,0,0,.4) 0px 2px 5px; */ + } + /* Form elements */ form { border: 1px solid #CCC; diff --git a/tracks/test/fixtures/projects.yml b/tracks/test/fixtures/projects.yml index 4f6dc14a..d346ddde 100644 --- a/tracks/test/fixtures/projects.yml +++ b/tracks/test/fixtures/projects.yml @@ -3,14 +3,20 @@ timemachine: id: 1 name: Build a working time machine + description: '' + done: 0 user_id: 1 moremoney: id: 2 name: Make more money than Billy Gates + description: '' + done: 0 user_id: 1 gardenclean: id: 3 name: Evict dinosaurs from the garden + description: '' + done: 0 user_id: 1