witten
/
luminotes
Archived
1
0
Fork 0

Header links are now properly bolded when the page for that link is being viewed.

This commit is contained in:
Dan Helfman 2008-04-04 07:17:01 +00:00
parent 97104fbf38
commit 0d5610fa80
2 changed files with 18 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class Header( Div ):
( note_title == u"tour" ) and Span( u"tour", class_ = u"bold_link" ) or A( u"tour", href = u"/tour" ), u" | ",
( user.username in ( None, u"anonymous" ) ) and Span( ( note_title == u"wiki" ) and Span( u"demo", class_ = u"bold_link" ) or A( u"demo", href = u"/users/demo" ), u" | " ) or None,
( note_title == u"faq" ) and Span( u"faq", class_ = u"bold_link" ) or A( u"faq", href = u"/faq" ), u" | ",
( note_title == u"guide" ) and Span( u"guide", class_ = u"bold_link" ) or A( u"help", href = u"/guide" ), u" | ",
( note_title == u"guide" ) and Span( u"guide", class_ = u"bold_link" ) or A( u"guide", href = u"/guide" ), u" | ",
( note_title == u"contact" ) and Span( u"contact", class_ = u"bold_link" ) or A( u"contact", href = u"/contact_info" ), u" | ",
( note_title == u"team" ) and Span( u"team", class_ = u"bold_link" ) or A( u"team", href = u"/meet_the_team" ), u" | ",
( note_title == u"blog" ) and Span( u"blog", class_ = u"bold_link" ) or A( u"blog", href = u"/blog" ), u" | ",

View File

@ -88,6 +88,22 @@ class Main_page( Page ):
except IOError:
pass
if notebook.read_write is True:
header_note_title = u"wiki"
else:
all_notes = startup_notes + notes
header_note_title = ( notebook.name == "Luminotes" ) and all_notes and all_notes[ 0 ].title or notebook.name
header_note_title = {
"contact info": "contact",
"meet the team": "team",
"Luminotes user guide": "guide",
"Luminotes blog": "blog",
"Luminotes privacy policy": "privacy",
}.get( header_note_title, header_note_title )
own_notebooks = [ notebook for notebook in notebooks if notebook.read_write is True ]
header_notebook = own_notebooks and own_notebooks[ 0 ] or notebook
Page.__init__(
self,
title,
@ -113,7 +129,7 @@ class Main_page( Page ):
Div(
id = u"status_area",
),
Header( user, notebook, login_url, logout_url, notes and notes[ 0 ].title or u"wiki" ),
Header( user, header_notebook, login_url, logout_url, header_note_title ),
Div(
Div(
Br(),