Header links are now properly bolded when the page for that link is being viewed.
This commit is contained in:
parent
97104fbf38
commit
0d5610fa80
|
@ -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" | ",
|
( 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,
|
( 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"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"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"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" | ",
|
( note_title == u"blog" ) and Span( u"blog", class_ = u"bold_link" ) or A( u"blog", href = u"/blog" ), u" | ",
|
||||||
|
|
|
@ -88,6 +88,22 @@ class Main_page( Page ):
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
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__(
|
Page.__init__(
|
||||||
self,
|
self,
|
||||||
title,
|
title,
|
||||||
|
@ -113,7 +129,7 @@ class Main_page( Page ):
|
||||||
Div(
|
Div(
|
||||||
id = u"status_area",
|
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(
|
||||||
Div(
|
Div(
|
||||||
Br(),
|
Br(),
|
||||||
|
|
Reference in New Issue