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:
parent
7d1c54fe70
commit
12dc602c0b
3 changed files with 23 additions and 1 deletions
|
@ -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')
|
||||||
|
|
|
@ -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 *
|
||||||
|
|
21
ddportfolioservice/templates/showform.mako
Normal file
21
ddportfolioservice/templates/showform.mako
Normal 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>
|
Loading…
Reference in a new issue