witten
/
luminotes
Archived
1
0
Fork 0
Commit Graph

142 Commits

Author SHA1 Message Date
Dan Helfman 78f049c305 Fixed bug in model.Group SQL select. 2008-06-02 19:53:09 -07:00
Dan Helfman 79e2c45533 New controller.Groups class and a new controller.Users.check_group() method.
Also a new model.Group.sql_load_users() method.
Lots of unit tests.
2008-05-29 16:36:14 -07:00
Dan Helfman 173adffa82 Updated to also reap group-related data. 2008-05-29 14:01:22 -07:00
Dan Helfman df3d170362 View groups that you're a member of, with an indicatation if you're an admin of that group.
- modify controller.Users.current() to return the user's groups
    - update test_current() unit tests to expect empty groups list in results
  - modify Main_page, Notebook_rss, Front_page, Tour_page, and Upgrade_page to accept a new groups parameter
    - Main_page should add it as a hidden HTML variable
  - update Wiki.js to read the hidden groups variable and display the groups in account settings
2008-05-28 16:05:38 -07:00
Dan Helfman bcedc11e9a Added user_group-related SQL methods to model.User. 2008-05-28 13:33:33 -07:00
Dan Helfman f610577bf8 New model.Group class to wrap group-related tables. 2008-05-28 13:32:38 -07:00
Dan Helfman d38ca756a2 Added database schema changes to support user group-related tables, views, and indices. 2008-05-27 15:22:18 -07:00
Dan Helfman ae5c911c1c New multiple-notebook search query was way too slow. Now fixed.
- make model.Notebook.sql_search_notes() search either with user_id or an anonymous user_id, not both
  - update controller.Notebooks.search(), so if the anonymous user has access to the given notebook,
    then run the search as the anonymous user instead of the given user id
  - update unit tests
  - don't search trash/deleted notebooks
2008-05-19 22:36:21 -07:00
Dan Helfman 02a3544590 Search result now return notes from multiple notebooks.
- change model.Notebook.sql_search_notes() to be a static method
   - take a first_notebook_id argument and a user_id argument
   - join user_notebook on notebook_id and matches on user_notebook.user_id instead of notebook_id
   - order by notebook_id = first_notebook desc, rank instead of just rank
   - include search result for notebooks readable by anonymous user, but only if such a notebook is given as first_notebook_id
 - update code that calls model.Notebook.sql_search_notes()
 - update model.Note.to_dict() to include notebook_id
 - modify Wiki.display_search_results()
   - separate search results for the current notebook and results for all other notebooks
   - indicate which notebook each result is from
   - if there are results in other notebooks but no results in the current notebook, indicate that clearly
   - when you click on a result note link in the current notebook, it should simply open a new note
   - when you click on a result note link in another notebook, it should open in a new window
 - test in IE
 - update unit tests for:
   - controller.Notebooks.search()
   - model.Notebook.sql_search_notes()
   - model.Note.to_dict()
2008-05-19 15:16:25 -07:00
Dan Helfman 18982dc129 Implemented basic user account settings. Now you can change your email
address.
2008-05-08 03:05:35 +00:00
Dan Helfman d7f9e96604 Forgot to update the schema.sql file based on delta/1.3.14.sql 2008-05-07 20:40:34 +00:00
Dan Helfman c6ab3b5da0 Fixed a database indexing bug that prevented notes with really long (~2700+
character) titles from saving correctly.

Changed the literal quotation character in the starting wiki note to the
""" character entity so it doesn't show up as a change in the diff.
2008-05-05 22:56:20 +00:00
Dan Helfman 97c373561d * Added replace_contents() to model.Note to set the contents without updating the revision or anything else.
* Added new optional previous_revision params to default(), contents() and load_note() in controller.Notebooks.
   These use Html_differ() to generate and return diffs.
 * Updated Wiki.js:
   * provide previous_revision when a revision is opened in a new window/tab
   * call load_note() when two revisions when a revision is clicked in Changes_pulldown
   * update compare_versions() to display a diff instead of opening the two revisions separately
   * update load_editor():
     * update all invocations of load_editor(), including in Editor.js, to accept a new previous_revision argument
     * modify load_editor() to use the previous_revision argument (when supplied) to load a diff
2008-05-03 04:29:23 +00:00
Dan Helfman eb587fc44f Fixed bug where recent notes were ordered by creation time instead of revision time. 2008-04-18 20:39:23 +00:00
Dan Helfman 5d97c2b194 Fixed minor bug in initdb that caused initial anonymous user creation with
owner permission to main notebook.

Fixed variable shadowing bug when picking out notebook to use in header "my
wiki" link.
2008-04-04 07:54:17 +00:00
Dan Helfman 16333c48ec Additional comments on upgrading. 2008-03-17 21:58:54 +00:00
Dan Helfman 0967965847 Implemented transition script to set the ranks for all users' notebooks. 2008-03-17 21:51:26 +00:00
Dan Helfman 94a51889f9 Added ability to reorder notebooks on the right side of the page.
Need to complete unit tests for controller.Notebooks.move_up() and move_down().
2008-03-15 03:04:59 +00:00
Dan Helfman 7bf2cc35b4 Updating schema dump with newest indices. 2008-03-05 00:38:44 +00:00
Dan Helfman 21ccc97826 Now using memcached in various places to improve performance. If the Python
cmemcache module is not importable, then memcached simply won't be used.
2008-03-05 00:34:58 +00:00
Dan Helfman bb89c42e60 * Wrote a database reaper script to delete unused notes, notebooks, etc.
* Added some database indices to improve select performance.
2008-03-04 20:01:59 +00:00
Dan Helfman 8dee52a9d8 This public schema comment caused a problem on an install for one user. 2008-02-24 02:31:55 +00:00
Dan Helfman 65ce915755 When saving a note, auto-delete any files that used to be linked from it but no longer are. Still need unit tests. 2008-02-22 19:47:28 +00:00
Dan Helfman e0c65a6ac4 File deletion now works. Still need unit tests. 2008-02-21 00:41:08 +00:00
Dan Helfman eb18b6020d File renaming works. Unit tests still pending.
File deleting implemented. Testing and unit tests still pending.
Now releasing session lock at top of download() to prevent session deadlocks.
2008-02-20 23:25:13 +00:00
Dan Helfman 3d5baa1e24 * Quota storage calculation now takes uploaded files into account.
* controller.Files.upload() now updates user quota storage.
 * When a file is uploaded, the new storage bytes count is returned to the client and displayed.
2008-02-20 00:57:10 +00:00
Dan Helfman b80ad248f9 Fixed to make progress bar and download link work properly in IE 6 and 7. 2008-02-18 23:44:17 +00:00
Dan Helfman b543121767 Now Content-Type header is saved upon upload and sent upon download. 2008-02-18 20:19:36 +00:00
Dan Helfman 731dc52623 More work on file uploading. Unit tests need to be fixed. 2008-02-18 20:08:07 +00:00
Dan Helfman ffd2d15175 Now, if you delete a notebook and the only remaining notebook is read-only,
then a new read-write notebook is created for you automatically. This fixes a
bug where you could delete a notebook and have only a read-only notebook
remaining, thereby having no way to add a new notebook.
2008-01-24 22:02:02 +00:00
Dan Helfman 7bdc228d09 A user can now revoke their own access. Protecting users from the own
stupidity proved too complex and fragile. So now they have the full power to
shoot themselves in the foot.

A user can no longer, however, redeem an invite that they send to themself.
2008-01-06 21:59:22 +00:00
Dan Helfman 28473599e0 Updating storage quota calculation to only include notebooks that the user owns. 2008-01-04 22:54:01 +00:00
Dan Helfman 5520fe5892 * make a User_revision object containing a revision timestamp, user_id, username
* change controller.Notebooks.load_note_revisions() to select and return User_revision objects
 * change controller.Notebooks.save_note() to use User_revision objects for new_revision and previous_revision as well
 * update client to deal with new load_note_revisions() return values (make sure all uses of revisions_list are updated)
 * update client to deal with new new_revision/previous_revision
 * update changes pulldown to show username along with each timestamp
 * update model.Invite to load redeemed_username along with redeemed_user_id
 * display the redeemed username next to each email address in the "share this notebook" note
2008-01-04 04:45:43 +00:00
Dan Helfman e086114478 Unicode passwords containing special characters would break sha.new(). Now they're encoded as utf8 first. 2008-01-03 22:04:34 +00:00
Dan Helfman a354eadcbb When saving a model.Notebook or model.Note to the database, set the user_id field based on the current user. 2008-01-01 01:44:54 +00:00
Dan Helfman d0d87731d2 * Preventing a user from revoking their own access.
* More unit tests for revoking access.
2007-12-30 01:20:38 +00:00
Dan Helfman 8372b03373 Began work on invite redeeming. 2007-12-18 00:05:13 +00:00
Dan Helfman 4a5aeaed98 Implemented server-side portion of revoke_invite(), so now the UI for revoking invites functions properly. 2007-12-14 01:53:12 +00:00
Dan Helfman f9b4d41a15 model.Invite.sql_load_similar() should not require from_user_id to be the same.
This way, when there are multiple notebook owners, they can get each others' similar invites.
2007-12-13 23:17:24 +00:00
Dan Helfman 225167035d * model.Invite now has a to_dict() method, like other model classes do.
* Initial invites are now returned through Main_page() and displayed (but not
   yet updated) within the "share this notebook" note.
2007-12-12 00:52:34 +00:00
Dan Helfman 5554b1df17 * Started a static upgrade HTML file with rate plans.
* Fixed Invite.sql_update() to have SQL params in proper order.
 * Fixed bug where email addresses containing "-" were considered invalid.
 * Made UI for inviting other people to your notebook.
 * Tweaked the rate plans and added a new one.
2007-12-11 01:15:03 +00:00
Dan Helfman a615f65d29 Made send_invites() update any similar invites that have already been sent. 2007-12-06 22:05:00 +00:00
Dan Helfman 10cee7291a Improved input validation on search terms, so certian punctuation doesn't cause the query to fail. 2007-12-06 03:49:50 +00:00
Dan Helfman 32fd09b3f7 * Implemented controller.Users.send_invites().
* Added some SQL indices to invite table.
2007-12-06 01:32:20 +00:00
Dan Helfman 1cb12f6ae4 Making various notebook/user functions support the new "owner" access flag. 2007-12-04 21:28:03 +00:00
Dan Helfman 274a87dee2 New model.Invite object for the invite table.
Renamed sent_user_id column to from_user_id, which makes a lot more sense.
2007-12-03 23:34:35 +00:00
Dan Helfman 82bf5bca29 Schema and model changes to support invitations and multiple user collaboration:
* added new database table of invited email addresses
 * altered user_notebook table to have a new owner boolean column, indicating whether the user has owner access to the notebook
 * altered notebook and note tables/views to have an additional user_id field to indicate the user that created that revision
 * updated model.Notebook and model.Note to support new user_id field
2007-12-01 01:08:16 +00:00
Dan Helfman 0152b49475 Refactored the way note summaries are created in the link pulldown window. 2007-11-27 21:28:25 +00:00
Dan Helfman eec5ef6411 Implemented delete forever for notebooks. And unit tests! 2007-11-17 23:29:22 +00:00
Dan Helfman 7bd83199a1 Almost done with notebook deletion/undeletion. Just need to implement delete forever. 2007-11-17 22:55:13 +00:00
Dan Helfman 34f7d223d1 Changed things so the client is responsible for filtering out deleted notebooks from the display instead of the server. 2007-11-17 04:55:53 +00:00
Dan Helfman cdd971780e Began work on notebook deletion and subsequent undo/undeletion.
Changed schema slightly to support this.
Added a schema delta file and wrote an UPGRADE doc with info on how to upgrade schemas.
2007-11-17 04:21:48 +00:00
Dan Helfman 44a1cb79c2 Added basic multipage navigation to blog.
Made name of notebook link at the top of the page better for "special" Luminotes notebooks.
2007-11-10 01:46:56 +00:00
Dan Helfman b5b29c3e97 Making drop_html_tags() function turn "<br/>" into " ". 2007-11-09 00:37:13 +00:00
Dan Helfman 9fccf7c81f Removed debugging print. 2007-11-02 22:05:31 +00:00
Dan Helfman 3124e97e47 Updated INSTALL document and schema dump for new full-text search. 2007-11-02 20:57:11 +00:00
Dan Helfman 37e886f27c Revamped searching to use PostgreSQL's tsearch2 full-text searching. 2007-11-02 20:19:53 +00:00
Dan Helfman ad58956f34 Some early work in support of a reverse chronological order view of a notebook, useful for a blog. 2007-10-30 23:05:46 +00:00
Dan Helfman 5a49506eee Simpler, faster, and more correct storage usage calculation. 2007-10-22 08:11:50 +00:00
Dan Helfman 27a6a06c91 Display a realtime count of total notes next to the "all notes" link. 2007-10-19 20:24:16 +00:00
Dan Helfman 3e0dbe0509 Rewrote *_current views to use MAX sub-query trick instead of SELECT DISTINCT ON, thereby greatly reducing query duration. 2007-10-16 11:01:05 +00:00
Dan Helfman 322134cba6 Password reset now stores and uses a revision timestamp, which helps when testing for expiry. 2007-10-11 20:18:20 +00:00
Dan Helfman bbebad528e Renaming new_model to model, now that the old bsddb model is out of the way. 2007-10-11 19:49:00 +00:00
Dan Helfman 17ad869635 Old model no longer needed now that all databases are convered to PostgreSQL. 2007-10-11 19:45:46 +00:00
Dan Helfman 43c6f54e9f Merged revisions 401-446 via svnmerge from
svn+ssh://torsion.org/home/luminotes/repos/luminotes/branches/postgres

................
  r402 | witten | 2007-10-04 00:48:49 -0700 (Thu, 04 Oct 2007) | 3 lines

  Initialized merge tracking via "svnmerge" with revisions "1-401" from
  svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk
................
  r404 | witten | 2007-10-04 01:17:07 -0700 (Thu, 04 Oct 2007) | 2 lines

  Beginning a conversion from bsddb to postgres.
................
  r405 | witten | 2007-10-04 01:18:58 -0700 (Thu, 04 Oct 2007) | 9 lines

  Merged revisions 402-404 via svnmerge from
  svn+ssh://torsion.org/home/luminotes/repos/luminotes/trunk

  ........
    r403 | witten | 2007-10-04 01:14:45 -0700 (Thu, 04 Oct 2007) | 2 lines

    Yay, no more stupid deprecation warnings from simplejson about the sre module.
  ........
................
  r406 | witten | 2007-10-04 15:34:39 -0700 (Thu, 04 Oct 2007) | 4 lines

   * Switched back to Python 2.4 because many Python modules in Debian are not packaged to work with Python 2.5
   * Began removal of all references to Scheduler, @async, yield, and so on.
   * Converted Database.py to support PostgreSQL and updated its unit tests accordingly.
................
  r407 | witten | 2007-10-04 16:34:01 -0700 (Thu, 04 Oct 2007) | 2 lines

  All unit tests for the new model classes now pass.
................
  r409 | witten | 2007-10-05 00:53:56 -0700 (Fri, 05 Oct 2007) | 2 lines

  Reordering some columns and adding some indices.
................
  r410 | witten | 2007-10-05 16:08:37 -0700 (Fri, 05 Oct 2007) | 4 lines

  Now adding trash notebooks to user_notebook table. Also switching db
  conversion/verification tools back to require Python 2.5, since they still use
  the old Scheduler, which requires 2.5 generator features.
................
  r411 | witten | 2007-10-06 16:26:56 -0700 (Sat, 06 Oct 2007) | 2 lines

  Lots more unit tests passing. Most of the recent work was on controller.Users and related stuff.
................
  r412 | witten | 2007-10-07 01:52:12 -0700 (Sun, 07 Oct 2007) | 2 lines

  controller.Users unit tests now finally pass!
................
  r413 | witten | 2007-10-07 02:14:10 -0700 (Sun, 07 Oct 2007) | 3 lines

  Got controller.Root unit tests passing.
  Moved fake sql_* function shenanigans from Test_users.py to Test_controller.py, for use by other controller unit tests.
................
  r414 | witten | 2007-10-08 23:11:11 -0700 (Mon, 08 Oct 2007) | 2 lines

  All unit tests pass! Fuck yeah!
................
  r415 | witten | 2007-10-08 23:13:07 -0700 (Mon, 08 Oct 2007) | 2 lines

  Removing all references to Scheduler from luminotes.py
................
  r416 | witten | 2007-10-08 23:54:51 -0700 (Mon, 08 Oct 2007) | 3 lines

  Converted deleted_from to deleted_from_id in a few more places.
  Fixed bug in Users.contents().
................
  r417 | witten | 2007-10-09 00:11:59 -0700 (Tue, 09 Oct 2007) | 3 lines

  Typo fix in Note sql method.
  Adding autocommit flag to Database.next_id() method.
................
  r418 | witten | 2007-10-09 00:13:19 -0700 (Tue, 09 Oct 2007) | 2 lines

  Updating unit test for new auto commit flag.
................
  r419 | witten | 2007-10-09 00:14:09 -0700 (Tue, 09 Oct 2007) | 2 lines

  Removing debugging print.
................
  r420 | witten | 2007-10-09 00:20:55 -0700 (Tue, 09 Oct 2007) | 2 lines

  More sql fixes. I really need some funtional tests that hit the database and exercise the SQL.
................
  r421 | witten | 2007-10-09 00:51:34 -0700 (Tue, 09 Oct 2007) | 3 lines

  Fixed controller.Database handling of tuple as an Object_type.
  Made SQL for user storage calculation better at handling null values and also more succinct.
................
  r422 | witten | 2007-10-09 13:32:16 -0700 (Tue, 09 Oct 2007) | 2 lines

  Converting Wiki.js to trash_id notebook member instead of trash object.
................
  r423 | witten | 2007-10-09 13:42:10 -0700 (Tue, 09 Oct 2007) | 2 lines

  No longer displaying "download as html" on the front page, as people see "download" and think they're downloading the software.
................
  r424 | witten | 2007-10-09 14:24:40 -0700 (Tue, 09 Oct 2007) | 2 lines

  Notebooks.contents() now returns notebooks with correct read-write status.
................
  r425 | witten | 2007-10-09 14:32:25 -0700 (Tue, 09 Oct 2007) | 2 lines

  Fixed reporting of validation errors to the user. Now says "The blah is missing." instead of just "is missing"
................
  r426 | witten | 2007-10-09 17:05:22 -0700 (Tue, 09 Oct 2007) | 2 lines

  No longer redirecting to trash notebook upon login.
................
  r427 | witten | 2007-10-09 17:20:33 -0700 (Tue, 09 Oct 2007) | 2 lines

  Made controller.Database use a connection pool.
................
  r429 | witten | 2007-10-09 20:13:30 -0700 (Tue, 09 Oct 2007) | 2 lines

  Converted initdb.py and updatedb.py to Postgres from bsddb.
................
  r430 | witten | 2007-10-09 20:37:14 -0700 (Tue, 09 Oct 2007) | 2 lines

  Changing error message to remove underscores from variable names.
................
  r431 | witten | 2007-10-10 13:23:30 -0700 (Wed, 10 Oct 2007) | 2 lines

  Removing unused note_title parameter from Wiki.create_editor().
................
  r432 | witten | 2007-10-10 13:25:16 -0700 (Wed, 10 Oct 2007) | 2 lines

  Revision regular expression now supports timezone notation.
................
  r433 | witten | 2007-10-10 14:43:47 -0700 (Wed, 10 Oct 2007) | 2 lines

  Finished implementing ranked ordering for startup notes. (However, there's no way to change the rank from the client yet.)
................
  r434 | witten | 2007-10-10 16:25:19 -0700 (Wed, 10 Oct 2007) | 4 lines

  More strict access checking. Fixed oversight in Postgres DB conversion where,
  in certain controller.Notebook methods, access was only checked at the
  notebook level, not at the note level as well.
................
  r435 | witten | 2007-10-10 17:45:18 -0700 (Wed, 10 Oct 2007) | 3 lines

  Now loading revisions on demand from client when the "changes" button is clicked. Also caching
  loading revisions so subsequent clicks don't have to reload.
................
  r436 | witten | 2007-10-10 21:31:20 -0700 (Wed, 10 Oct 2007) | 2 lines

  Tweaking some of the error handling in Expose and Root so that unhandled errors give a generic error message to the client.
................
  r437 | witten | 2007-10-10 21:33:49 -0700 (Wed, 10 Oct 2007) | 2 lines

  The release script no longer runs initdb.py, because the default database is no longer a single file included in the tarball.
................
  r438 | witten | 2007-10-10 21:40:11 -0700 (Wed, 10 Oct 2007) | 2 lines

  Updated install instructuctions to include use of initdb.py.
................
  r439 | witten | 2007-10-10 21:56:42 -0700 (Wed, 10 Oct 2007) | 3 lines

  Made initdb.py only nuke (drop tables/views) when given a command-line flag.
  Also made install directions more correct.
................
  r440 | witten | 2007-10-10 21:58:48 -0700 (Wed, 10 Oct 2007) | 2 lines

  IE 6 doesn't like commas.
................
  r441 | witten | 2007-10-10 22:08:50 -0700 (Wed, 10 Oct 2007) | 4 lines

  load your notebook. without clicking on "changes", edit a note that has previous revisions. click on "changes". it'll only show
  the most recent revision. fixed by not appending to changes as a result of a save unless the client-side revisions list cache has
  something in it
................
  r442 | witten | 2007-10-10 23:30:41 -0700 (Wed, 10 Oct 2007) | 2 lines

  Forgot to actually save off the new revision as editor.revision.
................
  r443 | witten | 2007-10-11 01:35:54 -0700 (Thu, 11 Oct 2007) | 13 lines

  More intelligent datetime handling:
    * convertdb.py assumes old bsddb database timestamps are Pacific, and then
      converts them to UTC before inserting them into the new PostgreSQL
      database.
    * No longer using naked timezoneless datetime objects in model/controller
      code, except in unit tests that need compatability with pysqlite. Now
      using UTC everwhere.
    * Asking PostgreSQL to give us all timestamps back in UTC.
    * New dependency on python-tz (pytz) package, noted in INSTALL doc.
    * Client now responsible for converting UTC timestamps to local time for
      display.
................
  r444 | witten | 2007-10-11 01:46:09 -0700 (Thu, 11 Oct 2007) | 2 lines

  Tweak to prevent potential race in IE.
................
  r445 | witten | 2007-10-11 01:49:58 -0700 (Thu, 11 Oct 2007) | 2 lines

  Got JavaScript "unit" tests passing again.
................
  r446 | witten | 2007-10-11 01:53:58 -0700 (Thu, 11 Oct 2007) | 2 lines

  Noting that js tests require the Luminotes server on localhost.
................
2007-10-11 09:03:43 +00:00
Dan Helfman 54dee52dc7 Reordering some columns and adding some indices. 2007-10-05 07:50:51 +00:00
Dan Helfman 937f4bd0eb Very seriously considering switching from bsddb to PostgreSQL. If that
happens, I'd use this schema and this conversion script (incomplete).
2007-10-02 01:11:35 +00:00
Dan Helfman 0052858fdc Set email util. 2007-09-27 02:33:24 +00:00
Dan Helfman f6da052e88 Self-service password reset functionality, plus full unit tests.
GOD DAMN that was annoying to implement.
2007-09-26 23:49:27 +00:00
Dan Helfman 4d736d4821 Lots of work on user storage quotas:
* Each model.User now has a current storage bytes and a rate plan.
 * model.User.to_dict() updated accordingly.
 * Minor Scheduler.add() change to bail of the given thread is None.
 * controller.Users.current() returns current user's rate plan details.
 * controller.Users.update_storage() now takes an optional callback.
 * Various methods in controller.Notebooks responsible for calling controller.Users.update_storage().
 * Added rate plan details to config/Common.py.
 * Added quota utilization colors to style.css.
 * Implemented quota utilization calculation and display in Wiki.js.

Still to-do: Return updated storage bytes where appropriate in controller.Notebook and update the
client accordingly.
2007-09-20 20:36:19 +00:00
Dan Helfman ebf1538313 model.User now has a storage_bytes member, and controller.Users has a method for calculating and updating this field. 2007-09-13 00:53:49 +00:00
Dan Helfman 295369bad5 None notes are skipped. 2007-09-04 23:27:50 +00:00
Dan Helfman e2079bbca8 Fixed problem with note titles being incorrectly set for notes containing multiple sets of <h3></h3> titles.
The solution involved making the regular expression for title parsing non-greedy.
2007-09-04 22:01:42 +00:00
Dan Helfman fd175aa85d No longer sending quite as much data in response to /users/current requests.
Now the client has to explicitly request the inclusion of startup notes.

Also no longer including startup notes or revision lists with every single
serialized Notebook.
2007-08-27 22:37:22 +00:00
Dan Helfman 20313728d2 Several changes to handle the case where a note is changed out from under you, due to being saved
from a different window:
 * Made controller.notebooks responsible for preventing unmodified notes from being saved, instead
   of model.Notebook handling this task.
 * Created a revision validator for passing revisions as arguments to exposed methods.
 * controller.Notebooks.save_note() now requires a previous_revision parameter, used to determine
   whether the note has been modified in the particular window it's being saved from.
 * save_note() returns a new previous_revision value, so the client can determine whether a save
   has occurred from another window.
 * controller.Notebooks.undelete_note() fixed to quietly bail if the note to undelete isn't
   actually deleted, which can happen if it was undeleted in another window.
 * Editor() now responsible for making revisions list if it doesn't exist
 * No longer giving an "undo" message when the user deletes an empty note.
 * On the client side, detecting whether the previous_revision as reported by save_note() looks
   correct, and if not, alerting the user about the conflict. Also displaying a "compare versions"
   button that opens both the current version and the previous version.
2007-08-23 23:56:42 +00:00
Dan Helfman f2eac9cb1f Implemented a basic trash, including undo upon note deletion and undeletion from the trash:
* model.Note has a deleted_from member to indicate the notebook id it was deleted from (if any)
 * controller.Notebooks sets the deleted_from member and makes all deleted notes startup notes in the trash
 * new controller.Notebooks.undelete_note() method
 * split up the idea of UI messages into errors and informational messages, with separate CSS
 * updated Editor and Wiki UI code to deal with new deleted_from variable
 * added "undelete" button when viewing a deleted note, and "delete" changes to "delete forever"
 * added a "trash" link to the notebook links
 * reorganized responsibilities for displaying notebook/user links among Wiki.populate() and Wiki.display_user()
 * when deleting messages in a notebook with a trash, displaying "The note has been moved to the trash"...
   with a working undo button!
 * tweaked focusing logic in display_search_results(), which has been renamed to display_loaded_notes()
2007-08-07 01:48:43 +00:00
Dan Helfman 1796ccca71 Schema evolution: Adding a trash member to those Notebooks that don't have it. 2007-08-03 21:55:02 +00:00
Dan Helfman 4e28620348 * Added a trash Notebook to model.Notebook.
* Made sure the trash is not exposed by the read-only notebook view.
 * Modified model.User.check_access() to consider read-write access to a
   notebook to be sufficient for access to that notebook's trash.
 * Modified controller.Users so new users are created with a notebook that
   has a trash.
 * Changed controller.Notebooks so deleted notes go to the trash (if any).
2007-08-03 21:12:17 +00:00
Dan Helfman 58665fe14a Handle None notes. 2007-08-01 20:10:54 +00:00
Dan Helfman ccfcd3ccfe * Added convenience method to model.Notebook called is_startup_note(), and made use of it.
* is_startup_note() checks whether the object id of the given note is in the list of startup notes,
   not whether the actual object is.
 * This fixed a bug in which the same note could be saved to the list of startup notes multiple
   times, thereby causing funny display problems when the same note was loaded twice.
2007-08-01 02:23:54 +00:00
Dan Helfman f23fcdde21 * Can now click on revision timestamps to open up the contents of previous note revisions with a small timestamp at the top.
* Revisions can be opened either in the current page or in a new window/tab.
 * Added ability for a read-write notebook to contain read-only notes. This supports showing read-only revisions.
 * Fixed updatedb.py to properly load the anonymous user.
 * Updated initdb.py and updatedb.py to deadl with new-style /notebooks/notebookid?note_id=noteid wiki links.
 * Made Persistent copy the revisions_list on each revision update so different revisions don't share lists.
 * Prevented Note from updating its revision twice upon construction. Now it's only updated once.
 * Work-around for nasty urlparse() caching bug related to unicode strings that cherrypy barfs on.
 * Added optional revision flag to various controller.Notebooks methods to allow opening of a notebook with a particular note revision displayed.
2007-07-31 22:53:57 +00:00
Dan Helfman e963007ae5 This __setstate__ function is no longer necessary, as all databases have been converted to the new schema. 2007-07-28 04:09:37 +00:00
Dan Helfman f05d3db661 * Added a "changes" tab with a list of revision timestamps for each note. Note yet clickable.
* Made controller.Notebooks.save_note() return the newly minted revision timestamp upon a successful save.
 * Whenever we get back a revision timestamp from save_note(), we store in in the client's list of revisions for that note.
 * Now raising Access_error in controller.Notebooks in various places where the notebook requested is unknown.
 * Tweaked pulldown CSS a bit. Now will sport a handy-dandy scrollbar if the pulldown gets too tall, at least in real browsers.
 * Fixed bug where clicking "show on startup" checkbox directly didn't visually toggle the checkbox.
2007-07-26 01:18:41 +00:00
Dan Helfman 852a432712 Making each object have a list of its previous revisions. 2007-07-21 04:17:31 +00:00
Dan Helfman 0129c2a2c3 Schema change to secondary ids are stored with their class, not just their bare id. 2007-07-20 20:05:02 +00:00
Dan Helfman 733e104872 Now that the databases are changed from Entry to Note, removing schema evolution stuff. 2007-07-18 20:05:55 +00:00
Dan Helfman eb957d169b Re-adding Entry yet again, and putting __setstate__() back in Notebook to
properly update the database's schema for Entry -> Note.
2007-07-18 20:05:13 +00:00
Dan Helfman 2bdf683ae4 Removing __setstate__() methods and the Entry class now that all databases
have been switched over to new Note class. In the future some schema evolution
script would probably be useful.
2007-07-17 17:32:15 +00:00
Dan Helfman 15d4758766 Fixed __setstate__() methods to update revision. 2007-07-17 17:29:47 +00:00
Dan Helfman 433b3b3915 Temporarily re-adding Entry for db conversion purposes. 2007-07-17 01:54:03 +00:00
Dan Helfman 0976fdf8c6 Renaming all entries to notes to fit better with the name "Luminotes". 2007-07-17 01:21:31 +00:00
Dan Helfman 02cfca5322 Renaming repository to new name: luminotes 2007-07-16 20:22:38 +00:00