1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: cgi_client.py,v 1.43 2001-10-24 00:01:42 richard Exp $
18+ # $Id: cgi_client.py,v 1.44 2001-10-28 23:03:08 richard Exp $
1919
2020import os , cgi , pprint , StringIO , urlparse , re , traceback , mimetypes
2121import base64 , Cookie , time
@@ -76,7 +76,7 @@ def header(self, headers={'Content-Type':'text/html'}):
7676 self .headers_done = 1
7777
7878 def pagehead (self , title , message = None ):
79- url = self .env ['SCRIPT_NAME' ] + '/' #self.env.get('PATH_INFO', '/')
79+ url = self .env ['SCRIPT_NAME' ] + '/'
8080 machine = self .env ['SERVER_NAME' ]
8181 port = self .env ['SERVER_PORT' ]
8282 if port != '80' : machine = machine + ':' + port
@@ -86,21 +86,47 @@ def pagehead(self, title, message=None):
8686 else :
8787 message = ''
8888 style = open (os .path .join (self .TEMPLATES , 'style.css' )).read ()
89- if self .user is not None :
89+ user_name = self .user or ''
90+ if self .user == 'admin' :
91+ admin_links = ' | <a href="list_classes">Class List</a>'
92+ else :
93+ admin_links = ''
94+ if self .user not in (None , 'anonymous' ):
9095 userid = self .db .user .lookup (self .user )
91- user_info = '(login: <a href="user%s">%s</a>)' % (userid , self .user )
96+ user_info = '''
97+ <a href="issue?assignedto=%s&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:filter=status,assignedto&:sort=activity&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">My Issues</a> |
98+ <a href="user%s">My Details</a> | <a href="logout">Logout</a>
99+ ''' % (userid , userid )
92100 else :
93- user_info = ''
101+ user_info = '<a href="login">Login</a>'
102+ if self .user is not None :
103+ add_links = '''
104+ | Add
105+ <a href="newissue">Issue</a>,
106+ <a href="newuser">User</a>
107+ '''
108+ else :
109+ add_links = ''
94110 self .write ('''<html><head>
95111<title>%s</title>
96112<style type="text/css">%s</style>
97113</head>
98114<body bgcolor=#ffffff>
99115%s
100116<table width=100%% border=0 cellspacing=0 cellpadding=2>
101- <tr class="location-bar"><td><big><strong>%s</strong></big> %s</td></tr>
117+ <tr class="location-bar"><td><big><strong>%s</strong></big></td>
118+ <td align=right valign=bottom>%s</td></tr>
119+ <tr class="location-bar">
120+ <td align=left>All
121+ <a href="issue?status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
122+ | Unassigned
123+ <a href="issue?assignedto=-1&status=-1,unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:filter=status,assignedto&:columns=id,activity,status,title,assignedto&:group=priority&show_customization=1">Issues</a>
124+ %s
125+ %s</td>
126+ <td align=right>%s</td>
102127</table>
103- ''' % (title , style , message , title , user_info ))
128+ ''' % (title , style , message , title , user_name , add_links , admin_links ,
129+ user_info ))
104130
105131 def pagefoot (self ):
106132 if self .debug :
@@ -848,6 +874,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
848874
849875#
850876# $Log: not supported by cvs2svn $
877+ # Revision 1.43 2001/10/24 00:01:42 richard
878+ # More fixes to lockout logic.
879+ #
851880# Revision 1.42 2001/10/23 23:56:03 richard
852881# HTML typo
853882#
0 commit comments