witten
/
luminotes
Archived
1
0
Fork 0

Luminotes Discussion forums now change the discussion thread link color based on whether there are any new posts since you last visited the thread.

This commit is contained in:
Dan Helfman 2009-03-16 17:09:31 -07:00
parent 205adeb904
commit fe99862dde
5 changed files with 38 additions and 2 deletions

3
NEWS
View File

@ -1,6 +1,9 @@
1.6.9: ?
* Added a remove formatting feature to the tools menu. This allows you to
strip out all formatting from the currently selected text.
* Luminotes Discussion forums now change the discussion thread link color
based on whether there are any new posts since you last visited the
thread. This makes it much easier to keep up with a particular discussion.
* Fixed a bug in which the filename of an exported HTML file was just
"export" instead of being based on the notebook name.

View File

@ -169,9 +169,10 @@ class Forum( object ):
start = Valid_int( min = 0 ),
count = Valid_int( min = 1, max = 50 ),
note_id = Valid_id( none_okay = True ),
posts = Valid_int(),
user_id = Valid_id( none_okay = True ),
)
def default( self, thread_id, start = 0, count = 10, note_id = None, user_id = None ):
def default( self, thread_id, start = 0, count = 10, note_id = None, posts = None, user_id = None ):
"""
Provide the information necessary to display a forum thread.
@ -183,6 +184,10 @@ class Forum( object ):
@param count: number of recent notes to display (defaults to 10 notes)
@type note_id: unicode or NoneType
@param note_id: id of single note to load (optional)
@type posts: integer or NoneType
@param posts: ignored. used for link-visitedness purposes on the client side
@type user_id: unicode or NoneType
@param user_id: id of the current user
@rtype: unicode
@return: rendered HTML page
@raise Validation_error: one of the arguments is invalid

View File

@ -268,6 +268,28 @@ class Test_forums( Test_controller ):
user = self.database.load( User, self.user.object_id )
assert user.storage_bytes == 0
def test_general_thread_default_with_posts( self ):
result = self.http_get( "/forums/general/%s?posts=20" % self.general_thread.object_id )
assert result.get( u"user" ).object_id == self.anonymous.object_id
assert len( result.get( u"notebooks" ) ) == 4
assert result.get( u"notebooks" )[ 0 ].object_id == self.anon_notebook.object_id
assert result.get( u"login_url" )
assert result.get( u"logout_url" )
assert result.get( u"rate_plan" )
assert result.get( u"notebook" ).object_id == self.general_thread.object_id
assert len( result.get( u"startup_notes" ) ) == 0
assert result.get( u"notes" ) == []
assert result.get( u"parent_id" ) == None
assert result.get( u"note_read_write" ) in ( None, True )
assert result.get( u"total_notes_count" ) == 0
invites = result[ "invites" ]
assert len( invites ) == 0
user = self.database.load( User, self.user.object_id )
assert user.storage_bytes == 0
def test_general_thread_default_with_unknown_note_id( self ):
result = self.http_get( "/forums/general/%s?note_id=unknownid" % self.general_thread.object_id )

View File

@ -277,6 +277,10 @@ form {
line-height: 200%;
}
.forum_threads a:visited {
color: purple;
}
.forum_title {
font-weight: bold;
font-size: 105%;

View File

@ -49,7 +49,9 @@ class Forum_page( Product_page ):
[ Div(
A(
thread.name,
href = os.path.join( base_path, ( forum_name == u"blog" ) and thread.friendly_id or thread.object_id ),
href = ( forum_name == u"blog" ) and \
os.path.join( base_path, thread.friendly_id ) or \
"%s?posts=%s" % ( os.path.join( base_path, thread.object_id ), thread.note_count ),
),
Span(
self.post_count( thread, forum_name ),