Blame Scripts/Python/centos-web/cgi-bin/Apps/Unknown/page.py

4d38c4
"""The `Unknown' web application.
4d38c4
4d38c4
The Unknown web application is automatically triggered when the page
bd2a79
requested is not defined as valid in `webenv.cgi' script. The
4d38c4
Unknown web application is basically an admonition message describing
4d38c4
the `page not found' issue and where to find the correct links to
4d38c4
start all over.
5cb01a
5cb01a
"""
5cb01a
from Apps import page
5cb01a
5cb01a
app = page.Layout()
5cb01a
5cb01a
5cb01a
def page_content():
5cb01a
    """Returns page content."""
4d38c4
    output = app.tag_p('', [16,1], 'The page you tried to open was not found in this server. Try one of the links above to start over.')
5cb01a
    output = app.admonition('Warning', 'Page not found.', output)
4d38c4
    output = app.tag_div({'id':'content-unknown'}, [8,1], output, 1)
5cb01a
    return output
5cb01a
5cb01a
5cb01a
def main():
5cb01a
    """Returns final output."""
5cb01a
5cb01a
    # Define page name. This value is used as reference to determine
5cb01a
    # which application to load and what tab in the navigation bar to
5cb01a
    # focus on.
5cb01a
    app.name = 'Unknown'
5cb01a
5cb01a
    # Define page title. This value is dislayed on the browser's title
5cb01a
    # bar. Notice that we concatenated the page class default value
5cb01a
    # here.
5cb01a
    app.title += ' :: Page not found'
5cb01a
5cb01a
    # Define page header. This is the information displayed
5cb01a
    # between the page top and the page content.
5cb01a
    app.header = app.logo()
4d38c4
    app.header += app.google_ad_example()
5cb01a
    app.header += app.navibar()
5cb01a
5cb01a
    # Define page body. This is the information displayed between the
5cb01a
    # page header and page footer.
5cb01a
    app.body = page_content()
5cb01a
5cb01a
    # Define page footer. This is the information displayed between
5cb01a
    # the page bottom and the page content, the last information
5cb01a
    # displayed in the page.
5cb01a
    app.footer = app.credits()
5cb01a
5cb01a
    # Define page final layout. 
5cb01a
    html = app.page()
5cb01a
5cb01a
    return html