def static_note_divs(notes, read_write): return [ Table( Tr(Td(note_controls(note, read_write), )), Tr( Td( Div( Span( note.contents, class_=u"static_note_contents", separator="", ), id="static_note_%s" % note.object_id, class_=u"static_note_div", ), width="100%", ), Td( u".....", id=u"note_grabber_%s" % note.object_id, class_=u"note_grabber" + (read_write != Notebook.READ_WRITE and " invisible" or ""), ), ), Tr( Td( Div(class_="note_shadow_corner"), id=u"note_shadow_%s" % note.object_id, class_=u"note_shadow undisplayed", ), ), id=u"note_holder_%s" % note.object_id, class_=u"note_holder", ) for note in notes ]
def make_item(title, link_attributes, link_class, has_children=False, root_note_id=None, target=None, base_name=None): if base_name is None: base_name = u"note_tree" return Tr( has_children and \ Td( Div( id = root_note_id and u"%s_expander_%s" % ( base_name, root_note_id ) or None, class_ = u"tree_expander" ) ) or Td( Div( id = root_note_id and u"%s_expander_%s" % ( base_name, root_note_id ) or None, class_ = u"tree_expander_empty" ) ), Td( u'<a %s%s%s class="%s">%s</a>' % ( link_attributes, root_note_id and u' id="%s_link_%s"' % ( base_name, root_note_id ) or "", target and u' target="%s"' % target or "", link_class, title or u"untitled note", ), ), id = root_note_id and u"%s_item_%s" % ( base_name, root_note_id ) or None, class_ = u"%s_item" % base_name, )
def __init__(self, support_email): title = u"404" header_image = Div( A(Img(src=u"/static/images/luminotes_title_full.png", width=u"206", height=u"69"), href=u"/", alt=u"Luminotes personal wiki notebook"), class_=u"error_header", ) Page.__init__( self, title, header_image, Div( H2(title), P( u"Sorry, the page you are looking for couldn't be found. But not to worry. You've got a few options.", Ul( Li(u"Return to the", A(u"Luminotes personal wiki notebook", href=u"/"), u"home page."), Li( A(u"Contact support", href=u"mailto:%s" % support_email), u"and report that the page you expected to find here is missing." ), ), ), class_=u"error_box", ), )
def __init__(self, password_reset_id, users): Span.__init__( self, H3(u"complete your password reset"), P(""" Below is a list of Luminotes users matching your email address. You can reset the passwords of any of these users. If you just needed a username reminder and you already know your password, then click the login link above without performing a password reset. """), Form( [ Span( P( Div(Strong(u"%s: new password" % user.username)), Input(type=u"password", name=user.object_id, size=30, maxlength=30, class_=u"text_field"), ), P( Div( Strong(u"%s: new password (again)" % user.username)), Input(type=u"password", name=user.object_id, size=30, maxlength=30, class_=u"text_field"), ), ) for user in users ], P( Input(type=u"hidden", id=u"password_reset_id", name=u"password_reset_id", value=password_reset_id), Input(type=u"submit", name=u"reset_button", id=u"reset_button", class_=u"button", value=(len(users) > 1) and u"reset passwords" or u"reset password"), ), id="reset_form", target="/users/reset_password", ), P( Strong(u"tip:"), u""" When you submit this form, you'll be redirected to the front page where you can login with your new password. """, ), )
def __init__(self, support_email, message=None): header_image = Div( A(Img(src=u"/static/images/luminotes_title_full.png", width=u"206", height=u"69"), href=u"/", alt=u"Luminotes personal wiki notebook"), class_=u"error_header", ) if message: title = u"whoops" Page.__init__( self, title, header_image, Div( H2(title), P(message), class_=u"error_box", ), ) return title = u"uh oh" Page.__init__( self, title, header_image, Div( H2(title), Noscript( P( Strong( u""" Please enable JavaScript in your web browser. JavaScript is necessary for many Luminotes features to work properly. """, ), ), ), P( u"Something went wrong! If you care, please", A("let me know about it.", href="mailto:%s" % support_email), u"Be sure to include the following information:", ), Ul( Li(u"the series of steps you took to produce this error"), Li(u"the time of the error"), Li(u"the name of your web browser and its version"), Li(u"any other information that you think is relevant"), ), P(u"Thanks!", ), class_=u"error_box", ), )
def forum_link(forum_tag, forum_name): if not forum_tag: return None if forum_name == u"blog": return Div( A(u"Luminotes %s" % forum_name, href="/blog/"), class_=u"link_area_item", ) return Div( A(u"%s forum" % forum_name, href="/forums/%s" % forum_name), class_=u"link_area_item", )
def __init__( self, title, *children, **attrs ): head_types = ( Link, Script, Meta ) # node types to move to the Head section app_name = u"Luminotes" if not title: title = u"personal wiki notebook" if "id" not in attrs: attrs[ "id" ] = u"content" # move certain types of children from the body to the head Html.__init__( self, Head( Link( rel = u"stylesheet", type = u"text/css", href = u"/static/css/style.css?%s" % VERSION ), Meta( content = u"text/html; charset=UTF-8", http_equiv = u"content-type" ), [ child for child in children if isinstance( child, head_types ) ], Title( title and u"%s: %s" % ( app_name, title ) or app_name ), """<!--[if IE 6]><link href="/static/css/ie6.css?%s" type="text/css" rel="stylesheet"></link><![endif]-->""" % VERSION, """<!--[if IE 7]><link href="/static/css/ie7.css?%s" type="text/css" rel="stylesheet"></link><![endif]-->""" % VERSION, """<!--[if IE 8]><link href="/static/css/ie8.css?%s" type="text/css" rel="stylesheet"></link><![endif]-->""" % VERSION, ), Body( Div( *[ child for child in children if not isinstance( child, head_types ) ], **attrs ), ), id = "html", xmlns = u"http://www.w3.org/1999/xhtml", prefix = u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n' )
def __init__( self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups ): Product_page.__init__( self, user, first_notebook, login_url, logout_url, u"forums", # note title Div( Div( Img( src = u"/static/images/forums.png", width = u"335", height = u"47", alt = u"Discussion Forums", ), ), Div( Span( A( u"general discussion", href = u"/forums/general/" ), class_ = u"forum_title" ), P( u""" Swap tips about making the most out of your personal wiki, and discuss your ideas for new Luminotes features and enhancements. """ ), Span( A( u"technical support", href = u"/forums/support/" ), class_ = u"forum_title" ), P( u"Having a problem with your wiki? Something not working as expected? Ask about it here." ), class_ = u"forums_text", ), class_ = u"forums_area", ), Div( P( Span( u"Need more help?", class_ = u"hook_action_question" ), Br(), A( u"Contact support directly", href = u"/contact_info", class_ = u"hook_action" ), class_ = u"hook_action_area", separator = u"", ), class_ = u"center_area", ), )
def __init__(self, image_name, *args, **kwargs): # if no corners were specified, assumed all corners should be rounded corners = kwargs.pop("corners", []) if len(corners) == 0: corners = (u"tl", u"tr", u"bl", u"br") div = Div(*args, **kwargs) for corner in corners: div = Div( div, class_=u"%s_%s" % (image_name, corner), ) Div.__init__( self, div, id=u"%s_wrapper" % (kwargs.get(u"id") or image_name), class_=u"%s_color" % image_name, )
def button_row(self, rate_plans, user, yearly=False): return Tr( [ Td( Div( # 1 = modifying an existing subscription, 0 = new subscription user and user.username not in ( u"anonymous", None ) and user.rate_plan != index \ and ( yearly and ( plan.get( u"yearly_button" ) and plan.get( u"yearly_button" ).strip() and plan.get( u"yearly_button" ) % ( user.object_id, user.rate_plan and 1 or 0 ) or None ) or \ ( plan.get( u"button" ) and plan.get( u"button" ).strip() and plan.get( u"button" ) % ( user.object_id, user.rate_plan and 1 or 0 ) or None ) ) or None, ( not user or user.username in ( u"anonymous", None ) ) and A( Img( src = u"/static/images/sign_up_button.png", width = "76", height = "23" ), href = u"/sign_up?plan=%s&yearly=%s" % ( index, yearly ), ) or None, class_ = u"subscribe_button_area", ), ( user.rate_plan == 0 ) and Div( ( index > 0 ) and "30-day free trial" or " ", class_ = u"small_text" ) or None, class_ = ( index == self.FOCUSED_PLAN and u"focused_feature_value" or u"" ), ) for ( index, plan ) in enumerate( rate_plans ) ], )
def make_fee_area(plan, index): fee_area = ( Span(plan[u"name"].capitalize(), class_=u"plan_name"), plan[u"fee"] and Div( yearly and Span( u"$%s" % plan[u"yearly_fee"], Span(u"/year", class_=u"month_text"), class_=u"price_text", separator=u"", ) or Div( u"$%s" % plan[u"fee"], Span(u"/month", class_=u"month_text"), class_=u"price_text", separator=u"", ), ) or Div(Div(u"No fee", class_=u"price_text")), Div( plan[u"designed_for"] and u"For" or " ", plan[u"designed_for"], class_=u"small_text", ), (index == self.FOCUSED_PLAN) and Div(u"Best value", class_=u"focused_text highlight") or None, ) # if this is a demo/guest user, then make the fee area a big link to the sign up page if not user or user.username in (u"anonymous", None): fee_area = A(href=u"/sign_up?plan=%s&yearly=%s" % (index, yearly), *fee_area) else: fee_area = Span(*fee_area) return fee_area
def __init__( self, image_name, *args, **kwargs ): # if no corners were specified, assumed all corners should be rounded corners = kwargs.pop( "corners", [] ) if len( corners ) == 0: corners = ( u"tl", u"tr", u"bl", u"br" ) div = Div( *args, **kwargs ) for corner in corners: div = Div( div, class_ = u"%s_%s" % ( image_name, corner ), ) Div.__init__( self, div, id = u"%s_wrapper" % ( kwargs.get( u"id" ) or image_name ), class_ = u"%s_color" % image_name, )
def __init__(self, script=None): Html.__init__( self, Head( Link(rel=u"stylesheet", type=u"text/css", href=u"/static/css/style.css?%s" % VERSION), ), Body( Div( P(u"Luminotes Desktop has been shut down."), P(u"To start Luminotes again, simply launch it from your Start Menu." ), id=u"center_area", ), ), )
def note_controls(note, read_write): read_write_access = ( read_write == Notebook.READ_WRITE ) or \ ( read_write == Notebook.READ_WRITE_FOR_OWN_NOTES and note.user_id == user.object_id ) return Div( read_write_access and Input( type = "button", class_ = "note_button", id = "delete_note_%s" % note.object_id, value = "delete" + ( note.deleted_from_id and " forever" or "" ), title = "delete note [ctrl-d]" ) or None, read_write_access and note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "undelete_note_%s" % note.object_id, value = "undelete", title = "undelete note" ) or None, ( read_write == Notebook.READ_WRITE ) and not note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "changes_note_%s" % note.object_id, value = "changes", title = "previous revisions", ) or None, ( read_write == Notebook.READ_WRITE ) and not note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "tools_note_%s" % note.object_id, value = "tools", title = "note tools", ) or None, ( read_write != Notebook.READ_ONLY or not note.startup ) and not note.deleted_from_id and \ ( read_write != Notebook.READ_WRITE_FOR_OWN_NOTES ) and Input( type = "button", class_ = "note_button", id = "hide_note_%s" % note.object_id, value = "hide", title = "hide note [ctrl-h]", ) or None, id = u"note_controls_%s" % note.object_id, class_ = u"note_controls", )
def __init__(self, file_id, filename, quote_filename): Html.__init__( self, Head(Title(filename), ), Body( A( Img(src=u"/files/image?file_id=%s" % file_id, style="border: 0;"), href= u"/files/download?file_id=%s"e_filename=%s&preview=False" % (file_id, quote_filename), ), Div( A( u"download %s" % filename, href= u"/files/download?file_id=%s"e_filename=%s&preview=False" % (file_id, quote_filename), ), ), ), )
def __init__(self, notebook, root_notes, recent_notes, total_notes_count, user): tags = [tag for tag in notebook.tags if tag.name == u"forum"] if tags: forum_name = tags[0].value forum_tag = True else: forum_name = None forum_tag = False Div.__init__( self, Div( Div( Search_form(), class_=u"link_area_item", ), H4( forum_tag and u"posts" or u"notes", Span( Span(total_notes_count, id=u"total_notes_count"), u"total", class_=u"small_text link_area_item", ), notebook.read_write != Notebook.READ_ONLY and Input( type=u"button", class_=u"note_button small_text", id=u"save_button", value=u"saved", disabled=u"true", title=u"save your work", ) or None, id=u"note_tree_area_title", ) or None, (not forum_tag) and self.make_tree( [ self.make_item( title=note.title, link_attributes=u'href="/notebooks/%s?note_id=%s"' % (notebook.object_id, note.object_id), link_class=u"note_tree_link", has_children=(notebook.name != u"trash") and self.LINK_PATTERN.search(note.contents) or False, root_note_id=note.object_id, ) for note in root_notes ], Tr( Td(), (notebook.name != u"trash" and notebook.read_write == Notebook.READ_WRITE) and Td( Input( type=u"button", class_=u"note_button", id=u"new_note_tree_link_button", value=u"+ note link", title=u"Add one of your notes to this list.", ), Span(id=u"new_note_tree_link_area"), ) or None, id=u"new_note_tree_link_row", ) or None, tree_id="note_tree_root_table", ) or None, (not forum_tag and recent_notes is not None and notebook.name != u"trash") and Span( H4( u"recent updates", id=u"recent_notes_area_title", ), self.make_tree( Tr(id="recent_notes_top"), [ self.make_item( title=note.title, link_attributes= u'href="/notebooks/%s?note_id=%s"' % (notebook.object_id, note.object_id), link_class=u"recent_note_link", has_children=False, root_note_id=note.object_id, base_name=u"recent_note", ) for note in recent_notes ], navigation=Tbody( Tr(id="recent_notes_spacer"), Tr( Td(), Td( A(u"more", href=u"#", id=u"recent_notes_more_link", class_=u"undisplayed"), A(u"less", href=u"#", id=u"recent_notes_less_link", class_=u"undisplayed"), ), ), id=u"recent_notes_navigation"), tree_id="recent_notes_table", ), ) or None, (user.username is None) and P( A(u"Download", href=u"/download", class_=u"hook_action"), Span(u" or ", class_=u"hook_action_or"), A(u"Sign up", href=u"/pricing", class_=u"hook_action"), Br(), Span("Get started in seconds.", class_=u"hook_action_detail"), class_=u"hook_action_area", separator=u"", ) or None, id=u"note_tree_area_holder", ), Span(id="tree_arrow_hover_preload"), Span(id="tree_arrow_down_preload"), Span(id="tree_arrow_down_hover_preload"), id=u"note_tree_area", )
def __init__( self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups, forum_name, threads, total_thread_count, start=0, count=None, ): base_path = cherrypy.request.path updates_path = "%s?rss" % base_path if forum_name == u"blog": full_forum_name = u"Luminotes %s" % forum_name else: full_forum_name = u"%s forum" % forum_name Product_page.__init__( self, user, first_notebook, login_url, logout_url, full_forum_name, # note title Link( rel = u"alternate", type = u"application/rss+xml", title = full_forum_name, href = updates_path ) or None, P( H1( full_forum_name ), ), Div( P( base_path.startswith( u"/forums/" ) and Span( B( A( u"start a new discussion", href = os.path.join( base_path, u"create_thread" ) ) ), u" | ", A( u"all forums", href = u"/forums/" ), u" | ", ) or None, A( u"subscribe to rss", href = updates_path ), A( Img( src = u"/static/images/rss.png", width = u"14", height = u"14", class_ = u"middle_image padding_left" ), href = updates_path, ), class_ = u"small_text", ) or None, [ Div( A( thread.name, 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 ), class_ = u"small_text", ) ) for thread in threads ], class_ = u"forum_threads", ), Page_navigation( base_path, len( threads ), total_thread_count, start, count ), )
def __init__(self, user, first_notebook, login_url, logout_url, note_title, *nodes): Page.__init__( self, (note_title != "home") and note_title or None, # use the default title for the "home" page Link(rel=u"stylesheet", type=u"text/css", href=u"/static/css/header.css?%s" % VERSION), Link(rel=u"stylesheet", type=u"text/css", href=u"/static/css/product.css?%s" % VERSION), Meta( name=u"description", content= u"Luminotes is a WYSIWYG personal wiki notebook for organizing your notes and ideas." ), Meta( name=u"keywords", content= u"note taking, personal wiki, wysiwyg wiki, easy wiki, simple wiki, wiki notebook" ), Header(user, first_notebook, login_url, logout_url, note_title), Span(*nodes), Div( Div( Div( Div( Ul( Li(u"About", class_=u"footer_category"), Li(A(u"tour", href=u"/tour")), Li(A(u"demo", href=u"/users/demo")), Li(A(u"faq", href=u"/faq")), Li(A(u"team", href=u"/meet_the_team")), Li(A(u"user guide", href=u"/guide")), Li(A(u"privacy", href=u"/privacy")), class_=u"footer_list", ), Ul( Li(u"Get Started", class_=u"footer_category"), Li(A(u"download", href=u"/download")), Li(A(u"sign up", href=u"/pricing")), Li(A(u"source code", href=u"/source_code")), class_=u"footer_list", ), Ul( Li(u"Community", class_=u"footer_category"), Li(A(u"contact support", href=u"/contact_info")), Li(A(u"discussion forums", href=u"/forums/")), Li(A(u"blog", href=u"/blog/")), Li( A(u"Facebook group", href= u"http://www.facebook.com/pages/Luminotes-personal-wiki-notebook/17143857741" )), Li( A(u"Twitter stream", href=u"http://twitter.com/Luminotes")), class_=u"footer_list", ), Ul( Li(u"Copyright ©2008 Luminotes"), class_=u"footer_list wide_footer_list", ), Br(), class_=u"footer_column", ), class_=u"footer_links", ), class_=u"wide_center_area", ), class_=u"footer", ), )
def __init__(self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups): Product_page.__init__( self, user, first_notebook, login_url, logout_url, u"home", # note title Div( Div( Div( A( Img(src=u"/static/images/screenshot_small.png", width=u"400", height=u"308"), href=u"/tour", ), class_=u"front_screenshot", ), Div( Div( Img( src=u"/static/images/hook.png", width=u"400", height=u"51", alt=u"Collect your thoughts.", ), ), P( Img( src=u"/static/images/sub_hook.png", width=u"307", height=u"54", alt= u"Get organized with your own Luminotes personal wiki notebook.", ), ), Table( Td( Li(u"Gather all of your ideas into one place." ), Li(u"Easily link together related concepts."), Li(u"As simple to use as index cards."), align=u"left", ), align=u"center", ), P( A(u"Take a tour", href=u"/tour", class_=u"hook_action"), u", ", A(u"Download", href=u"/download", class_=u"hook_action"), u", ", Span(u" or ", class_=u"hook_action_or"), A(u"Sign up", href=u"/pricing", class_=u"hook_action"), class_=u"hook_action_area", separator=u"", ), class_=u"explanation", ), class_=u"wide_center_area", ), class_=u"hook_area", ), Div( Div( Div( Img( src=u"/static/images/quotes.png", class_=u"heading", width=u"253", height=u"31", alt=u"What people are saying", ), ), Div( Div( u'"', Span( u"Luminotes is a wiki without the markup learning curve.", class_=u"quote_title", separator=u"", ), u""" ... Luminotes has you simply start typing, using familiar rich text buttons to add bullets and other styling, and a simple linking and tagging system for your notes." """, class_=u"quote_text", separator=u"", ), Div(u"-Kevin Purdy, ", A(u"Review on Lifehacker", href= u"http://lifehacker.com/386813/luminotes-is-a-wiki-without-the-markup-learning-curve" ), class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"Imagine an application that combines the features of a wiki and a web-based notebook.", class_=u"quote_title", separator=u"", ), u""" ... as a multi-user notebook that allows you to quickly take notes and collaborate on them with other users, Luminotes is unbeatable." """, class_=u"quote_text", separator=u"", ), Div(u"-Dmitri Popov, ", A(u"Review on Linux.com", href=u"http://www.linux.com/feature/132297"), class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"As soon as I saw Luminotes I knew it was what I and my students needed.", class_=u"quote_title", separator=u"", ), u""" Clear, easy to use and beautifully simple." """, class_=u"quote_text", separator=u"", ), Div(u"-Jonathan Lecun, Director, ", A(u"UK Teachers Online", href=u"http://www.ukteachersonline.co.uk/"), class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"Luminotes has saved me an immense amount of time with my current novel.", class_=u"quote_title", ), u""" No more digging through mounds of text or trying to make sense of notes scrawled on random pages of my notebook months ago." """, class_=u"quote_text", separator=u"", ), Div( u"Michail Velichansky, Writer", class_=u"quote_signature", ), class_=u"quote", ), Div( Div( u'"', Span( u"What I love most about Luminotes is the ", I(u"simplicity"), u" of it.", class_=u"quote_title", separator=u"", ), u""" Maybe I have a touch of ADD, but I get so distracted with other products and all the gadgets, bells, and whistles they offer. I spend more time fiddling with the features than actually working. Luminotes, for me, recreates the old index card method we all used for term papers in high school." """, class_=u"quote_text", separator=u"", ), Div(u"-Michael Miller, President & CEO, Mighty Hero Entertainment, Inc.", class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"I'm a wiki addict, so I've tried most of them, desktop and web-based.", class_=u"quote_title", separator=u"", ), u""" What I like about your excellent product is the modeless editing (no edit and save buttons). This makes Luminotes the fastest web-based wiki I have used." """, class_=u"quote_text", separator=u"", ), Div(u"-Scott Tiner, Technical Writer", class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"I came across your software using the WikiMatrix comparison and fell in love instantly.", class_=u"quote_title", separator=u"", ), u""" This is probably the best personal wiki software I have seen to date. Playing with the demo sold me completely. The design, interface, usage, and above all how bloody easy it is is perfect." """, class_=u"quote_text", separator=u"", ), Div(u"-Kyle Gruel", class_=u"quote_signature"), class_=u"quote", ), Div( Div( u'"', Span( u"Marvelous! Simply marvelous!", class_=u"quote_title", ), u""" Very simple to use, and I can access it from any computer. Great idea!" """, class_=u"quote_text", separator=u"", ), Div( u"-Lydia Newkirk", class_=u"quote_signature", ), class_=u"quote", ), Div( Div( u'"', Span( u"I just wanted to thank you for the great work with Luminotes!", class_=u"quote_title", ), u""" I use it both at home and at work, and it's a big help!" """, class_=u"quote_text", separator=u"", ), Div( u"-Brian M.B. Keaney", class_=u"quote_signature", ), class_=u"quote", ), class_=u"quotes_area", ), Div( Img( src=u"/static/images/what_is_luminotes.png", class_=u"heading", width=u"214", height=u"29", alt=u"What is Luminotes?", ), Div( P( u""" Luminotes is a WYSIWYG personal wiki notebook for organizing your notes and ideas. It's designed for note taking and note keeping without the hassle of learning special markup codes. You simply start typing. """, ), Table( Tr( Td( A( Img(src= u"/static/images/wysiwyg_thumb.png", width=u"175", height="100", class_=u"thumbnail"), href=u"/tour", ), Div(u"Create a wiki visually", class_=u"thumbnail_caption"), Div(u"Make a wiki as easily as writing a document.", class_=u"thumbnail_caption_detail"), class_=u"thumbnail_cell", ), Td( A( Img(src= u"/static/images/connect_thumb.png", width=u"175", height="100", class_=u"thumbnail"), href=u"/tour", ), Div(u"Link your notes together", class_=u"thumbnail_caption"), Div(u"Connect your thoughts with links between notes.", class_=u"thumbnail_caption_detail"), class_=u"thumbnail_cell", ), ), Tr( Td( A( Img(src= u"/static/images/download_thumb.png", width=u"175", height="100", class_=u"thumbnail"), href=u"/tour", ), Div(u"Take your wiki to go", class_=u"thumbnail_caption"), Div(u"Download your wiki as a web page or spreadsheet.", class_=u"thumbnail_caption_detail"), class_=u"thumbnail_cell", ), Td( A( Img(src= u"/static/images/share_thumb.png", width=u"175", height="100", class_=u"thumbnail"), href=u"/tour", ), Div(u"Share your thoughts", class_=u"thumbnail_caption"), Div(u"Invite friends and colleagues to collaborate.", class_=u"thumbnail_caption_detail"), class_=u"thumbnail_cell", ), ), class_=u"thumbnail_area", ), P(u"What can you do with Luminotes?", ), Ul( Li(u"Outline a story"), Li(u"Plan a trip"), Li(u"Collect recipes"), Li(u"Record your ideas"), Li(u"Keep track of your tasks"), Li(u"Take notes"), class_=u"compact_list", ), P( u""" Luminotes is open source / free software and licensed under the terms of the GNU GPL. """, ), class_=u"what_is_luminotes_text", ), Div( P( Span(u"Sound interesting?", class_=u"hook_action_question"), Br(), A(u"Take a tour", href=u"/tour", class_=u"hook_action"), u", ", A(u"Download", href=u"/download", class_=u"hook_action"), u", ", Span(u" or ", class_=u"hook_action_or"), A(u"Sign up", href=u"/pricing", class_=u"hook_action"), class_=u"hook_action_area", separator=u"", ), ), class_=u"what_is_luminotes_area", ), class_=u"wide_center_area", ), P( Span(id=u"buttons_preload"), Span(id=u"themes_default_buttons_preload"), ), )
def __init__( self, notebook, hide_toolbar = False, note_word = None ): Div.__init__( self, Div( P( Div( Input( type = u"button", id = u"newNote", title = u"make a new %s [ctrl-M]" % ( note_word or u"note" ), class_ = "image_button newNote_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"createLink", title = u"link [ctrl-L]", class_ = "image_button createLink_large", ), class_ = u"button_background" ), # Notebook.READ_WRITE_FOR_OWN_NOTES should not have a file upload button ( notebook.read_write == Notebook.READ_WRITE ) and Div( Input( type = u"button", id = u"attachFile", title = u"attach file or image", class_ = "image_button attachFile_large", ), class_ = u"button_background" ) or None, ), P( Div( Input( type = u"button", id = u"bold", title = u"bold [ctrl-B]", class_ = "image_button bold_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"italic", title = u"italic [ctrl-I]", class_ = "image_button italic_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"underline", title = u"underline [ctrl-U]", class_ = "image_button underline_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"strikethrough", title = u"strikethrough [ctrl-S]", class_ = "image_button strikethrough_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"color", title = u"text color", class_ = "image_button color_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"font", title = u"font", class_ = "image_button font_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"title", title = u"title", class_ = "image_button title_large", ), class_ = u"button_background" ), ), P( Div( Input( type = u"button", id = u"insertUnorderedList", title = u"bullet list [ctrl-period]", class_ = "image_button insertUnorderedList_large", ), class_ = u"button_background" ), Div( Input( type = u"button", id = u"insertOrderedList", title = u"numbered list [ctrl-1]", class_ = "image_button insertOrderedList_large", ), class_ = u"button_background" ), ), class_ = u"button_wrapper", ), id = u"toolbar", class_ = hide_toolbar and u"undisplayed" or None, )
def __init__( self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups, download_products, upgrade = False ): MEGABYTE = 1024 * 1024 # for now, just assume there's a single download package news_url = u"http://luminotes.com/hg/luminotes/file/%s/NEWS" % VERSION Product_page.__init__( self, user, first_notebook, login_url, logout_url, u"download", # note title Script( type = u"text/javascript", src = u"/static/js/MochiKit.js?%s" % VERSION ), Div( Div( H1( Img( src = u"/static/images/download.png", width = u"181", height = u"41", alt = u"download", ), ), P( u"Install Luminotes on your computer.", class_ = u"upgrade_subtitle", ), Div( upgrade and Div( P( B( "Upgrading:" ), u""" If you already have Luminotes Desktop and would like to upgrade to a newer version, simply download and install it. All of your notes will be preserved. """, A( "Check out what's new in version %s" % VERSION, href = news_url ), ), P( u"Need help? Please", A( u"contact support", href = u"/contact_info" ), u"for assistance.", ), class_ = u"upgrade_text", ) or None, Div( Img( src = u"/static/images/installer_screenshot.png", width = u"350", height = u"273" ), class_ = u"desktop_screenshot", ), P( Table( Tr( Th( Span( u"Luminotes Desktop", class_ = u"plan_name" ), Div( A( "version", VERSION, href = news_url ), class_ = u"version_text", ), class_ = u"plan_name_area download_plan_width", colspan = "2", ), ), Tr( Td( colspan = "2" ), class_ = u"spacer_row" ), Tr( Td( Span( u"Solo", class_ = u"highlight" ), u"note taking", title = u"Luminotes Desktop is designed for individuals.", class_ = u"feature_value", colspan = "2", ), ), Tr( Td( u"Runs on your", Span( u"own computer", class_ = u"highlight" ), title = u"All of your notes are stored privately on your own computer or on a USB drive.", class_ = u"feature_value", colspan = "2", ), ), Tr( Td( Span( u"Unlimited", class_ = u"highlight" ), u"storage", title = u"Add as many notes, documents, and files as you want.", class_ = u"feature_value", colspan = "2", ), ), Tr( Td( u"Works", Span( "offline", class_ = u"highlight" ), title = u"Take notes in meetings, in class, or while on the go. Runs in a web browser, but doesn't need an internet connection.", class_ = u"feature_value", colspan = "2", ), ), Tr( Td( colspan = "2" ), class_ = u"spacer_row" ), Tr( Td( u"Windows XP/Vista,", A( u"Linux source", href = u"/source_code" ), class_ = u"small_text", colspan = "2", ), ), Tr( Td( u"Firefox 2+, Internet Explorer 7+, Chrome 1+, Safari 3+", class_ = u"small_text", colspan = "2", ), ), Tr( Td( colspan = "2" ), class_ = u"spacer_row" ), Tr( Td( Div( A( Img( src = u"/static/images/trial_button.png", width = u"107", height = u"26", alt = u"download trial", ), href = "/static/luminotes.exe", ), class_ = u"trial_button_area", ), colspan = "1", ) or None, ), Tr( Td( colspan = "2" ), class_ = u"spacer_row" ), border = u"1", id = u"upgrade_table", ), class_ = u"upgrade_table_area", ), class_ = u"wide_center_area", ), Div( u"Don't want to install anything? Need collaboration features? ", A( u"Use Luminotes online", href = u"/pricing" ), u".", class_ = u"small_text luminotes_online_link_area", separator = u"", ), class_ = u"upgrade_area", ), Div( Div( H4( u"Is my wiki private?", class_ = u"upgrade_question" ), P( u""" Absolutely. With Luminotes Desktop, your notes are stored locally on your own computer, not on the web. There is also a complete """, A( u"Luminotes privacy policy", href = "/privacy" ), u""" so please check that out if you're interested in how Luminotes protects your privacy. """, class_ = u"upgrade_text", ), H4( u"Can I run Luminotes Desktop from a USB flash drive?", class_ = u"upgrade_question" ), P( """ Yes! You can keep your wiki in your pocket by running Luminotes Desktop directly from a USB flash drive. Full instructions are included with the download. """, class_ = u"upgrade_text", ), H4( u"What happens to my wiki if I stop using Luminotes?", class_ = u"upgrade_question" ), P( """ There is no lock-in with Luminotes. You can export your entire wiki to a stand-alone web page or a CSV spreadsheet — anytime you like. """, class_ = u"upgrade_text", ), class_= u"wide_center_area", ), P( Table( Tr( Th( Span( u"Luminotes Desktop", class_ = u"plan_name" ), class_ = u"plan_name_area", colspan = "2", ) ), Tr( Td( Div( A( Img( src = u"/static/images/trial_button.png", width = u"107", height = u"26", alt = u"download trial", ), href = "/static/luminotes.exe", ), class_ = u"trial_button_area", ), colspan = "1", ), ), id = u"upgrade_table_small", ), class_= u"upgrade_table_area", ), Div( P( Span( u"Have a question?", class_ = u"hook_action_question" ), Br(), A( u"Contact support", href = u"/contact_info", class_ = u"hook_action" ), class_ = u"hook_action_area", separator = u"", ), class_ = u"center_area", ), class_ = u"wide_center_area", ), ), )
def __init__(self, toolbar, notebooks, notebook, parent_id, notebook_path, updates_path, user, rate_plan): linked_notebooks = [ nb for nb in notebooks if (nb.read_write == Notebook.READ_WRITE or (nb.read_write == Notebook.READ_ONLY and not nb.name.startswith(u"Luminotes"))) and nb.name not in (u"trash") and nb.deleted is False ] if [tag for tag in notebook.tags if tag.name == u"forum"]: forum_tag = True forum_name = tag.value notebook_word = u"discussion" note_word = u"post" else: forum_tag = False forum_name = None notebook_word = u"notebook" note_word = u"note" Div.__init__( self, toolbar, (user.username == u"anonymous") and self.forum_link(forum_tag, forum_name) or None, (user.username != u"anonymous") and Div( (notebook_path != u"/") and Div( H4( u"this %s" % notebook_word, id=u"this_notebook_area_title", ), self.forum_link(forum_tag, forum_name), (rate_plan.get(u"notebook_sharing") and notebook.name == u"Luminotes blog") and Div( A( u"follow", href=u"%s?rss" % notebook_path, id=u"blog_rss_link", title= u"Subscribe to the RSS feed for the Luminotes blog.", ), A( Img(src=u"/static/images/rss.png", width=u"14", height=u"14", class_=u"middle_image padding_left"), href=u"%s?rss" % notebook_path, title= u"Subscribe to the RSS feed for the Luminotes blog.", ), class_=u"link_area_item", ) or (updates_path and rate_plan.get(u"notebook_sharing") and (not forum_tag) and Div( A( u"follow", href=updates_path, id=u"notebook_rss_link", title=u"Subscribe to the RSS feed for this %s." % notebook_word, ), A( Img(src=u"/static/images/rss.png", width=u"14", height=u"14", class_=u"middle_image padding_left"), href=updates_path, title=u"Subscribe to the RSS feed for this %s." % notebook_word, ), class_=u"link_area_item", ) or None), (notebook.read_write != Notebook.READ_ONLY) and Div( A( u"nothing but %ss" % note_word, href=u"#", id=u"declutter_link", title= u"Focus on just your %ss without any distractions." % note_word, ), class_=u"link_area_item", ) or None, (notebook.read_write != Notebook.READ_WRITE and notebook.name != u"Luminotes") and Div( A( u"export", href=u"#", id=u"export_link", title= u"Download a stand-alone copy of the entire %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.read_write != Notebook.READ_WRITE) and Div( A( u"print", href=u"/notebooks/export?notebook_id=%s&format=print" % notebook.object_id, id=u"print_notebook_link", target=u"_new", title=u"Print this %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.read_write == Notebook.READ_WRITE) and Span( Div( (notebook.name != u"trash") and A( u"import", href=u"#", id=u"import_link", title= u"Import %ss from other software into Luminotes." % note_word, ) or None, (notebook.name != u"trash") and u"|" or None, A( u"export", href=u"#", id=u"export_link", title= u"Download a stand-alone copy of the entire %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.name != u"trash") and Div( notebook.trash_id and A( u"trash", href=u"/notebooks/%s?parent_id=%s" % (notebook.trash_id, notebook.object_id), id=u"trash_link", title=u"Look here for %ss you've deleted." % note_word, ) or None, (notebook.owner and notebook.name != u"trash" and notebook.trash_id) and u"|" or None, (notebook.owner and notebook.name != u"trash") and A( u"delete", href=u"#", id=u"delete_notebook_link", title=u"Move this %s to the trash." % notebook_word, ) or None, class_=u"link_area_item", ) or None, (notebook.owner and notebook.name != u"trash") and Div( A( u"rename", href=u"#", id=u"rename_notebook_link", title=u"Change the name of this %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.owner and notebook.name != u"trash" and user.username and rate_plan.get(u"notebook_sharing")) and Div( A( u"share", href=u"#", id=u"share_notebook_link", title=u"Share this %s with others." % notebook_word, ), class_=u"link_area_item", ) or None, Div( A( u"print", href= u"/notebooks/export?notebook_id=%s&format=print" % notebook.object_id, id=u"print_notebook_link", target=u"_new", title=u"Print this %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.name == u"trash") and Rounded_div( u"trash_notebook", A( u"trash", href=u"#", id=u"trash_link", title=u"Look here for %ss you've deleted." % note_word, ), class_=u"link_area_item", ) or None, ) or None, id=u"this_notebook_area", ) or None, (not forum_tag) and Div((len(linked_notebooks) > 0) and H4( u"notebooks", id=u"notebooks_area_title", ) or None, [ (nb.object_id == notebook.object_id) and Rounded_div( u"current_notebook", A( nb.name, href=u"/notebooks/%s" % nb.object_id, id=u"notebook_%s" % nb.object_id, ), (len(linked_notebooks) > 1) and Span( Img(src=u"/static/images/up_arrow.png", width=u"20", height=u"17", id=u"current_notebook_up"), Img(src=u"/static/images/down_arrow.png", width=u"20", height=u"17", id=u"current_notebook_down"), Span(id="current_notebook_up_hover_preload"), Span(id="current_notebook_down_hover_preload"), ) or None, class_=u"link_area_item", ) or Div( A( nb.name, href=u"/notebooks/%s" % nb.object_id, id=u"notebook_%s" % nb.object_id, ), class_=u"link_area_item", ) for nb in linked_notebooks ], id=u"notebooks_area") or None, (not forum_tag) and Div( Input( type=u"button", class_=u"note_button", id=u"new_notebook_button", value=u"+ notebook", title=u"Create a new wiki notebook.", ), class_=u"link_area_item", ) or None, Div(id=u"storage_usage_area", ), id=u"link_area_holder", ) or None, id=u"link_area", )
def __init__(self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups, rate_plans, unsubscribe_button): MEGABYTE = 1024 * 1024 rate_plans = list(rate_plans)[0:1] # only the free rate plan is shown Product_page.__init__( self, user, first_notebook, login_url, logout_url, u"pricing", # note title Script(type=u"text/javascript", src=u"/static/js/MochiKit.js?%s" % VERSION), Div( Div( user and user.username not in (None, u"anonymous") and H1( Img( src=u"/static/images/upgrade.png", width=u"152", height=u"51", alt=u"upgrade", ), ) or H1( Img( src=u"/static/images/sign_up.png", width=u"138", height=u"51", alt=u"sign up", ), ), P( Table( self.fee_row(rate_plans, user), self.spacer_row(rate_plans), Tr([ Td( (plan[u"included_users"] == 1) and Span( Span(u"Single", class_=u"highlight"), u"user", title= u"This plan includes one user account, so it's ideal for individuals." ) or Span( u"Up to", Span("%s" % plan[u"included_users"], class_=u"highlight"), u"users", title= "This plan includes multiple accounts, including an admin area where you can create and manage users for your organization." ), class_=u"feature_value" + (index == self.FOCUSED_PLAN and u" focused_feature_value" or u""), ) for (index, plan) in enumerate(rate_plans) ], ), Tr([ Td( plan[u"storage_quota_bytes"] and Span("%s MB" % (plan[u"storage_quota_bytes"] // MEGABYTE), class_=u"highlight") or Span(u"unlimited", class_=u"highlight"), u"storage", title= u"Storage space for your notes, documents, and files.", class_=u"feature_value" + (index == self.FOCUSED_PLAN and u" focused_feature_value" or u""), ) for (index, plan) in enumerate(rate_plans) ], ), plan[u"notebook_sharing"] and Tr([ Td( plan[u"notebook_collaboration"] and Span( u"Invite", Span(u"editors", class_=u"highlight"), title= u"Invite people to collaborate on your wiki. Share only the notebooks you want. Keep the others private." ) or Span( u"Invite", Span(u"viewers", class_=u"highlight"), title= u"Invite people to view your wiki. Share only the notebooks you want. Keep the others private." ), class_=u"feature_value" + (index == self.FOCUSED_PLAN and u" focused_feature_value" or u""), ) for (index, plan) in enumerate(rate_plans) ], ) or None, self.button_row(rate_plans, user), self.spacer_row(rate_plans, bottom=True), border=u"1", id=u"upgrade_table", ), class_=u"upgrade_table_area", ), Div( u"Don't want to take notes online? ", A(u"Download Luminotes Desktop", href=u"/download"), u".", class_=u"small_text", separator=u"", ), class_=u"upgrade_area", ), Div( Div( H4(u"Do you have a desktop version I can download?", class_=u"upgrade_question"), P( u""" Yes! If you want to download Luminotes and take notes locally instead of on the web, check out """, A(u"Luminotes Desktop", href="/download"), ".", separator=u"", class_=u"upgrade_text", ), H4(u"Is my wiki private?", class_=u"upgrade_question"), P( u""" Absolutely. Your personal wiki is protected by industry-standard SSL encryption, and your wiki is never shared with anyone unless you explicitly invite them to view or edit it. There is a complete """, A(u"Luminotes privacy policy", href="/privacy"), u""" on the subject, so please check that out if you're interested in how Luminotes protects your privacy. """, class_=u"upgrade_text", ), H4(u"Do you backup my wiki?", class_=u"upgrade_question"), P( """ Your wiki is fully backed up every day, and you can even download the entire contents of your wiki as a stand-alone web page or a CSV spreadsheet — anytime you like. """, class_=u"upgrade_text", ), H4(u"What happens to my wiki if I stop using Luminotes?", class_=u"upgrade_question"), P( """ There is no lock-in with Luminotes. You can export your entire wiki to a stand-alone web page or a CSV spreadsheet — anytime you like. """, class_=u"upgrade_text", ), class_=u"wide_center_area", ), Div( P( Span(u"Have a question before you sign up?", class_=u"hook_action_question"), Br(), A(u"Contact support", href=u"/contact_info", class_=u"hook_action"), class_=u"hook_action_area", separator=u"", ), class_=u"center_area", ), class_=u"wide_center_area", ), ), )
def __init__( self, user, rate_plan, notebooks, notebook, parent_id=None, login_url=None, logout_url=None, startup_notes=None, total_notes_count=None, notes=None, note_read_write=True, start=None, count=None, http_url=None, conversion=None, rename=False, deleted_id=None, invites=None, invite_id=None, after_login=None, signup_plan=None, signup_yearly=None, recent_notes=None, groups=None, ): startup_note_ids = [ startup_note.object_id for startup_note in startup_notes ] def note_controls(note, read_write): read_write_access = ( read_write == Notebook.READ_WRITE ) or \ ( read_write == Notebook.READ_WRITE_FOR_OWN_NOTES and note.user_id == user.object_id ) return Div( read_write_access and Input( type = "button", class_ = "note_button", id = "delete_note_%s" % note.object_id, value = "delete" + ( note.deleted_from_id and " forever" or "" ), title = "delete note [ctrl-d]" ) or None, read_write_access and note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "undelete_note_%s" % note.object_id, value = "undelete", title = "undelete note" ) or None, ( read_write == Notebook.READ_WRITE ) and not note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "changes_note_%s" % note.object_id, value = "changes", title = "previous revisions", ) or None, ( read_write == Notebook.READ_WRITE ) and not note.deleted_from_id and Input( type = "button", class_ = "note_button", id = "tools_note_%s" % note.object_id, value = "tools", title = "note tools", ) or None, ( read_write != Notebook.READ_ONLY or not note.startup ) and not note.deleted_from_id and \ ( read_write != Notebook.READ_WRITE_FOR_OWN_NOTES ) and Input( type = "button", class_ = "note_button", id = "hide_note_%s" % note.object_id, value = "hide", title = "hide note [ctrl-h]", ) or None, id = u"note_controls_%s" % note.object_id, class_ = u"note_controls", ) def static_note_divs(notes, read_write): return [ Table( Tr(Td(note_controls(note, read_write), )), Tr( Td( Div( Span( note.contents, class_=u"static_note_contents", separator="", ), id="static_note_%s" % note.object_id, class_=u"static_note_div", ), width="100%", ), Td( u".....", id=u"note_grabber_%s" % note.object_id, class_=u"note_grabber" + (read_write != Notebook.READ_WRITE and " invisible" or ""), ), ), Tr( Td( Div(class_="note_shadow_corner"), id=u"note_shadow_%s" % note.object_id, class_=u"note_shadow undisplayed", ), ), id=u"note_holder_%s" % note.object_id, class_=u"note_holder", ) for note in notes ] static_notes = notes and static_note_divs( notes, note_read_write and notebook.read_write or Notebook.READ_ONLY ) or \ static_note_divs( startup_notes, notebook.read_write ) # Since the contents of these notes are included in the static_notes section below, don't # include them again in the hidden fields here. Accomplish this by making custom dicts for # sending to the client. startup_note_dicts = [{ u"object_id": startup_note.object_id, u"revision": startup_note.revision, u"deleted_from_id": startup_note.deleted_from_id, u"user_id": startup_note.user_id, u"username": startup_note.username, } for startup_note in startup_notes] note_dicts = [{ u"object_id": note.object_id, u"revision": note.revision, u"deleted_from_id": note.deleted_from_id, u"user_id": note.user_id, u"username": note.username, u"creation": note.creation, } for note in notes] root_notes = startup_notes + (notes and [ note for note in notes if note.object_id not in startup_note_ids ] or []) def json(string): return escape(unicode(Json(string)), quote=True) if len(notes) == 1: title = notes[0].title else: title = notebook.name if rate_plan.get(u"notebook_sharing"): updates_path = u"/notebooks/updates/%s?rss&%s" % ( notebook.object_id, urlencode([(u"notebook_name", notebook.name.encode("utf8"))]), ) else: updates_path = None forum_tags = [tag for tag in notebook.tags if tag.name == u"forum"] forum_tag = None if notebook.name == u"Luminotes": notebook_path = u"/" updates_path = None # no RSS feed for the main notebook elif notebook.name == u"Luminotes user guide": notebook_path = u"/guide" elif forum_tags: forum_tag = forum_tags[0] if forum_tag.value == u"blog": notebook_path = u"/blog/%s" % notebook.friendly_id else: notebook_path = u"/forums/%s/%s" % (forum_tag.value, notebook.object_id) else: notebook_path = u"/notebooks/%s" % notebook.object_id conversion_js = None if conversion: try: conversion_js = file(u"static/js/%s_conversion.js" % conversion).read() except IOError: pass if notebook.read_write == Notebook.READ_WRITE: 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 privacy policy": "privacy", }.get(header_note_title, header_note_title) own_notebooks = [ nb for nb in notebooks if nb.read_write == Notebook.READ_WRITE ] header_notebook = own_notebooks and own_notebooks[0] or notebook Page.__init__( self, title, Link( rel = u"stylesheet", type = u"text/css", href = u"/static/css/header.css?%s" % VERSION ), updates_path and \ Link( rel = u"alternate", type = u"application/rss+xml", title = notebook.name, href = updates_path ) or None, Script( type = u"text/javascript", src = u"/static/js/MochiKit.js?%s" % VERSION ) or None, Script( type = u"text/javascript", src = u"/static/js/Invoker.js?%s" % VERSION ) or None, Script( type = u"text/javascript", src = u"/static/js/Editor.js?%s" % VERSION ) or None, Script( type = u"text/javascript", src = u"/static/js/Wiki.js?%s" % VERSION ) or None, Input( type = u"hidden", name = u"user", id = u"user", value = json( user ) ), Input( type = u"hidden", name = u"rate_plan", id = u"rate_plan", value = json( rate_plan ) ), Input( type = u"hidden", name = u"yearly", id = u"yearly", value = json( signup_yearly ) ), Input( type = u"hidden", name = u"notebooks", id = u"notebooks", value = json( notebooks ) ), Input( type = u"hidden", name = u"notebook", id = u"notebook", value = json( notebook ) ), Input( type = u"hidden", name = u"parent_id", id = u"parent_id", value = parent_id or "" ), Input( type = u"hidden", name = u"startup_notes", id = u"startup_notes", value = json( startup_note_dicts ) ), Input( type = u"hidden", name = u"current_notes", id = u"current_notes", value = json( note_dicts ) ), Input( type = u"hidden", name = u"note_read_write", id = u"note_read_write", value = json( note_read_write ) ), Input( type = u"hidden", name = u"rename", id = u"rename", value = json( rename ) ), Input( type = u"hidden", name = u"deleted_id", id = u"deleted_id", value = deleted_id ), Input( type = u"hidden", name = u"invites", id = u"invites", value = json( invites ) ), Input( type = u"hidden", name = u"invite_id", id = u"invite_id", value = invite_id ), Input( type = u"hidden", name = u"after_login", id = u"after_login", value = after_login ), Input( type = u"hidden", name = u"signup_plan", id = u"signup_plan", value = signup_plan ), Input( type = u"hidden", name = u"groups", id = u"groups", value = json( groups ) ), Div( id = u"status_area", ), Header( user, header_notebook, login_url, logout_url, header_note_title, rate_plan ), Div( Div( Link_area( Toolbar( notebook, hide_toolbar = parent_id or notebook.read_write == Notebook.READ_ONLY, note_word = forum_tag and u"post" or u"note", ), notebooks, notebook, parent_id, notebook_path, updates_path, user, rate_plan, ), id = u"left_area", ), Div( ( notebook.read_write != Notebook.READ_ONLY ) and Noscript( P( Strong( u""" Luminotes requires JavaScript to be enabled in your web browser in order to edit your wiki. Please <a href="/enable_javascript">enable JavaScript</a> before continuing. """ ) ), ) or None, Rounded_div( ( notebook.name == u"trash" ) and u"trash_notebook" or u"current_notebook", parent_id and Span( A( u"empty", href = u"/notebooks/%s" % notebook.object_id, id = u"empty_trash_link" ), u" | ", A( u"go back", href = u"/notebooks/%s" % parent_id ), id = u"notebook_header_links", ) or None, ( notebook.name == u"Luminotes" and title == u"source code" ) and \ Strong( "%s %s" % ( notebook.name, VERSION ) ) or \ Span( ( notebook.name == u"trash" or notebook.read_write != Notebook.READ_WRITE ) \ and Strong( notebook.name ) \ or Span( Strong( notebook.name ), id = u"notebook_header_name", title = "Rename this notebook." ), ), id = u"notebook_header_area", corners = ( u"tl", u"tr", u"br" ), ), Div( Rounded_div( ( notebook.name == u"trash" ) and u"trash_notebook_inner" or u"current_notebook_inner", Div( id = u"deleted_notebooks", ), Page_navigation( notebook_path, len( notes ), total_notes_count, start, count, ), Div( Span( id = u"notes_top" ), static_notes, id = u"notes", ), ( notebook.read_write == Notebook.READ_WRITE ) and Div( id = u"blank_note_stub", class_ = u"blank_note_stub_hidden_border", ) or None, ( forum_tag and user.username and user.username != u"anonymous" ) and \ Span( ( forum_tag.value == "blog" ) and P( u"To write a comment, click that large \"+\" button to the left. To publish your comment, click the save button.", class_ = u"small_text" ) or P( u"To write a comment, click that large \"+\" button to the left. To publish your comment, click the save button. Or, ", A( u"start a new discussion", href = u"/forums/%s/create_thread" % forum_tag.value ), u".", separator = "", class_ = u"small_text" ), ) or None, ( forum_tag and ( not user.username or user.username == u"anonymous" ) ) and \ P( u"To write a comment, please login first. No account?", A( u"Sign up", href = u"/pricing" ), u"to get a free account.", class_ = "small_text" ) or None, Page_navigation( notebook_path, len( notes ), total_notes_count, start, count, return_text = u"return to the discussion", ), Div( id = u"iframe_area", ), id = u"notebook_background", corners = ( u"tl", ), ), id = u"notebook_border", class_ = ( notebook.name == u"trash" ) and u"trash_notebook_color" or u"current_notebook_color", ), id = u"center_content_area", ), Div( Note_tree_area( notebook, root_notes, recent_notes, total_notes_count, user, ), id = u"right_area", ), id = u"everything_area", ), Span( id = "grabber_hover_preload" ), )
def __init__( self, user, notebooks, first_notebook, login_url, logout_url, rate_plan, groups ): Product_page.__init__( self, user, first_notebook, login_url, logout_url, u"tour", # note title Div( H1( Img( src = u"/static/images/tour.png", width = u"277", height = u"47", alt = u"Luminotes tour", ), ), Div( Img( src = u"/static/images/tour_card1.png", width = u"400", height = u"243", class_ = u"tour_card" ), P( u"Using index cards to take notes is really easy. You just write a title at the top and then jot down some notes.", class_ = u"tour_text", ), ), Div( Img( src = u"/static/images/tour_card2.png", width = u"400", height = u"243", class_ = u"tour_card" ), P( u"And if you make one index card per subject, you can keep your notes organized.", class_ = u"tour_text", ), P( u""" But when your stack of cards grows larger than a few dozen, it becomes difficult to find the notes you're looking for. """, class_ = u"tour_text", ), ), Div( Img( src = u"/static/images/tour_card3.png", width = u"430", height = u"366", class_ = u"tour_card" ), P( u""" If only there was something as simple for taking notes as index cards, but fast, searchable, and with some way to make links between your notes! """, class_ = u"tour_text", ), P( u"Introducing Luminotes...", class_ = u"tour_text", ), ), Div( Img( src = u"/static/images/tour_screenshot1.png", width = u"725", height = u"560", class_ = u"tour_screenshot" ), Div( Div( Ol( Li( u"Format your wiki with this convenient toolbar" ), Li( u"Just start typing — everything is saved automatically" ), Li( u"Search through your entire wiki" ), Li( u"Make as many notebooks as you want" ), class_ = u"tour_list", ), class_ = u"tour_text", ), ), ), Div( Img( src = u"/static/images/tour_screenshot2.png", width = u"725", height = u"558", class_ = u"tour_screenshot" ), Div( Div( Ol( Li( u"Connect your thoughts with links between notes" ), Li( u"Track past revisions and make updates without worry" ), Li( u"Download your complete wiki as a web page or spreadsheet" ), Li( u"Attach files to your wiki and download them anytime" ), class_ = u"tour_list", ), class_ = u"tour_text", ), ), ), Div( Img( src = u"/static/images/tour_screenshot3.png", width = u"725", height = u"558", class_ = u"tour_screenshot" ), Div( Div( Ol( Li( u"Share your wiki with friends and colleagues" ), Li( u"Send invites simply by entering email addresses" ), Li( u"Control how much access each person gets" ), Li( u"Revoke access at any time" ), class_ = u"tour_list", ), class_ = u"tour_text", ), ), class_ = u"tour_screenshot_wrapper", ), Div( Div( u"You can use Luminotes online and collaborate with others, or download Luminotes Desktop and take notes locally on your own computer!", class_ = u"tour_text", ), ), class_ = u"tour_area" ), Div( P( Span( u"Like what you've seen so far?", class_ = u"hook_action_question" ), Br(), A( u"Try the demo", href = u"/users/demo", class_ = u"hook_action" ), u", ", A( u"Download", href = u"/download", class_ = u"hook_action" ), u", ", Span( u" or ", class_ = u"hook_action_or" ), A( u"Sign up", href = u"/pricing", class_ = u"hook_action" ), class_ = u"hook_action_area", separator = u"", ), class_ = u"center_area", ), )
def __init__(self, toolbar, notebooks, notebook, parent_id, notebook_path, updates_path, user, rate_plan): linked_notebooks = [ nb for nb in notebooks if ( nb.read_write == Notebook.READ_WRITE or (nb.read_write == Notebook.READ_ONLY and not nb.name.startswith(u"Luminotes")) ) and nb.name not in (u"trash") and nb.deleted is False ] if [tag for tag in notebook.tags if tag.name == u"forum"]: forum_tag = True forum_name = tag.value notebook_word = u"discussion" note_word = u"post" else: forum_tag = False forum_name = None notebook_word = u"notebook" note_word = u"note" Div.__init__( self, toolbar, (user.username == u"anonymous") and self.forum_link(forum_tag, forum_name) or None, (user.username != u"anonymous") and Div( (notebook_path != u"/") and Div( H4(u"this %s" % notebook_word, id=u"this_notebook_area_title"), self.forum_link(forum_tag, forum_name), (rate_plan.get(u"notebook_sharing") and notebook.name == u"Luminotes blog") and Div( A( u"follow", href=u"%s?rss" % notebook_path, id=u"blog_rss_link", title=u"Subscribe to the RSS feed for the Luminotes blog.", ), A( Img( src=u"/static/images/rss.png", width=u"14", height=u"14", class_=u"middle_image padding_left", ), href=u"%s?rss" % notebook_path, title=u"Subscribe to the RSS feed for the Luminotes blog.", ), class_=u"link_area_item", ) or ( updates_path and rate_plan.get(u"notebook_sharing") and (not forum_tag) and Div( A( u"follow", href=updates_path, id=u"notebook_rss_link", title=u"Subscribe to the RSS feed for this %s." % notebook_word, ), A( Img( src=u"/static/images/rss.png", width=u"14", height=u"14", class_=u"middle_image padding_left", ), href=updates_path, title=u"Subscribe to the RSS feed for this %s." % notebook_word, ), class_=u"link_area_item", ) or None ), (notebook.read_write != Notebook.READ_ONLY) and Div( A( u"nothing but %ss" % note_word, href=u"#", id=u"declutter_link", title=u"Focus on just your %ss without any distractions." % note_word, ), class_=u"link_area_item", ) or None, (notebook.read_write != Notebook.READ_WRITE and notebook.name != u"Luminotes") and Div( A( u"export", href=u"#", id=u"export_link", title=u"Download a stand-alone copy of the entire %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.read_write != Notebook.READ_WRITE) and Div( A( u"print", href=u"/notebooks/export?notebook_id=%s&format=print" % notebook.object_id, id=u"print_notebook_link", target=u"_new", title=u"Print this %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.read_write == Notebook.READ_WRITE) and Span( Div( (notebook.name != u"trash") and A( u"import", href=u"#", id=u"import_link", title=u"Import %ss from other software into Luminotes." % note_word, ) or None, (notebook.name != u"trash") and u"|" or None, A( u"export", href=u"#", id=u"export_link", title=u"Download a stand-alone copy of the entire %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.name != u"trash") and Div( notebook.trash_id and A( u"trash", href=u"/notebooks/%s?parent_id=%s" % (notebook.trash_id, notebook.object_id), id=u"trash_link", title=u"Look here for %ss you've deleted." % note_word, ) or None, (notebook.owner and notebook.name != u"trash" and notebook.trash_id) and u"|" or None, (notebook.owner and notebook.name != u"trash") and A( u"delete", href=u"#", id=u"delete_notebook_link", title=u"Move this %s to the trash." % notebook_word, ) or None, class_=u"link_area_item", ) or None, (notebook.owner and notebook.name != u"trash") and Div( A( u"rename", href=u"#", id=u"rename_notebook_link", title=u"Change the name of this %s." % notebook_word, ), class_=u"link_area_item", ) or None, ( notebook.owner and notebook.name != u"trash" and user.username and rate_plan.get(u"notebook_sharing") ) and Div( A( u"share", href=u"#", id=u"share_notebook_link", title=u"Share this %s with others." % notebook_word, ), class_=u"link_area_item", ) or None, Div( A( u"print", href=u"/notebooks/export?notebook_id=%s&format=print" % notebook.object_id, id=u"print_notebook_link", target=u"_new", title=u"Print this %s." % notebook_word, ), class_=u"link_area_item", ) or None, (notebook.name == u"trash") and Rounded_div( u"trash_notebook", A( u"trash", href=u"#", id=u"trash_link", title=u"Look here for %ss you've deleted." % note_word, ), class_=u"link_area_item", ) or None, ) or None, id=u"this_notebook_area", ) or None, (not forum_tag) and Div( (len(linked_notebooks) > 0) and H4(u"notebooks", id=u"notebooks_area_title") or None, [ (nb.object_id == notebook.object_id) and Rounded_div( u"current_notebook", A(nb.name, href=u"/notebooks/%s" % nb.object_id, id=u"notebook_%s" % nb.object_id), (len(linked_notebooks) > 1) and Span( Img( src=u"/static/images/up_arrow.png", width=u"20", height=u"17", id=u"current_notebook_up", ), Img( src=u"/static/images/down_arrow.png", width=u"20", height=u"17", id=u"current_notebook_down", ), Span(id="current_notebook_up_hover_preload"), Span(id="current_notebook_down_hover_preload"), ) or None, class_=u"link_area_item", ) or Div( A(nb.name, href=u"/notebooks/%s" % nb.object_id, id=u"notebook_%s" % nb.object_id), class_=u"link_area_item", ) for nb in linked_notebooks ], id=u"notebooks_area", ) or None, (not forum_tag) and Div( Input( type=u"button", class_=u"note_button", id=u"new_notebook_button", value=u"+ notebook", title=u"Create a new wiki notebook.", ), class_=u"link_area_item", ) or None, Div(id=u"storage_usage_area"), id=u"link_area_holder", ) or None, id=u"link_area", )
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", ) trial_expired = False if TRIAL: from pytz import utc from datetime import datetime, timedelta trial_age = datetime.now( tz = utc ) - first_notebook.revision if trial_age > timedelta( days = 30 ): trial_expired = True 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( ( TRIAL and u"trial" or u"" ), u"version", VERSION, u" | ", A( u"upgrade", href = u"http://luminotes.com/download", target = "_new", class_ = trial_expired and "trial_upgrade_link" or u"" ), u" | ", A( u"community", href = u"http://luminotes.com/community", target = "_new" ), u" | ", A( u"blog", href = u"http://luminotes.com/blog/", target = "_new" ), u" | ", A( u"close", href = u"/close" ), class_ = u"header_links", ), class_ = u"wide_center_area", ), id = u"header", class_ = u"header", ) return Div.__init__( self, Div( ( note_title == u"home" ) and title_image or A( title_image, href = u"/" ), ( login_url and user.username == u"anonymous" ) and Div( A( u"login", href = login_url, id = u"login_link", class_ = u"bold_link", ), class_ = u"header_user_links", ) or Div( u"logged in as %s" % ( user.username or u"a guest" ), u" | ", ( note_title != u"wiki" ) and first_notebook and Span( A( u"my wiki", href = u"/notebooks/%s" % first_notebook.object_id, ), u" | ", ) or None, user.username and note_title == u"wiki" and Span( A( u"settings", href = u"#", title = u"Update your account settings.", id = u"settings_link", ), " | ", ) or None, A( u"logout", href = logout_url, id = u"logout_link", title = u"Sign out of your account.", ), class_ = u"header_user_links", ), Div( ( note_title == u"home" ) and Span( u"home", class_ = u"bold_link" ) or A( u"home", href = u"/" ), 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, ( note_title == u"community" ) and Span( u"community", class_ = u"bold_link" ) or A( u"community", href = u"/community" ), u" | ", ( note_title == u"download" ) and Span( u"download", class_ = u"bold_link" ) or \ A( u"download", href = u"/download", title = u"Download Luminotes to run on your own computer.", class_ = u"bold_link", ), " | ", ( user.username and user.username != u"anonymous" ) and Span( A( u"upgrade", href = u"/pricing", title = u"Upgrade your Luminotes account.", class_ = u"bold_link", ), ) or Span( ( note_title == u"pricing" ) and Span( u"sign up", class_ = u"bold_link" ) or \ A( u"sign up", href = u"/pricing", title = u"Sign up for an online Luminotes account.", class_ = u"bold_link", ), ) or None, #( note_title == u"support" ) and Span( u"support", class_ = u"bold_link" ) or A( u"support", href = u"/support" ), 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"privacy" ) and Span( u"privacy", class_ = u"bold_link" ) or A( u"privacy", href = u"/privacy" ), class_ = u"header_links", ), class_ = u"wide_center_area", ), id = u"header", class_ = u"header", )