diff --git a/tools/initdb.py b/tools/initdb.py index 1db92e2..28398a3 100644 --- a/tools/initdb.py +++ b/tools/initdb.py @@ -44,6 +44,7 @@ class Initializer( object ): self.create_anonymous_user() if desktop is True: self.create_desktop_user() + self.database.commit() def create_main_notebook( self ): @@ -52,6 +53,10 @@ class Initializer( object ): self.main_notebook = Notebook.create( main_notebook_id, u"Luminotes" ) self.database.save( self.main_notebook, commit = False ) + # no need to create default notes for the desktop version + if self.desktop is True: + return + # create an id for each note note_ids = {} for ( filename, startup ) in self.NOTE_FILES: diff --git a/view/Header.py b/view/Header.py index 29179a0..f6b3a3f 100644 --- a/view/Header.py +++ b/view/Header.py @@ -1,13 +1,31 @@ from Tags import Div, A, Img, Span class Header( Div ): - def __init__( self, user, first_notebook, login_url, logout_url, note_title ): + def __init__( self, user, first_notebook, login_url, logout_url, note_title, rate_plan = None ): title_image = Img( src ="/static/images/luminotes_title.png", class_ = u"luminotes_title", width = u"193", height = u"60", alt = u"Luminotes", ) + if rate_plan and rate_plan.get( u"name" ) == u"desktop": + Div.__init__( + self, + Div( + ( note_title == u"home" ) and title_image or + A( title_image, href = u"http://luminotes.com/", target = "_new" ), + Div( + A( u"support", href = u"http://luminotes.com/support", target = "_new" ), u" | ", + A( u"blog", href = u"http://luminotes.com/blog", target = "_new" ), + class_ = u"header_links", + ), + class_ = u"wide_center_area", + ), + id = u"header", + class_ = u"header", + ) + return + Div.__init__( self, Div( diff --git a/view/Main_page.py b/view/Main_page.py index 91775af..9ee5afd 100644 --- a/view/Main_page.py +++ b/view/Main_page.py @@ -152,7 +152,7 @@ class Main_page( Page ): Div( id = u"status_area", ), - Header( user, header_notebook, login_url, logout_url, header_note_title ), + Header( user, header_notebook, login_url, logout_url, header_note_title, rate_plan ), Div( Div( Note_tree_area(