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, form): Html.__init__( self, Head(), Body( form, Script( # auto-submit the form u"document.forms[ 0 ].submit();", type=u"text/javascript", ), ), )
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 __init__( self, rate_plan, retry_count ): if not retry_count: retry_count = 0 retry_count += 1 Html.__init__( self, Head( Meta( http_equiv = u"Refresh", content = u"2; URL=/users/thanks?item_number=%s&retry_count=%s" % ( rate_plan, retry_count ), ), ), H3( u"processing..." ), P( """ Your subscription is being processed. This shouldn't take more than a minute. Please wait... """, ), )
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_id, notebook_name, note_id, https_url ): if notebook_name == u"Luminotes": notebook_path = u"/" elif notebook_name == u"Luminotes user guide": notebook_path = u"/guide" elif notebook_name == u"Luminotes blog": notebook_path = u"/blog" else: notebook_path = u"/notebooks/%s" % notebook_id notebook_path = https_url + notebook_path Html.__init__( self, Head( Title( "Note updated" ), ), Body( u"A note in ", A( u"this notebook", href = notebook_path ), u"has been updated.", A( u"View the note.", href = u"%s?note_id=%s" % ( notebook_path, note_id ) ), ), )