1- # $Id: interfaces.py,v 1.1 2001-07-23 23:28:43 richard Exp $
1+ # $Id: interfaces.py,v 1.2 2001-07-29 04:07:37 richard Exp $
2+
3+ import urlparse , os
24
35import instance_config
46from roundup import cgi_client , mailgw
@@ -8,7 +10,36 @@ class Client(cgi_client.Client):
810 with any specific extensions
911 '''
1012 TEMPLATES = instance_config .TEMPLATES
11- pass
13+
14+ default_index_sort = ['-activity' ]
15+ default_index_group = ['priority' ]
16+ default_index_filter = []
17+ default_index_columns = ['id' ,'activity' ,'title' ,'status' ,'assignedto' ]
18+ default_index_filterspec = {'status' : ['1' , '2' , '3' , '4' , '5' , '6' , '7' ]}
19+
20+ def pagehead (self , title , message = None ):
21+ url = self .env ['SCRIPT_NAME' ] + '/' #self.env.get('PATH_INFO', '/')
22+ machine = self .env ['SERVER_NAME' ]
23+ port = self .env ['SERVER_PORT' ]
24+ if port != '80' : machine = machine + ':' + port
25+ base = urlparse .urlunparse (('http' , machine , url , None , None , None ))
26+ if message is not None :
27+ message = '<div class="system-msg">%s</div>' % message
28+ else :
29+ message = ''
30+ style = open (os .path .join (self .TEMPLATES , 'style.css' )).read ()
31+ userid = self .db .user .lookup (self .user )
32+ self .write ('''<html><head>
33+ <title>%s</title>
34+ <style type="text/css">%s</style>
35+ </head>
36+ <body bgcolor=#ffffff>
37+ %s
38+ <table width=100%% border=0 cellspacing=0 cellpadding=2>
39+ <tr class="location-bar"><td><big><strong>%s</strong></big>
40+ (login: <a href="user%s">%s</a>)</td></tr>
41+ </table>
42+ ''' % (title , style , message , title , userid , self .user ))
1243
1344class MailGW (mailgw .MailGW ):
1445 ''' derives basic mail gateway implementation from the standard module,
@@ -20,6 +51,9 @@ class MailGW(mailgw.MailGW):
2051
2152#
2253# $Log: not supported by cvs2svn $
54+ # Revision 1.1 2001/07/23 23:28:43 richard
55+ # Adding the classic template
56+ #
2357# Revision 1.1 2001/07/23 23:16:01 richard
2458# Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
2559#
0 commit comments