Mercurial > p > roundup > code
view roundup/templates/classic/html/_generic.item @ 1136:7e193bbda38e
added generic item editing
. much nicer layout of template rendering errors
. added context/is_edit_ok and context/is_view_ok convenience methods and
implemented use of them in the classic template
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 03:31:19 +0000 |
| parents | 645a7caa2e9c |
| children | b862bbf2067a |
line wrap: on
line source
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"> You are not allowed to view this page. </span> <form method="POST" onSubmit="return submit_once()" enctype="multipart/form-data" tal:condition="context/is_edit_ok"> <input type="hidden" name=":template" value="item"> <input type="hidden" name=":required" value="title"> <table class="form"> <tr tal:repeat="prop python:db[context._classname].properties()"> <tal:block tal:condition="python:prop._name not in ('id', 'creator', 'creation', 'activity')"> <th tal:content="prop/_name"></th> <td tal:content="structure python:context[prop._name].field()"></td> </tal:block> </tr> <tr> <td> </td> <td colspan=3 tal:content="structure context/submit"> submit button will go here </td> </tr> </table> <table class="form" tal:condition="context/is_only_view_ok"> <tr tal:repeat="prop python:db[context._classname].properties()"> <tal:block tal:condition="python:prop._name not in ('id', 'creator', 'creation', 'activity')"> <th tal:content="prop/_name"></th> <td tal:content="structure python:context[prop._name].field()"></td> </tal:block> </tr> <tr> <td> </td> <td colspan=3 tal:content="structure context/submit"> submit button will go here </td> </tr> </table> <tal:block tal:condition="python:context.id and context.is_view_ok()"> <tal:block tal:replace="structure context/history" /> </tal:block>
