Mercurial > p > roundup > code
comparison doc/customizing.txt @ 1147:89b1a8a468e7
more doc, "fixer" example
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 16 Sep 2002 02:07:44 +0000 |
| parents | db13f46cb5f9 |
| children | 20d42d7e4642 |
comparison
equal
deleted
inserted
replaced
| 1146:de6de14f230a | 1147:89b1a8a468e7 |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.35 $ | 5 :Version: $Revision: 1.36 $ |
| 6 | 6 |
| 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: | 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: |
| 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx | 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
| 9 | 9 |
| 10 .. contents:: | 10 .. contents:: |
| 649 used to display a "class help" page where there is no *classname*.help | 649 used to display a "class help" page where there is no *classname*.help |
| 650 **user.register** | 650 **user.register** |
| 651 a special page just for the user class that renders the registration page | 651 a special page just for the user class that renders the registration page |
| 652 **style.css** | 652 **style.css** |
| 653 a static file that is served up as-is | 653 a static file that is served up as-is |
| 654 | |
| 655 Note: Remember tyhat you can create any template extension you want to, so | |
| 656 if you just want to play around with the templating for new issues, you can | |
| 657 copy the current "issue.item" template to "issue.test", and then access the | |
| 658 test template using the ":template" URL argument:: | |
| 659 | |
| 660 http://your.tracker.example/tracker/issue?:template=test | |
| 661 | |
| 662 and it won't affect your users using the "issue.item" template. | |
| 663 | |
| 654 | 664 |
| 655 How the templates work | 665 How the templates work |
| 656 ---------------------- | 666 ---------------------- |
| 657 | 667 |
| 658 Roundup's templates consist of special attributes on your template tags. These | 668 Roundup's templates consist of special attributes on your template tags. These |
| 1806 </td> | 1816 </td> |
| 1807 </tr> | 1817 </tr> |
| 1808 </tal:block> | 1818 </tal:block> |
| 1809 </table> | 1819 </table> |
| 1810 | 1820 |
| 1821 Restricting the list of users that are assignable to a task | |
| 1822 ----------------------------------------------------------- | |
| 1823 | |
| 1824 1. create a new Role, say "Developer":: | |
| 1825 | |
| 1826 db.security.addRole(name='Developer', description='A developer') | |
| 1827 | |
| 1828 2. create a new Permission, say "Fixer", specific to "issue":: | |
| 1829 | |
| 1830 p = db.security.addPermission(name='Fixer', klass='issue', | |
| 1831 description='User is allowed to be assigned to fix issues') | |
| 1832 | |
| 1833 3. assign the new Permission to your "Developer" Role:: | |
| 1834 | |
| 1835 db.security.addPermissionToRole('Developer', p) | |
| 1836 | |
| 1837 4. use the new Permission in restricting the "assignedto" list in the issue | |
| 1838 item edit page:: | |
| 1839 | |
| 1840 <select name="assignedto"> | |
| 1841 <option value="-1">- no selection -</option> | |
| 1842 <tal:block tal:repeat="user db/user/list"> | |
| 1843 <option tal:condition="python:user.hasPermission('Fixer', context.classname)" | |
| 1844 tal:attributes="value user/id; | |
| 1845 selected python:user.id == context.assignedto" | |
| 1846 tal:content="user/realname"></option> | |
| 1847 </tal:block> | |
| 1848 </select> | |
| 1849 | |
| 1850 For extra security, you may wish to overload the hasEditItemPermission method | |
| 1851 on your tracker's interfaces.Client class to enforce the Permission | |
| 1852 requirement:: | |
| 1853 | |
| 1854 XXX | |
| 1855 | |
| 1856 | |
| 1811 ------------------- | 1857 ------------------- |
| 1812 | 1858 |
| 1813 Back to `Table of Contents`_ | 1859 Back to `Table of Contents`_ |
| 1814 | 1860 |
| 1815 .. _`Table of Contents`: index.html | 1861 .. _`Table of Contents`: index.html |
