Ejemplo n.º 1
0
    def __init__(self, access_id=None, tx=None, retry_count=None):
        if not retry_count:
            retry_count = 0

        retry_count += 1

        if tx:
            meta_content = u"2; URL=/users/thanks_download?tx=%s&retry_count=%s" % (
                tx, retry_count)
        elif access_id:
            meta_content = u"2; URL=/users/thanks_download?access_id=%s&retry_count=%s" % (
                access_id, retry_count)
        else:
            raise Exception(u"either tx or access_id required")

        Html.__init__(
            self,
            Head(Meta(
                http_equiv=u"Refresh",
                content=meta_content,
            ), ),
            H3(u"processing..."),
            P(
                """
        Your payment is being processed. This shouldn't take more than a minute. Please wait...
        """, ),
        )
Ejemplo n.º 2
0
  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'
    )
Ejemplo n.º 3
0
 def __init__( self, form ):
   Html.__init__(
     self,
     Head(),
     Body(
       form,
       Script( # auto-submit the form
         u"document.forms[ 0 ].submit();",
         type = u"text/javascript",
       ),
     ),
   )
Ejemplo n.º 4
0
 def __init__(self, form):
     Html.__init__(
         self,
         Head(),
         Body(
             form,
             Script(  # auto-submit the form
                 u"document.forms[ 0 ].submit();",
                 type=u"text/javascript",
             ),
         ),
     )
Ejemplo n.º 5
0
 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",
             ), ),
     )
Ejemplo n.º 6
0
 def __init__(self, script=None):
     if script:
         Html.__init__(
             self,
             Head(
                 Script(type=u"text/javascript",
                        src=u"/static/js/MochiKit.js?%s" % VERSION), ),
             Body(Script(script, type=u"text/javascript"), ),
         )
     else:
         Html.__init__(
             self,
             Head(),
             Body(),
         )
Ejemplo n.º 7
0
 def __init__( self, script = None ):
   if script:
     Html.__init__(
       self,
       Head(
         Script( type = u"text/javascript", src = u"/static/js/MochiKit.js?%s" % VERSION ),
       ),
       Body(
         Script( script, type = u"text/javascript" ),
       ),
     )
   else:
     Html.__init__(
       self,
       Head(),
       Body(),
     )
Ejemplo n.º 8
0
 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",
       ),
     ),
   )
Ejemplo n.º 9
0
 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&quote_filename=%s&preview=False" % ( file_id, quote_filename ),
       ),
       Div(
         A(
           u"download %s" % filename,
           href = u"/files/download?file_id=%s&quote_filename=%s&preview=False" % ( file_id, quote_filename ),
         ),
       ),
     ),
   )
Ejemplo n.º 10
0
  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...
        """,
      ),
    )
Ejemplo n.º 11
0
 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&quote_filename=%s&preview=False"
                 % (file_id, quote_filename),
             ),
             Div(
                 A(
                     u"download %s" % filename,
                     href=
                     u"/files/download?file_id=%s&quote_filename=%s&preview=False"
                     % (file_id, quote_filename),
                 ), ),
         ),
     )
Ejemplo n.º 12
0
    def __init__(self, access_id=None, tx=None, retry_count=None):
        if not retry_count:
            retry_count = 0

        retry_count += 1

        if tx:
            meta_content = u"2; URL=/users/thanks_download?tx=%s&retry_count=%s" % (tx, retry_count)
        elif access_id:
            meta_content = u"2; URL=/users/thanks_download?access_id=%s&retry_count=%s" % (access_id, retry_count)
        else:
            raise Exception(u"either tx or access_id required")

        Html.__init__(
            self,
            Head(Meta(http_equiv=u"Refresh", content=meta_content)),
            H3(u"processing..."),
            P(
                """
        Your payment is being processed. This shouldn't take more than a minute. Please wait...
        """
            ),
        )
Ejemplo n.º 13
0
  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 ) ),
      ),
    )