Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/exe/webui/aboutpage.py
blob: af587bfec2b37b97108785ce181fb84c85df5360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2010 eXe Project, http://eXeLearning.org/
#
# 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# ===========================================================================

"""
The AboutPage is responsible for showing about information
"""

import logging
from twisted.web.resource import Resource
from exe.webui.renderable import RenderableResource
from exe.engine           import version

log = logging.getLogger(__name__)


# ===========================================================================
class AboutPage(RenderableResource):
    """
    The AboutPage is responsible for showing about information
    """
    name = 'about'

    def __init__(self, parent):
        """
        Initialize
        """
        RenderableResource.__init__(self, parent)

        
    def getChild(self, name, request):
        """
        Try and find the child for the name given
        """
        if name == "":
            return self
        else:
            return Resource.getChild(self, name, request)


    def render_GET(self, request):
        """Called for all requests to this object"""
        log.debug("render_GET")

        # Rendering
        request.setHeader('content-type',
                          'application/vnd.mozilla.xul+xml')
        xul  = u'<?xml version="1.0"?> \n'
        xul += u'<?xml-stylesheet href="chrome://global/skin/" '
        xul += u'type="text/css"?> \n'
        xul += u'<?xml-stylesheet href="/css/aboutDialog.css"  '
        xul += u'type="text/css"?>\n'
        
        xul += u'<window xmlns:html="http://www.w3.org/1999/xhtml"\n'
        xul += u'        xmlns="http://www.mozilla.org/keymaster/gatekeeper/'
        xul += u'there.is.only.xul"\n'
        xul += u'        id="aboutDialog"\n'
        xul += u'        title="About eXe"\n'
        xul += u'        style="width: 299px">\n'
        xul += u'  <deck id="modes" flex="1">\n'
        xul += u'    <vbox flex="1" id="clientBox">\n'
        xul += u'      <label id="eXeName" \n'
        xul += u'             value="eLearning XHTML editor"/>\n'
        xul += u'      <label id="version" \n'
        xul += u'             value="eXe Version '+version.release+'"/>\n'
        xul += u'      <label id="revision" style="text-align: center;" \n'
        xul += u'             value="Revision: '+version.revision+'" />\n'
        xul += u'      <description id="copyright">'
        xul += u'Copyright 2004-2010 eXe Project,<html:br/>'
        xul += u'       http://eXeLearning.org/<html:br/>\n'
        xul += u'<html:br/>\n'
        xul += u'email: exe@exelearning.org\n'
        xul += u'      </description>\n'
        xul += u'      <vbox id="detailsBox" align="center" flex="1">\n'
        xul += u'        <iframe id="creditsIframe" \n'
        xul += u'                src="/docs/credits.xhtml" \n'
        xul += u'                width="280px" flex="1"/>\n'
        xul += u'      </vbox>\n'
        xul += u'    </vbox>\n'
        xul += u'  </deck>\n'
        xul += u'  <separator class="groove" id="groove"/>\n'
        xul += u'</window>\n'

        return xul.encode('utf8')
    
    render_POST = render_GET

# ===========================================================================