add form template

use render in ddportfolio controller
add webhelpers.rails to helpers.py
create showform.mako resembling the output of the old ddportfolio.py
This commit is contained in:
Jan Dittberner 2009-01-20 23:15:11 +01:00
parent 7d1c54fe70
commit 12dc602c0b
3 changed files with 23 additions and 1 deletions

View file

@ -10,4 +10,4 @@ class DdportfolioController(BaseController):
# Return a rendered template # Return a rendered template
# return render('/some/template.mako') # return render('/some/template.mako')
# or, Return a response # or, Return a response
return 'Hello World' return render('/showform.mako')

View file

@ -4,3 +4,4 @@ Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to both as 'h'. available to Controllers. This module is available to both as 'h'.
""" """
from webhelpers import * from webhelpers import *
from webhelpers.rails import *

View file

@ -0,0 +1,21 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>${_('Debian Developer Portfolio')}</title>
</head>
<body>
${h.start_form(h.url_for(action='handle_post'), method='post')}
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<label for="name">${_('Name:')}</label><br />
${h.text_field('name', value=request.params.get('name', None))}<br />
<label for="email">${_('E-Mail address:')}</label><br />
${h.text_field('email', value=request.params.get('email', None))}<br />
<label for="username">${_('User name:')}</label><br />
${h.text_field('username', value=request.params.get('username', None))}<br />
${h.submit(value=_('Build DD Portfolio URLs'))}
</fieldset>
${h.end_form()}
</body>
</html>