From 3566ff350109dd1682915d80f2f4ed6a82e41687 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Aug 29 2011 05:11:30 +0000 Subject: Update `CentOS-Web/Apps/Sponsors/page.py'. --- diff --git a/Scripts/CentOS-Web/Apps/Sponsors/page.py b/Scripts/CentOS-Web/Apps/Sponsors/page.py index ce7721d..7c0feda 100755 --- a/Scripts/CentOS-Web/Apps/Sponsors/page.py +++ b/Scripts/CentOS-Web/Apps/Sponsors/page.py @@ -1,28 +1,6 @@ -#!/usr/bin/python -# -# Apps.Home.page -- This module intantiates Apps.xhtml module to -# create the xhtml output of home web applications. -# -# Copyright (C) 2009, 2010, 2011 The CentOS Project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at -# your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- +"""Support module for page layout inside `Sponsors' web application. +""" from Apps import page app = page.Layout() @@ -46,9 +24,9 @@ def page_navibar_tabs(): attrs.append({'href': '/centos-web/?p=' + i.lower()}) if 'p' in app.qs.keys(): - focus = app.qs['p'][0] + focus = app.qs['p'][0].lower() else: - focus = names[0] + focus = names[0].lower() return app.navibar_app(names, attrs, focus) @@ -76,39 +54,38 @@ def page_content(): return app.content(output) + def main(): """Returns final output.""" - # Define application name. This value is used as reference to - # determine which application to load and what tab in the - # navigation bar to focus. + # Define page name. This value is used as reference to determine + # which application to load and what tab in the navigation bar to + # focus on. app.name = 'Sponsors' - # Define application title. This value is dislayed on the - # browser's title bar. Notice that we concatenated the page class - # default value here. + # Define page title. This value is dislayed on the browser's title + # bar. Notice that we concatenated the page class default value + # here. app.title += ' :: Sponsors' - page_header = app.logo() - page_header += app.ads_google() - page_header += app.navibar_top() - page_header += app.appslinks() - page_header += page_navibar_tabs() - page_header = app.tag_div({'id': 'page-header'}, [4,1], page_header, 1) - - page_body = page_content() + app.separator(indent=[12,1]) - page_body = app.tag_div({'id':'content'}, [8,1], page_body, 1) - page_body = app.tag_div({'id':'page-body'}, [4,1], page_body, 1) - - page_footer = app.tag_div({'id': 'page-footer'}, [4,1], app.credits(), 1) - - top = app.tag_a({'name':'top'}, [0,1], '') - wrap = app.tag_div({'id': 'wrap'}, [0,1], page_header + page_body + page_footer, 1) - body = app.tag_body('', [0,1], wrap) - - html = app.preamble() - html += app.tag_html({'xmlns': 'http://www.w3.org/1999/xhtml', 'dir': 'ltr', - 'lang': str(app.language), 'xml:lang': - str(app.language)}, [0,1], app.metadata() + body) + # Define page header. This is the information displayed + # between the page top and the page content. + app.header = app.logo() + app.header += app.ads_google() + app.header += app.navibar_top() + app.header += app.appslinks() + app.header += page_navibar_tabs() + + # Define page body. This is the information displayed between the + # page header and page footer. + app.body = page_content() + + # Define page footer. This is the information displayed between + # the page bottom and the page content, the last information + # displayed in the page. + app.footer = app.credits() + + # Define page final layout. + html = app.page() return html