Skip to content

Commit f8f0203

Browse files
author
Richard Jones
committed
adding the "minimal" template
1 parent 39acb3f commit f8f0203

File tree

17 files changed

+1024
-0
lines changed

17 files changed

+1024
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.pyc
2+
*.pyo
3+
htmlbase.py
4+
*.cover
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3+
# This module is free software, and you may redistribute it and/or modify
4+
# under the same terms as Python, so long as this copyright message and
5+
# disclaimer are retained in their original form.
6+
#
7+
# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8+
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9+
# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10+
# POSSIBILITY OF SUCH DAMAGE.
11+
#
12+
# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13+
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14+
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15+
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16+
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17+
#
18+
# $Id: __init__.py,v 1.1 2002-09-26 04:15:07 richard Exp $
19+
20+
import config
21+
from dbinit import open, init
22+
from interfaces import Client, MailGW
23+
24+
# vim: set filetype=python ts=4 sw=4 et si
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#
2+
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3+
# This module is free software, and you may redistribute it and/or modify
4+
# under the same terms as Python, so long as this copyright message and
5+
# disclaimer are retained in their original form.
6+
#
7+
# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8+
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9+
# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10+
# POSSIBILITY OF SUCH DAMAGE.
11+
#
12+
# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13+
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14+
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15+
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16+
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17+
#
18+
# $Id: config.py,v 1.1 2002-09-26 04:15:06 richard Exp $
19+
20+
import os
21+
22+
# roundup home is this package's directory
23+
TRACKER_HOME=os.path.split(__file__)[0]
24+
25+
# The SMTP mail host that roundup will use to send mail
26+
MAILHOST = 'localhost'
27+
28+
# The domain name used for email addresses.
29+
MAIL_DOMAIN = 'your.tracker.email.domain.example'
30+
31+
# This is the directory that the database is going to be stored in
32+
DATABASE = os.path.join(TRACKER_HOME, 'db')
33+
34+
# This is the directory that the HTML templates reside in
35+
TEMPLATES = os.path.join(TRACKER_HOME, 'html')
36+
37+
# A descriptive name for your roundup instance
38+
TRACKER_NAME = 'Roundup issue tracker'
39+
40+
# The email address that mail to roundup should go to
41+
TRACKER_EMAIL = 'issue_tracker@%s'%MAIL_DOMAIN
42+
43+
# The web address that the instance is viewable at
44+
TRACKER_WEB = 'http://your.tracker.url.example/'
45+
46+
# The email address that roundup will complain to if it runs into trouble
47+
ADMIN_EMAIL = 'roundup-admin@%s'%MAIL_DOMAIN
48+
49+
# Where to place the web filtering HTML on the index page
50+
FILTER_POSITION = 'bottom' # one of 'top', 'bottom', 'top and bottom'
51+
52+
#
53+
# SECURITY DEFINITIONS
54+
#
55+
# define the Roles that a user gets when they register with the tracker
56+
# these are a comma-separated string of role names (e.g. 'Admin,User')
57+
NEW_WEB_USER_ROLES = 'User'
58+
NEW_EMAIL_USER_ROLES = 'User'
59+
60+
# Send nosy messages to the author of the message
61+
MESSAGES_TO_AUTHOR = 'no' # either 'yes' or 'no'
62+
63+
# Does the author of a message get placed on the nosy list automatically?
64+
# If 'new' is used, then the author will only be added when a message
65+
# creates a new issue. If 'yes', then the author will be added on followups
66+
# too. If 'no', they're never added to the nosy.
67+
ADD_AUTHOR_TO_NOSY = 'new' # one of 'yes', 'no', 'new'
68+
69+
# Do the recipients (To:, Cc:) of a message get placed on the nosy list?
70+
# If 'new' is used, then the recipients will only be added when a message
71+
# creates a new issue. If 'yes', then the recipients will be added on followups
72+
# too. If 'no', they're never added to the nosy.
73+
ADD_RECIPIENTS_TO_NOSY = 'new' # either 'yes', 'no', 'new'
74+
75+
# Where to place the email signature
76+
EMAIL_SIGNATURE_POSITION = 'bottom' # one of 'top', 'bottom', 'none'
77+
78+
# Keep email citations when accepting messages. Setting this to "no" strips
79+
# out "quoted" text from the message. Signatures are also stripped.
80+
EMAIL_KEEP_QUOTED_TEXT = 'yes' # either 'yes' or 'no'
81+
82+
# Preserve the email body as is - that is, keep the citations _and_
83+
# signatures.
84+
EMAIL_LEAVE_BODY_UNCHANGED = 'no' # either 'yes' or 'no'
85+
86+
# Default class to use in the mailgw if one isn't supplied in email
87+
# subjects. To disable, comment out the variable below or leave it blank.
88+
# Examples:
89+
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
90+
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
91+
92+
# vim: set filetype=python ts=4 sw=4 et si
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#
2+
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3+
# This module is free software, and you may redistribute it and/or modify
4+
# under the same terms as Python, so long as this copyright message and
5+
# disclaimer are retained in their original form.
6+
#
7+
# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8+
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9+
# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10+
# POSSIBILITY OF SUCH DAMAGE.
11+
#
12+
# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13+
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14+
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15+
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16+
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17+
#
18+
# $Id: dbinit.py,v 1.1 2002-09-26 04:15:07 richard Exp $
19+
20+
import os
21+
22+
import config
23+
from select_db import Database, Class, FileClass, IssueClass
24+
25+
def open(name=None):
26+
''' as from the roundupdb method openDB
27+
'''
28+
from roundup.hyperdb import String, Password, Date, Link, Multilink
29+
30+
# open the database
31+
db = Database(config, name)
32+
33+
#
34+
# Now initialise the schema. Must do this each time the database is
35+
# opened.
36+
#
37+
38+
# The "Minimal" template gets only one class, the required "user"
39+
# class. That's it. And even that has the bare minimum of properties.
40+
41+
# Note: roles is a comma-separated string of Role names
42+
user = Class(db, "user", username=String(), password=Password(),
43+
address=String(), alternate_addresses=String(), roles=String())
44+
user.setkey("username")
45+
46+
#
47+
# SECURITY SETTINGS
48+
#
49+
# new permissions for this schema
50+
for cl in ('user', ):
51+
db.security.addPermission(name="Edit", klass=cl,
52+
description="User is allowed to edit "+cl)
53+
db.security.addPermission(name="View", klass=cl,
54+
description="User is allowed to access "+cl)
55+
56+
# and give the regular users access to the web and email interface
57+
p = db.security.getPermission('Web Access')
58+
db.security.addPermissionToRole('User', p)
59+
p = db.security.getPermission('Email Access')
60+
db.security.addPermissionToRole('User', p)
61+
62+
# May users view other user information? Comment these lines out
63+
# if you don't want them to
64+
p = db.security.getPermission('View', 'user')
65+
db.security.addPermissionToRole('User', p)
66+
67+
# Assign the appropriate permissions to the anonymous user's Anonymous
68+
# Role. Choices here are:
69+
# - Allow anonymous users to register through the web
70+
p = db.security.getPermission('Web Registration')
71+
db.security.addPermissionToRole('Anonymous', p)
72+
# - Allow anonymous (new) users to register through the email gateway
73+
p = db.security.getPermission('Email Registration')
74+
db.security.addPermissionToRole('Anonymous', p)
75+
76+
import detectors
77+
detectors.init(db)
78+
79+
# schema is set up - run any post-initialisation
80+
db.post_init()
81+
return db
82+
83+
def init(adminpw):
84+
''' as from the roundupdb method initDB
85+
86+
Open the new database, and add new nodes - used for initialisation. You
87+
can edit this before running the "roundup-admin initialise" command to
88+
change the initial database entries.
89+
'''
90+
dbdir = os.path.join(config.DATABASE, 'files')
91+
if not os.path.isdir(dbdir):
92+
os.makedirs(dbdir)
93+
94+
db = open("admin")
95+
db.clear()
96+
97+
# create the two default users
98+
user = db.getclass('user')
99+
user.create(username="admin", password=adminpw,
100+
address=config.ADMIN_EMAIL, roles='Admin')
101+
user.create(username="anonymous", roles='Anonymous')
102+
103+
db.commit()
104+
105+
# vim: set filetype=python ts=4 sw=4 et si
106+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pyc
2+
*.pyo
3+
*.cover
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
3+
# This module is free software, and you may redistribute it and/or modify
4+
# under the same terms as Python, so long as this copyright message and
5+
# disclaimer are retained in their original form.
6+
#
7+
# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
8+
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
9+
# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
10+
# POSSIBILITY OF SUCH DAMAGE.
11+
#
12+
# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
13+
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14+
# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15+
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16+
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17+
#
18+
#$Id: __init__.py,v 1.1 2002-09-26 04:15:26 richard Exp $
19+
20+
def init(db):
21+
''' execute the init functions of all the modules in this directory
22+
'''
23+
import os, sys
24+
this_dir = os.path.split(__file__)[0]
25+
try:
26+
sys.path.insert(0, this_dir)
27+
for file in os.listdir(this_dir):
28+
file, ext = os.path.splitext(file)
29+
if file == '__init__':
30+
continue
31+
if ext == '.py':
32+
module = __import__(file)
33+
module.init(db)
34+
finally:
35+
del sys.path[0]
36+
37+
# vim: set filetype=python ts=4 sw=4 et si
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<head>
3+
<link rel="stylesheet" type="text/css" href="_file/style.css">
4+
</head>
5+
<body class="body" marginwidth="0" marginheight="0">
6+
7+
<table class="classhelp"
8+
tal:define="props python:request.form['properties'].value.split(',')">
9+
<tr><th tal:repeat="prop props" tal:content="prop"></th></tr>
10+
<tr tal:repeat="item context/list">
11+
<td tal:repeat="prop props" tal:content="python:item[prop]"></td>
12+
</tr>
13+
</table>
14+
15+
</body>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!-- dollarId: issue.index,v 1.2 2001/07/29 04:07:37 richard Exp dollar-->
2+
3+
<tal:block metal:use-macro="templates/page/macros/icing">
4+
<title metal:fill-slot="head_title"
5+
tal:content="python:context._classname.capitalize()+' editing'"></title>
6+
<td class="page-header-top" metal:fill-slot="body_title">
7+
<h2 tal:content="python:context._classname.capitalize()+' editing'"></h2>
8+
</td>
9+
<td class="content" metal:fill-slot="content">
10+
11+
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
12+
You are not allowed to view this page.
13+
</span>
14+
15+
<tal:block tal:condition="context/is_edit_ok">
16+
<p class="form-help">
17+
You may edit the contents of the <span tal:replace="request/classname" />
18+
class using this form. Commas, newlines and double quotes (") must be
19+
handled delicately. You may include commas and newlines by enclosing the
20+
values in double-quotes ("). Double quotes themselves must be quoted by
21+
doubling ("").
22+
</p>
23+
24+
<p class="form-help">
25+
Multilink properties have their multiple values colon (":") separated
26+
(... ,"one:two:three", ...)
27+
</p>
28+
29+
<p class="form-help">
30+
Remove entries by deleting their line. Add new entries by appending
31+
them to the table - put an X in the id column.
32+
</p>
33+
34+
<form onSubmit="return submit_once()" method="POST">
35+
<textarea rows="15" cols="60" name="rows" tal:content="context/csv"></textarea>
36+
<br>
37+
<input type="hidden" name=":action" value="editCSV">
38+
<input type="submit" value="Edit Items">
39+
</form>
40+
</tal:block>
41+
42+
<tal:block tal:condition="context/is_only_view_ok">
43+
view ok
44+
</tal:block>
45+
46+
</td>
47+
48+
</tal:block>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<tal:block metal:use-macro="templates/page/macros/icing">
2+
<title metal:fill-slot="head_title"
3+
tal:content="python:context._classname.capitalize()+' editing'"></title>
4+
<td class="page-header-top" metal:fill-slot="body_title">
5+
<h2 tal:content="python:context._classname.capitalize()+' editing'"></h2>
6+
</td>
7+
<td class="content" metal:fill-slot="content">
8+
9+
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
10+
You are not allowed to view this page.
11+
</span>
12+
13+
<form method="POST" onSubmit="return submit_once()"
14+
enctype="multipart/form-data" tal:condition="context/is_edit_ok">
15+
16+
<input type="hidden" name=":template" value="item">
17+
<input type="hidden" name=":required" value="title">
18+
19+
<table class="form">
20+
21+
<tr tal:repeat="prop python:db[context._classname].properties()">
22+
<tal:block tal:condition="python:prop._name not in ('id', 'creator',
23+
'creation', 'activity')">
24+
<th tal:content="prop/_name"></th>
25+
<td tal:content="structure python:context[prop._name].field()"></td>
26+
</tal:block>
27+
</tr>
28+
<tr>
29+
<td>&nbsp;</td>
30+
<td colspan=3 tal:content="structure context/submit">
31+
submit button will go here
32+
</td>
33+
</tr>
34+
</table>
35+
36+
</form>
37+
38+
<table class="form" tal:condition="context/is_only_view_ok">
39+
40+
<tr tal:repeat="prop python:db[context._classname].properties()">
41+
<tal:block tal:condition="python:prop._name not in ('id', 'creator',
42+
'creation', 'activity')">
43+
<th tal:content="prop/_name"></th>
44+
<td tal:content="structure python:context[prop._name].field()"></td>
45+
</tal:block>
46+
</tr>
47+
</table>
48+
49+
50+
<tal:block tal:condition="python:context.id and context.is_view_ok()">
51+
<tal:block tal:replace="structure context/history" />
52+
</tal:block>
53+
54+
</td>
55+
56+
</tal:block>

0 commit comments

Comments
 (0)