source: TI01-discovery-OaiInfoEditor/trunk/v3n_NDG3/OAIInfoEditor/oai_info_editor/controllers/home.py @ 6765

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery-OaiInfoEditor/trunk/v3n_NDG3/OAIInfoEditor/oai_info_editor/controllers/home.py@6765
Revision 6765, 1.7 KB checked in by sdonegan, 11 years ago (diff)

works with new config title values

  • Property svn:executable set to *
Line 
1'''
2 Class representing pylons controller to create the home page for the OAI Info Editor
3 
4 @author: C Byrom, Tessella Apr 2009
5'''
6import logging, urllib
7from oai_info_editor.lib.base import *
8from oai_info_editor.lib.constants import *
9from oai_info_editor.controllers.master import MasterController
10from oai_info_editor.controllers.master import ADMIN_PARAMETER
11
12class HomeController(MasterController):
13
14    def index(self):
15        logging.info("Rendering editor home page")
16        #c.title = EDITOR_HOME_TITLE
17        c.title = g.mainTitle
18        c.subTitle = g.subTitle
19        c.abstract = g.titlePara
20        c.suppEmail = g.email
21        self._setUpController()
22       
23        if session.get(POP_UP_MESSAGE_SESSION_KEY):
24            c.popupMessage = session.get(POP_UP_MESSAGE_SESSION_KEY)
25            del session[POP_UP_MESSAGE_SESSION_KEY]
26            session.save()
27       
28        if c.user.isAdmin:
29            c.createLink = h.url_for('createProviderInfo') + ADMIN_PARAMETER
30       
31        return self._renderTemplate('genshi', 'home')
32
33   
34   
35    def showHelpPage(self):
36        '''
37        Show the help page
38        '''
39        logging.info("Rendering help page")
40        self._setUpController()
41        c.title = HELP_PAGE_TITLE
42        return self._renderTemplate('genshi', 'oai_info_editor_help')
43       
44   
45   
46    def loginDeniedPage(self):
47        '''
48        Show a specialised error page if user tries to do anything but doesnt have the correct openId roles etc etc
49        '''
50        logging.info("Rendering login denied page")
51       
52        self._setUpController()
53       
54        c.title = "User login denied page"
55       
56        return self._renderTemplate('genshi', 'loginDenied')
57   
Note: See TracBrowser for help on using the repository browser.