Code

Fixed the classic template so it's more like the "advertised" Roundup
[roundup.git] / roundup / templates / classic / interfaces.py
1 # $Id: interfaces.py,v 1.2 2001-07-29 04:07:37 richard Exp $
3 import urlparse, os
5 import instance_config
6 from roundup import cgi_client, mailgw 
8 class Client(cgi_client.Client): 
9     ''' derives basic mail gateway implementation from the standard module, 
10         with any specific extensions 
11     ''' 
12     TEMPLATES = instance_config.TEMPLATES
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']}
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))
43  
44 class MailGW(mailgw.MailGW): 
45     ''' derives basic mail gateway implementation from the standard module, 
46         with any specific extensions 
47     ''' 
48     ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL
49     ADMIN_EMAIL = instance_config.ADMIN_EMAIL
50     MAILHOST = instance_config.MAILHOST
52 #
53 # $Log: not supported by cvs2svn $
54 # Revision 1.1  2001/07/23 23:28:43  richard
55 # Adding the classic template
56 #
57 # Revision 1.1  2001/07/23 23:16:01  richard
58 # Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
59 #
60 #