Commit graph

152 commits

Author SHA1 Message Date
bsag
26c7a1e6f1 Created an admin controller that allows the admin user (only) to view the users on the system and destroy and signup new users. Destroying a user deletes all of their actions, contexts, projects and notes.
The link to the admin page only appears when an admin user is logged in, and the signup link is now on the admin page, rather than appearing in the mini-links at the top of the page.

The page also lists some statistics associated with each user (the number of actions, contexts, projects etc. each user has).

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@371 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-10 19:30:19 +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
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
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
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
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
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
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
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
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
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
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
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
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
lukemelia
dc73835c7b Fix the Ajax corner case described in #353 : "change of todo's context on home page should work like marking complete"
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@316 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-25 03:57:26 +00:00
lukemelia
3002fcf2f1 Created tests for backend_controller to cover security concerns, including #372 "user can add an action to another user's context via API". Modified backend_controller to close that hole and make the tests pass.
Added UserController#create to provide RESTful API for the admin user to create a new user in the system. This may be useful for the folks who have generously opened their Tracks installs to others. I have plans to document the RESTful API stuff at some point and write a Ruby wrapper.

Created a class method User.get_salt that wraps all calls to the SALT constant so that unit-tests can be always run with the default salt (I was previously needing to modify my environment.rb to run tests). 

Replaced usages of assert_success in tests with assert_response :success because assert_success is deprecated.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@313 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-25 02:25:18 +00:00
lukemelia
14c8516002 In a session-expired scenario that results from a call to tickler/check_tickler, Tracks will redirect to tickler/check_tickler after the user re-authenticates. That action only has an rjs view, so the result was a blank page. In that situation check_tickler will now trigger a redirect to the Tracks home page.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@312 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-17 02:06:07 +00:00
lukemelia
994308f581 Actions listed in TEXT feeds are now sorted in the same order as they are on the home page. Also fixed a bug where an action marked complete and then unmarked complete would be shown as complete on the TEXT feed. This addresses Jeroen van der Ham's mailing list query. Create a Trac ticket next time please, Jeroen. :-)
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@311 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-14 06:37:53 +00:00
lukemelia
a1c199131b Fixes #335. A user's token (or "word") that is used for feed and some API access will now not change unless explicity requested by the user.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@310 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-13 04:43:52 +00:00
lukemelia
a36b736c6a Freeze to rails 1.1.5. The only change I needed to make for compatibility was to ApplicationController#init_not_done_counts
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@306 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-10 03:22:47 +00:00
lukemelia
45739e12de Remove unused method (TodoController@count_shown_items), refactoring todo_controller for DRY
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@305 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-08 23:38:42 +00:00
lukemelia
c290d7a36a Some cool refactoring of the completed and completed_archive actions.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@303 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-03 01:58:49 +00:00
lukemelia
f9a2a6460d Apply Ryan Daigle's patch to fix editing contexts and projects. See #341. Does not resolve ajax loading issue mentioned in the ticket.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@302 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-03 01:07:13 +00:00
lukemelia
cf7b90101a Convert edit action to use RJS; share edit views between deferred and todo controllers; rename update_action to update in todo controller. Another step in the process of making Tracks more CRUDdy!
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@301 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-02 03:40:22 +00:00
lukemelia
9392d4d696 Unify controller action for destroying an action into the todo controller and lay some groundwork for similar requests coming from different views. Fixes #343.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@300 a4c988fc-2ded-0310-b66e-134b36920a42
2006-08-01 07:03:31 +00:00
lukemelia
1f6a99a27f Fix project and context creation rendering, which was failing because the hash for tracking the number of actions in a project or context had not been defined. Fixes #341.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@299 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-30 20:09:04 +00:00
lukemelia
ee85dea17c Applied dstrelau's patch to fix a bonehead move on my part that left a single line of an older version of code in deferred_controller. Fixes #340
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@297 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-30 02:19:14 +00:00
lukemelia
7cf219afb9 Fix context and project list feeds, which were broken in one of the last two changesets.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@296 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-29 10:26:57 +00:00
lukemelia
c606e646b3 Incorporate Ryan Daigle's patch (thanks Ryan!) to fix errors parsing non-US-style dates on the tickler show_from field. Refactor date parsing calls to use a new method in the base action controller.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@295 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-28 19:03:34 +00:00
lukemelia
e0e407d99a Optimized ActiveRecord calls to minimize SQL queries, especially on the home page. Also, moved feed page to feed controller.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@294 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-28 06:55:35 +00:00
lukemelia
afaf2235fa Clean up todo controller by extracting deferred todo functionality into a new deferred controller. Thanks to Trotter Cashion for his presentation on CRUD at the nyc.rb group that was the inspiration for this cleanup. See http://lifecoding.com/blog/?p=31 for slides.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@293 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-28 04:09:02 +00:00
bsag
803a9db6ae Added a META HTTP-EQUIV=REFRESH value to the standard layout template. The refresh value is taken from user preferences, and defaults to zero so that the page doesn't refresh automatically.
If you're using the trunk, you'll need to run rake db:migrate to update your user preferences.

Fixes #295



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@290 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-23 13:33:52 +00:00
lukemelia
89802e7e19 Make check_tickler's conversion of Deferred actions to Immediate ones bypass validation. Fixes #329
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@287 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-21 03:22:57 +00:00
lukemelia
91f272a672 Make contexts appear and disappear on the home page as items are added/deleted/marked complete. Fixes #313.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@285 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-18 05:09:54 +00:00
bsag
8c7079dba5 Added a feed (RSS and TXT) for the actions completed in the past 7 days, as promised on the home page of the Tracks projects site, but hitherto only implemented in my imagination, and not in reality as I'd somehow assumed ;-)
Fixes #323



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@284 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-17 18:54:12 +00:00
lukemelia
1ee651f8bb DRY up code around Immediate and Deferred actions, including controller methods and views
Relocated todo_controller#deferred_update_action to be next to todo_controller#update_action 
Include all non-hidden contexts on the home page, but hide the empty ones. Ground work for supporting the automatic showing of a context with zero items when an item is moved to it.
Added a comment about todo_controller#update_element -- is it used?
Remove unused #list_of method from context, note & project models
Remove unused #list_all method from note model
Methods to lazy load done_todos and not_done_todos for project and context models

Fixes #322



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@282 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-17 03:40:35 +00:00
lukemelia
b77f743bee Enabled dropping of actions on projects in the sidebar to ajaxomagically update the project for an action. Needs a little CSS work, but it's functional.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@276 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-03 00:59:31 +00:00
lukemelia
9263249e77 This changeset adds the ability to drag and drop actions between contexts and ajaxomagically update the action's context in the backend. I've tested it in Firefox and Safari, but not on other browsers.
When you start dragging an action, the other contexts collapse to provide easier targets for dropping. After the drop, the contexts return to their previously states of collapsed/expanded.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@275 a4c988fc-2ded-0310-b66e-134b36920a42
2006-07-03 00:22:28 +00:00