witten
/
luminotes
Archived
1
0
Fork 0

UI code no longer responsible for surpressing display of "Luminotes" notebook link. That's now done on the server.

This commit is contained in:
Dan Helfman 2007-08-29 18:36:41 +00:00
parent eebbabb664
commit 4e932255a4
3 changed files with 16 additions and 24 deletions

View File

@ -286,19 +286,10 @@ class Users( object ):
)
return
# in addition to this user's own notebooks, add to that list the anonymous user's notebooks
if user_id:
self.__database.load( u"User anonymous", self.__scheduler.thread )
anonymous = ( yield Scheduler.SLEEP )
notebooks = anonymous.notebooks
else:
notebooks = []
notebooks += user.notebooks
yield dict(
user = user,
notebooks = notebooks,
startup_notes = include_startup_notes and len( notebooks ) > 0 and notebooks[ 0 ].startup_notes or [],
notebooks = user.notebooks,
startup_notes = include_startup_notes and len( user.notebooks ) > 0 and user.notebooks[ 0 ].startup_notes or [],
http_url = self.__http_url,
)

View File

@ -37,10 +37,16 @@ class Test_users( Test_controller ):
self.database.next_id( self.scheduler.thread )
self.anon_notebook = Notebook( ( yield Scheduler.SLEEP ), u"anon notebook" )
self.database.next_id( self.scheduler.thread )
self.startup_note = Note( ( yield Scheduler.SLEEP ), u"contents go here" )
self.anon_notebook.add_note( self.startup_note )
self.anon_notebook.add_startup_note( self.startup_note )
self.anon_startup_note = Note( ( yield Scheduler.SLEEP ), u"contents go here" )
self.anon_notebook.add_note( self.anon_startup_note )
self.anon_notebook.add_startup_note( self.anon_startup_note )
self.database.next_id( self.scheduler.thread )
self.startup_note = Note( ( yield Scheduler.SLEEP ), u"other contents go here" )
self.notebooks[ 0 ].add_note( self.startup_note )
self.notebooks[ 0 ].add_startup_note( self.startup_note )
self.database.next_id( self.scheduler.thread )
self.user = User( ( yield Scheduler.SLEEP ), self.username, self.password, self.email_address, self.notebooks )
@ -81,11 +87,9 @@ class Test_users( Test_controller ):
assert result[ u"user" ].username == self.new_username
notebooks = result[ u"notebooks" ]
assert len( notebooks ) == 2
assert notebooks[ 0 ] == self.anon_notebook
assert notebooks[ 0 ].trash == None
assert len( notebooks ) == 1
notebook = notebooks[ 1 ]
notebook = notebooks[ 0 ]
assert notebook.object_id == new_notebook_id
assert notebook.trash
assert len( notebook.notes ) == 1
@ -94,7 +98,7 @@ class Test_users( Test_controller ):
startup_notes = result[ "startup_notes" ]
if include_startup_notes:
assert len( startup_notes ) == 1
assert startup_notes[ 0 ] == self.startup_note
assert u"welcome to your wiki" in startup_notes[ 0 ].contents
else:
assert startup_notes == []
@ -162,7 +166,7 @@ class Test_users( Test_controller ):
)
assert result[ u"user" ] == self.user
assert result[ u"notebooks" ] == [ self.anon_notebook ] + self.notebooks
assert result[ u"notebooks" ] == self.notebooks
assert result[ u"http_url" ] == self.settings[ u"global" ].get( u"luminotes.http_url" )
startup_notes = result[ "startup_notes" ]
@ -187,7 +191,7 @@ class Test_users( Test_controller ):
startup_notes = result[ "startup_notes" ]
if include_startup_notes:
assert len( startup_notes ) == 1
assert startup_notes[ 0 ] == self.startup_note
assert startup_notes[ 0 ] == self.anon_startup_note
else:
assert startup_notes == []

View File

@ -62,9 +62,6 @@ Wiki.prototype.display_user = function ( result ) {
for ( var i in result.notebooks ) {
var notebook = result.notebooks[ i ];
if ( notebook.name == "Luminotes" )
continue;
var div_class = "link_area_item";
if ( notebook.object_id == this.notebook_id )
div_class += " current_notebook_name";