Commit graph

4262 commits

Author SHA1 Message Date
lukemelia
a2b660bd77 Shaped up the print stylesheet. It now validates, hides edit/delete images, sizes checkboxes appropriately, displays dotted borders under h2 elements, and puts each Todo's descriptions on the same line as its checkbox. Made the formatting more consistent, too.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@367 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-09 04:38:20 +00:00
lukemelia
7cf9cbf62b Restored some inadvertently commented tests. Also, I forgot to mention that the last changeset also removed lightbox.js and lightbox.css. I noticed they were adding to total page size unnecessarily as they are not used.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@366 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-08 07:56:21 +00:00
lukemelia
d7bb7555a0 Upgraded to Rails version to 1-2-pre-release branch revision 5704. Lots of stuff is deprecated in Rails 1.2, so this changeset
also removes deprecated methods. All tests pass (at least on my machine!) and raise no deprecation warnings.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@365 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-08 07:41:20 +00:00
lukemelia
baf649e143 Remove rails dir in to prepare for upgrading to 1-2-pre-release
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@364 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-08 07:25:43 +00:00
bsag
9c37b40f3d Gathered up calls to init and init_todos in before_filters, as suggested by <a href="http://www.therailsway.com/2006/11/16/tracks-part-2">Part 2</a> of the RailsWay article series.
There are a couple of test errors that I can't seem to fix. 

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@363 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-26 12:13:48 +00:00
lukemelia
ad6616d161 Todo validation messages are now hidden after a successful submit.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@362 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-22 06:08:34 +00:00
lukemelia
4a944fe7c1 Fixed a boolean test that was wrong in the last two changesets.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@361 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 06:59:36 +00:00
lukemelia
731adedf98 Doh. Missed an important question mark in the last commit.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@360 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 06:50:28 +00:00
lukemelia
d57b313376 Enable converting active actions to deferred actions and vice versa by editing the show_from date. Fixes #396.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@359 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 06:34:32 +00:00
lukemelia
85486a6233 Fixes #403 "When prefs are set to date formats other than %m-%d-%y, database errors are produced on save."
This bug was due to the Chronic library integration, which I commented out for now.

In its youthful state, Chronic has a U.S.-centered worldview with only limited support for non-U.S. date formats. In particular, its tests show that it can support parsing 5/27/1979 and 27/5/1979 but are silent on the more challenging case of 12/11/2006 or 11/12/2006. I see no way to configure the plugin with date format. Without that, all users would have to use the (admittedly awkward) U.S. date format.

Maybe we could prefer a successful format-respecting date parse and fall back to a Chronic parse?

I also updated the "action due"" text on deferred items to use the user's date format.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@358 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 06:04:39 +00:00
lukemelia
fd67a7341e Fixes #404. "Create a new deferred todo in the tickler go to due field. The calendar is shown go to the 'show from' field. The calendar is not shown" The problem was a javascript error from the partially disabled keyboard shortcuts in the calendar. They are now totally disabled until we work out the Chronic parsing stuff.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@357 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 05:10:32 +00:00
lukemelia
b243e0d393 * After project or context was edited in listing page, it could not be dragged. This is now fixed.
* Added in-place editing of to project and context detail pages



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@356 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-21 04:54:07 +00:00
lukemelia
e96d91c5c0 Fixes #402. "The AutoCompleter? for the project field does not work when adding a new Next Action if any of your Project names have an apostrophe in them. (Like a project named "Steve's bike")."
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@355 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-20 12:40:04 +00:00
lukemelia
7cc9f27cc3 Remove files that are no longer used by Tracks.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@354 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-20 12:35:28 +00:00
lukemelia
6ed264c198 Fixes #401. "When adding a Project on the projects page, the form is submitted and Project added, but the page does not update to show the new Project (a manual refresh is needed)."
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@353 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-20 12:28:55 +00:00
lukemelia
bb1cfe613a * Replaced select widgets with AutoCompleters for project & context in new item and edit forms. You can now create a new project and/or context on the fly as you're adding an item.
* Rolled Deferred controller, views & helper into Todo.
* Made the show_from field always available on the add new item and edit forms.
* Added validation to Todo to make sure a context is specified.
* Set initial state of Todo to :deferred when show_from is specified (I still need to make handle setting show_from during an edit).
* Created a generic rescue_action in ApplicationController and removed boilerplate rescue code from a few actions in TodoController.
* Made all Todo creation requests use the TodoController, removing duplicate logic from ContextController and ContextController
* Removed unused lightbox-style add item form
* Remove unused update_context and update_project actions
* Updated rails javascripts to the same as our vendor/rails



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@352 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-20 04:31:00 +00:00
bsag
5d51ca84ba Rationalised and streamlined the flash and error notifications, using a method outlined here by Andreas Aderhold:
http://blog.andreasaderhold.com/2006/07/rails-notifications

All flash messages now show up as an overlay on the right hand side of the navigation header, and also fade automatically, so that you don't have to refresh the page. Errors (i.e. validation errors) are shown as close to the originating form as possible.

Two new notify methods (one for controllers, and one for RJS templates) help construct the flash of whatever type you like. e.g.

In controllers:

notify :warning, "This is the message"

In RJS:

notify :warning, "This is the message", 5.0



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@351 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-19 16:52:58 +00:00
lukemelia
fed0daa96d Complete the transition of acts_as_todo_container to todo_list, a simple module.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@350 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-18 06:18:17 +00:00
lukemelia
807cb1e759 Working with acts_as_state_machine, it's tricky to create an object with a state other than the one you've defined as the initial state. This caused a bug where deferred actions were not being created with a :deferred state. Fixed this. Fixes #400.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@349 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-18 05:01:23 +00:00
lukemelia
b9b4330b8d Convert :dependent => true to :dependent => :delete_all on Project and Context, and brought acts_as_todo_container under test in anticipation of conversion to a simple module.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@348 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-17 14:08:56 +00:00
bsag
1d4c33e21d Tidied up the mobile view.
* Fixed a bug where pages other than the first page in filtered views would generate an error. It turns out to be difficult to paginate the filtered pages without increasing complexity quite a lot, so I'm leaving them unpaginated. By definition, viewing single contexts or projects should involve a much smaller subset than all the active todos.
* Edited actions were getting 'state' set to zero rather than active or completed. Fixed that and made sure that checking the 'done' box completes the action
* Changed some of the names of actions to bring them more in line with the todo_controller (i.e. list -> index, update_action -> update)
* Added functional tests for mobile actions

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@347 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-17 12:44:27 +00:00
lukemelia
78a89ccf3b Refactor acts_as_namepart_finder to a module, as suggested in the review of Tracks on The Rails Way.
http://www.therailsway.com/2006/11/15/tracks-part-1/



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@346 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-16 05:33:25 +00:00
lukemelia
04bd157857 Add a password to fixture's ldap_user. It's unused by the LDAP test, but it was causing some databases to have issues.
Also, because the ldap test requires external integration, it now does not run by default. To make it run set the RUN_TRACKS_LDAP_TESTS environment variable, for example:

  env RUN_TRACKS_LDAP_TESTS=true rake test:integration



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@344 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-15 14:43:12 +00:00
lukemelia
c51587e422 * Converted Todo to acts_as_state_machine. It's states are active, deferred, completed, and project_hidden. This replaces the old single inheritance model of Immediate and Deferred. Also renamed todo.completed to todo.completed_at for clarity
* Consolidated toggle_check handling to todo_controller and rjs  
* Introduced user preference to show/hide hidden projects section in sidebar
* Fixed a bug in parse_date_per_user_prefs that was causing due dates to be set in the todo model as Times and not Dates
* Upgraded ARTS plugin
* This changeset includes migrations, so remember to db:migrate.
* Lots of code changes here, so bug reports will be gratefully accepted!



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@343 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-15 09:05:07 +00:00
lukemelia
883bcb30bb Implement Null Object pattern for Todo.project to save bsag and I some script/console headaches. Thanks to
Craig Ambrose for the "writeup":http://blog.craigambrose.com/articles/2006/09/22/active-record-associations-and-the-null-object-pattern



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@342 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-14 04:37:28 +00:00
bsag
7fb8140129 Fixed adding of actions with due dates from the context and project pages, which I broke with addition of Chronic parsing. Formerly, the record would be saved, but the page would not update using Ajax.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@341 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-13 12:36:07 +00:00
bsag
838b2d83c2 Applied Luke's patch to init_not_done_counts to exclude actions from hidden projects in the count shown in the sidebar.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@340 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-13 11:53:27 +00:00
bsag
a4963a9883 Tinkered a bit with the display of actions in hidden projects. It seems to me that hidden projects are ones that are in some sense 'on hold', so you probably don't want actions in those projects displayed on the home page, or on the context pages (though you still want to be able to view that project to evaluate whether it should be made active, and perhaps queue up more actions in it).
Now actions in hidden projects are hidden on the home page and context pages. Hidden projects are also listed separately in the sidebar (this should perhaps be included in the user preference for showing completed projects in the sidebar). The counts in the sidebar for projects and contexts *include* the hidden project actions, because I haven't fixed that yet. Also, excluding the hidden project actions is done in a really clunky way until I can get my head around the new acts_as_todo_container class.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@339 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-12 19:12:36 +00:00
lukemelia
e957f86cd1 Convert multiline { || ... } blocks into do || ... end for nicer style.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@338 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-08 06:25:18 +00:00
lukemelia
4caca8db70 Improved reliability of ldap test (somewhat... it's still very environment specific).
Fixed validations in User model.
Updated environment.rb.tmpl to be a little easier to follow.

A note for upgraders. Be sure to include the following line in your environment.rb:

 AUTHENTICATION_SCHEMES = ['database']

See environment.rb.tmpl for details



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@337 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-06 07:32:48 +00:00
lukemelia
b57765486d Add explicit User < ActiveRecord::Base definition to migration 009 so that it will work for a user upgrading from r280 to trunk. John Athayde reported this problem on the mailing list.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@336 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-06 04:29:28 +00:00
lukemelia
8c193a65d6 A few of the flash fixes slipped by the last commit.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@335 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-05 10:47:51 +00:00
lukemelia
99b734a52c My apologies for this large, multi-pronged commit. What's here:
* Introduce Tracks::Config class to wrap environment.rb config settings
* Remove unused admin and index actions from user_controller
* Introduce flash partial and standardize on symbol keys for the flash hash
* Replace usages of render_partial with render :partial

Two new authentication options! These probably need documentation...

* Introduce LDAP authentication option (see configuration in environment.rb.tmpl). Thanks to Jeremy Evans for creating the SimpleLdapAuthenticator plugin. Note: the ldap auth integration test is likely to be fragile. Works for me on OS X with openldap, but your mileage may vary.
* Introduce Open ID authentication option (see configuration in environment.rb.tmpl and http://openid.net for more info). Thanks to East Media for the Open ID Consumer Plugin.
 
In environment.rb, you can enable any combination of the three auth options. If you have more than one selected, users can opt between them via their preferences pages. To play with the Open ID auth, you can get an identity at pip.verisignlabs.com.

Note that there are some new migrations to support the new authentication options, so don't forget to rake migrate!


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@334 a4c988fc-2ded-0310-b66e-134b36920a42
2006-11-05 10:41:59 +00:00
lukemelia
4e0b459524 Applied Tomas Rich's patch (with some refactoring) to introduce a new api method
that allows task creation using the same syntax as the "Send to kGTD" quicksilver plugin:

Put an @ in front of context name and > in front of project name so "Call jim @calls > Fix house"
would create the "Call jim" todo in the calls context and the Fix house project.

If there aren't any exact matches, it selects the first context and project that starts with the given strings,
so "Call jim @cal >Fix h" would also work.

If no project and no context are give,
it works exactly like the NewTodo.

It also supports the ability to create a new project on the fly by prefacing
the project with "new:", for example "Call jim @calls > new:Clean the porch"

The new api method the new api method has the name NewRichTodo, which neither Tomas nor I like very much.
Perhaps you have an idea for a better name?

Closes #384.

Also, I removed duplication between context and project models by
introducing acts_as_namepart_finder and acts_as_todo_container.


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@333 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-27 07:19:24 +00:00
bsag
4c2742f6f3 Started adding support for the Chronic library, to provide natural language date selections. You can now type phrases such as "tomorrow", "nov 10", "1 week hence", "10 days hence" and so on into the date box and these will be parsed into a valid date. I haven't managed to get proper validation working yet, but you'll get a live preview of the parsed date just below the input box.
What doesn't work yet:

* If you delete all characters in the date box, you'll get an error message. This will go away if you type more characters
* You'll get an error as above when the form is cleared and redisplayed after submission. Again, it will go away if you type anything in the box.
* Validation doesn't work, but the preview will display "Invalid date" if Chronic can't parse your phrase
* This isn't added to the edit form for actions yet.

Also partially fixed #394: the mobile interface works again, but you might get an error visiting the subsequent pages of a filtered view (i.e. viewing a single context or project). I'm not sure what's causing this, but it's on my list to fix.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@332 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-25 15:35:08 +00:00
lukemelia
f6965d2fe2 Changed conflicting div id "status"
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@331 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-16 07:08:50 +00:00
lukemelia
3566040418 Added a new preference which gives the user the option to see the full name of the project/context in an action listing instead of [P] or [C]. Defaults to false,
which is the same as the current behavior. 



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@330 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-16 06:38:59 +00:00
lukemelia
c8f4f34f24 Fix a bug that occured when an action's project was changed from nil to an actual project.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@329 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-16 06:04:37 +00:00
lukemelia
77bb3f556c I think this fixes the migration. Let me know if your done status is converted properly or not.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@328 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-16 04:33:15 +00:00
lukemelia
f67e36871c Simplify some find methods in todo_controller using associations. Fix a bug in the RSS and TEXT feeds created by yesterday's change to the project status.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@327 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-12 05:00:46 +00:00
lukemelia
fa4b1c4c7b When a "next action" is edited from a project page and the edit changes the project, the "next action" now disappears from the page as it should. Fixes #392
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@326 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-12 03:48:48 +00:00
lukemelia
c89a8249ed Applied an anonymous patch from Germany to add a "mark as done" link to RSS feed items. Fixes #386
Danke!



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@325 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-11 04:40:58 +00:00
lukemelia
57005432e2 Converted "done" property of a project into a status with states of 'active', 'hidden' & 'completed'. Fixes #389.
Added acts_as_state_machine plugin and made Project use it to implement this change.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@324 a4c988fc-2ded-0310-b66e-134b36920a42
2006-10-10 07:17:54 +00:00
lukemelia
8b65f1e8ee Make the latest migration behave well in the case of a missing refresh preference value. Patch provided by Blair Zajac. Thanks, Blair! Closes #382.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@323 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-22 00:26:23 +00:00
lukemelia
f3223c5474 Apply Blair Zajac's patch that fixes my botched migration (013). Closes #381.
Thanks, Blair!



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@322 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-21 04:18:02 +00:00
lukemelia
50211a3ebe Add a preference to hide hidden contexts in the sidebar.
Rework the preferences as a model unto itself and clean up the view and controller code around preferences.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@321 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-17 06:53:33 +00:00
lukemelia
d74635d229 Add user preference to hide completed projects in the sidebar.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@320 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-16 23:19:07 +00:00
lukemelia
6fa8439c4a Add first_name, last_name, and display_name to the User and make first and last names editable via the preferences interface. The display_name attribute is used in the upper right-hand corner of the standard layout and falls back to use the login if neither first_name of last_name are set.
This is the beginning of Tony Shadwick's request http://www.rousette.org.uk/projects/forums/viewthread/70/



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@319 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-16 16:01:29 +00:00
lukemelia
ba3757f29e Rename new_context and new_project actions to create to fit into the CRUD model, add tests for these methods, too.
Add a plugin to allow executing tests using an in-memory sqlite database. Faster!



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@318 a4c988fc-2ded-0310-b66e-134b36920a42
2006-09-16 06:50:22 +00:00
lukemelia
3e22381187 Deleting actions was broken. Should be fixed now.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@317 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-25 04:24:58 +00:00