Mercurial > p > roundup > code
annotate roundup/templates/extended/interfaces.py @ 144:b0c4ac63c6ed
Big changes:
. split off the support priority into its own class
. added "new support, new user" to the page head
. fixed the display options for the heading links
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 30 Jul 2001 01:26:59 +0000 |
| parents | 0791d13baea7 |
| children | a49c8a2ddd26 |
| rev | line source |
|---|---|
| 144 | 1 # $Id: interfaces.py,v 1.3 2001-07-30 01:26:59 richard Exp $ |
|
55
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2 |
| 144 | 3 import instance_config, urlparse, os |
|
55
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
4 from roundup import cgi_client, mailgw |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
5 |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
6 class Client(cgi_client.Client): |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
7 ''' derives basic mail gateway implementation from the standard module, |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
8 with any specific extensions |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
9 ''' |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
10 TEMPLATES = instance_config.TEMPLATES |
| 144 | 11 showsupport = cgi_client.Client.showitem |
| 12 newsupport = cgi_client.Client.newissue | |
| 13 | |
| 14 default_index_sort = ['-activity'] | |
| 15 default_index_group = ['priority'] | |
| 16 default_index_filter = [] | |
| 17 default_index_columns = ['activity','status','title','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 if self.user == 'admin': | |
| 33 extras = ' | <a href="list_classes">Class List</a>' | |
| 34 else: | |
| 35 extras = '' | |
| 36 self.write('''<html><head> | |
| 37 <title>%s</title> | |
| 38 <style type="text/css">%s</style> | |
| 39 </head> | |
| 40 <body bgcolor=#ffffff> | |
| 41 %s | |
| 42 <table width=100%% border=0 cellspacing=0 cellpadding=2> | |
| 43 <tr class="location-bar"><td><big><strong>%s</strong></big></td> | |
| 44 <td align=right valign=bottom>%s</td></tr> | |
| 45 <tr class="location-bar"> | |
| 46 <td align=left><a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title,assignedto&:group=priority">All issues</a> | | |
| 47 <a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title,assignedto&priority=fatal-bug,bug">Bugs</a> | | |
| 48 <a href="issue?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title,assignedto&priority=usability,feature">Wishlist</a> | | |
| 49 <a href="support?status=unread,deferred,chatting,need-eg,in-progress,testing,done-cbb&:sort=activity&:columns=activity,status,title,assignedto&:group=customername">Support</a> | | |
| 50 <a href="newissue">New Issue</a> | | |
| 51 <a href="newsupport">New Support</a> | | |
| 52 <a href="newuser">New User</a> | |
| 53 %s</td> | |
| 54 <td align=right><a href="user%s">Your Details</a></td> | |
| 55 </table> | |
| 56 '''%(title, style, message, title, self.user, extras, userid)) | |
|
55
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
57 |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
58 class MailGW(mailgw.MailGW): |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
59 ''' derives basic mail gateway implementation from the standard module, |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
60 with any specific extensions |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 ''' |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
62 ISSUE_TRACKER_EMAIL = instance_config.ISSUE_TRACKER_EMAIL |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
63 ADMIN_EMAIL = instance_config.ADMIN_EMAIL |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
64 MAILHOST = instance_config.MAILHOST |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
65 |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
66 # |
|
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
67 # $Log: not supported by cvs2svn $ |
| 144 | 68 # Revision 1.2 2001/07/29 07:01:39 richard |
| 69 # Added vim command to all source so that we don't get no steenkin' tabs :) | |
| 70 # | |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
55
diff
changeset
|
71 # Revision 1.1 2001/07/23 23:16:01 richard |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
55
diff
changeset
|
72 # Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff. |
|
55
bd7be96eb56d
Split off the interfaces (CGI, mailgw) into a separate file from the DB stuff.
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 # |
|
127
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
55
diff
changeset
|
74 # |
|
0791d13baea7
Added vim command to all source so that we don't get no steenkin' tabs :)
Richard Jones <richard@users.sourceforge.net>
parents:
55
diff
changeset
|
75 # vim: set filetype=python ts=4 sw=4 et si |
