From 4aba180e6b60af4013d85e0a657d14a3aaad9d71 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Mon, 26 Jan 2009 15:51:30 -0800 Subject: [PATCH] Now no longer showing delete button on all notes in the forums.. Just your own notes. --- view/Main_page.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/view/Main_page.py b/view/Main_page.py index a6e73f9..f2fda3a 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -44,15 +44,18 @@ class Main_page( Page ): startup_note_ids = [ startup_note.object_id for startup_note in startup_notes ] def note_controls( note, read_write ): + read_write_access = ( read_write == Notebook.READ_WRITE ) or \ + ( read_write == Notebook.READ_WRITE_FOR_OWN_NOTES and note.user_id == user.object_id ) + return Div( - ( read_write != Notebook.READ_ONLY ) and Input( + read_write_access and Input( type = "button", class_ = "note_button", id = "delete_note_%s" % note.object_id, value = "delete" + ( note.deleted_from_id and " forever" or "" ), title = "delete note [ctrl-d]" ) or None, - ( read_write != Notebook.READ_ONLY ) and note.deleted_from_id and Input( + read_write_access and note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "undelete_note_%s" % note.object_id,