summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f808f23)
raw | patch | inline | side by side (parent: f808f23)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 12 Sep 2002 03:57:09 +0000 (03:57 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 12 Sep 2002 03:57:09 +0000 (03:57 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1147 57a73879-2fb5-44c3-a270-3262357dd7e2
doc/customizing.txt | patch | blob | history | |
doc/default.css | patch | blob | history |
diff --git a/doc/customizing.txt b/doc/customizing.txt
index 5d7382c48969176e9427bf1248dff04b50333c97..6b9dc9127a2c0f7c5bf395101be5ea51dc488895 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.30 $
+:Version: $Revision: 1.31 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
.. contents::
-
+ :depth: 1
What You Can Do
===============
Web Interface
=============
+.. contents::
+ :local:
+ :depth: 1
+
The web is provided by the roundup.cgi.client module and is used by
roundup.cgi, roundup-server and ZRoundup.
In all cases, we determine which tracker is being accessed
action is performed before the requested page is generated. Actions are
triggered by using a ``:action`` CGI variable, where the value is one of:
-login
+**login**
Attempt to log a user in.
-logout
+**logout**
Log the user out - make them "anonymous".
-register
+**register**
Attempt to create a new user based on the contents of the form and then log
them in.
-edit
+**edit**
Perform an edit of an item in the database. There are some special form
elements you may use:
:required=property,property,...
The named properties are required to be filled in the form.
-new
+**new**
Add a new item to the database. You may use the same special form elements
as in the "edit" action.
-editCSV
+**editCSV**
Performs an edit of all of a class' items in one go. See also the
*class*.csv templating method which generates the CSV data to be edited, and
the "_generic.index" template which uses both of these features.
-search
+**search**
Mangle some of the form variables.
Set the form ":filter" variable based on the values of the
whether the action is permissible given the current user. The base permission
checks are:
-login
+**login**
Determine whether the user has permission to log in.
Base behaviour is to check the user has "Web Access".
-logout
+**logout**
No permission checks are made.
-register
+**register**
Determine whether the user has permission to register
Base behaviour is to check the user has "Web Registration".
-edit
+**edit**
Determine whether the user has permission to edit this item.
Base behaviour is to check the user can edit this class. If we're
editing the "user" class, users are allowed to edit their own
details. Unless it's the "roles" property, which requires the
special Permission "Web Roles".
-new
+**new**
Determine whether the user has permission to create (edit) this item.
Base behaviour is to check the user can edit this class. No
additional property checks are made. Additionally, new user items
may be created if the user has the "Web Registration" Permission.
-editCSV
+**editCSV**
Determine whether the user has permission to edit this class.
Base behaviour is to check the user can edit this class.
-search
+**search**
Determine whether the user has permission to search this class.
Base behaviour is to check the user can view this class.
Most customisation of the web view can be done by modifying the templates in
the tracker **html** directory. There are several types of files in there:
-page
+**page**
This template defines the overall look of your tracker. When you
view an issue, it appears inside this template. When you view an index, it
also appears inside this template. It will have a ``tal:content`` or
``tal:replace`` command with the expression ``structure content`` which
will show the issue, list of issues or whatever.
-home
+**home**
the default page displayed when no other page is indicated by the user
-home.classlist
+**home.classlist**
a special version of the default page that lists the classes in the tracker
-*classname*.item
+**classname.item**
displays an item of the *classname* class
-*classname*.index
+**classname.index**
displays a list of *classname* items
-*classname*.search
+**classname.search**
displays a search page for *classname* items
-_generic.index
+**_generic.index**
used to display a list of items where there is no *classname*.index available
-_generic.help
+**_generic.help**
used to display a "class help" page where there is no *classname*.help
-user.register
+**user.register**
a special page just for the user class that renders the registration page
-style.css
+**style.css**
a static file that is served up as-is
How the templates work
attributes form the Template Attribute Language, or TAL. The commands are:
-tal:define="variable expression; variable expression; ..."
+**tal:define="variable expression; variable expression; ..."**
Define a new variable that is local to this tag and its contents. For
example::
expression "request/description". The tal:content command inside the <html>
tag may then use the "title" variable.
-tal:condition="expression"
+**tal:condition="expression"**
Only keep this tag and its contents if the expression is true. For example::
<p tal:condition="python:request.user.hasPermission('View', 'issue')">
values. Nearly every other value is true, including non-zero numbers, and
strings with anything in them (even spaces!).
-tal:repeat="variable expression"
+**tal:repeat="variable expression"**
Repeat this tag and its contents for each element of the sequence that the
expression returns, defining a new local variable and a special "repeat"
variable for each element. For example::
The example would iterate over the sequence of users returned by
"user/list" and define the local variable "u" for each entry.
-tal:replace="expression"
+**tal:replace="expression"**
Replace this tag with the result of the expression. For example::
<span tal:replace="request/user/realname"></span>
realname. If the user's realname was "Bruce" then the resultant output
would be "Bruce".
-tal:content="expression"
+**tal:content="expression"**
Replace the contents of this tag with the result of the expression. For
example::
realname. If the user's realname was "Bruce" then the resultant output
would be "<span>Bruce</span>".
-tal:attributes="attribute expression; attribute expression; ..."
+**tal:attributes="attribute expression; attribute expression; ..."**
Set attributes on this tag to the results of expressions. For example::
<a tal:attributes="href string:user${request/user/id}">My Details</a>
the "string:user${request/user/id}" expression, which will be something
like "user123".
-tal:omit-tag="expression"
+**tal:omit-tag="expression"**
Remove this tag (but not its contents) if the expression is true. For
example::
The expressions you may use in the attibute values may be one of the following
three forms:
-Path Expressions - eg. ``item/status/checklist``
+**Path Expressions** - eg. ``item/status/checklist``
These are object attribute / item accesses. Roughly speaking, the path
``item/status/checklist`` is broken into parts ``item``, ``status``
and ``checklist``. The ``item`` part is the root of the expression.
XXX "nothing" and "default"
-String Expressions - eg. ``string:hello ${user/name}``
+**String Expressions** - eg. ``string:hello ${user/name}``
These expressions are simple string interpolations (though they can be just
plain strings with no interpolation if you want. The expression in the
``${ ... }`` is just a path expression as above.
-Python Expressions - eg. ``python: 1+1``
+**Python Expressions** - eg. ``python: 1+1``
These expressions give the full power of Python. All the "root level"
variables are available, so ``python:item.status.checklist()`` would be
equivalent to ``item/status/checklist``, assuming that ``checklist`` is
Information available to templates
----------------------------------
-The following variables are available to templates.
+Note: this is implemented by roundup.cgi.templating.RoundupPageTemplate
-.. taken from roundup.cgi.templating.RoundupPageTemplate docstring
+The following variables are available to templates.
-*context*
+**context**
The current context. This is either None, a
`hyperdb class wrapper`_ or a `hyperdb item wrapper`_
-*request*
+**request**
Includes information about the current request, including:
- the url
- the current index information (``filterspec``, ``filter`` args,
- *form*
The current CGI form information as a mapping of form argument
name to value
-*tracker*
+**tracker**
The current tracker
-*db*
+**db**
The current database, through which db.config may be reached.
-*nothing*
+**nothing**
This is a special variable - if an expression evaluates to this, then the
tag (in the case of a tal:replace), its contents (in the case of
tal:content) or some attributes (in the case of tal:attributes) will not
<span>Hello, World!</span>
-*default*
+**default**
Also a special variable - if an expression evaluates to this, then the
existing HTML in the template will not be replaced or removed, it will
remain. So::
<span>Hello, World!</span>
-*utils*
+**utils**
This variable makes available some utility functions like batching.
The context variable
<td tal:define="batch python:utils.Batch(keywords, 4, start)"
tal:repeat="keyword batch" tal:content="keyword/name">keyword here</td>
</tr>
- <tr><td colspan="4" style="border-top: 1px solid gray"> </td></tr>
</table>
... which will produce a table with four columns containing the items of the
diff --git a/doc/default.css b/doc/default.css
index 815f10483e469c3b637779abb489b4a8fa896864..a6c07c55effd98586cfbd2c21b1795302b685a0d 100644 (file)
--- a/doc/default.css
+++ b/doc/default.css
/*
:Author: David Goodger
:Contact: goodger@users.sourceforge.net
-:date: $Date: 2002-09-10 07:07:16 $
-:version: $Revision: 1.8 $
+:date: $Date: 2002-09-12 03:57:09 $
+:version: $Revision: 1.9 $
:copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
table {
margin-top: 0.5em ;
- margin-bottom: 0.5em }
+ margin-bottom: 0.5em ;
+ }
table.citation {
+ border-top: 0;
+ border-bottom: 0;
+ border-right: 0;
border-left: solid thin gray ;
padding-left: 0.5ex }
td, th {
padding-left: 0.5em ;
padding-right: 0.5em ;
- vertical-align: baseline }
+ vertical-align: baseline;
+}
+
+table.table {
+ border-spacing: 0px;
+ border-collapse: separate;
+}
+table.table td {
+ text-align: left;
+ border: solid thin gray;
+}
+
+table.table th {
+ text-align: left;
+ border: solid thin gray;
+}
td > p:first-child, th > p:first-child {
margin-top: 0em }