implement URL generation
move code for URL generation to model/urlbuilder.py add format selection to input form create output template
This commit is contained in:
parent
d86965304f
commit
f33f6c7751
7 changed files with 81 additions and 108 deletions
|
@ -27,6 +27,8 @@
|
|||
% endif
|
||||
</label><br />
|
||||
${h.text_field('username', value=request.params.get('username', None))}<br />
|
||||
<label for="mode_html">${_('Output format:')}</label><br />
|
||||
${_('HTML')} ${h.radio_button('mode', 'html', checked=(request.params.get('mode', 'html') == 'html'))} ${_('JSON')} ${h.radio_button('mode', 'json', checked=(request.params.get('mode', 'html') == 'json'))}<br />
|
||||
${h.submit(value=_('Build DD Portfolio URLs'))}
|
||||
</fieldset>
|
||||
${h.end_form()}
|
||||
|
|
34
ddportfolioservice/templates/showurls.mako
Normal file
34
ddportfolioservice/templates/showurls.mako
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!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>
|
||||
${h.stylesheet_link_tag('style')}
|
||||
</head>
|
||||
<body>
|
||||
% if c.urldata['data']:
|
||||
<fieldset id="ddportfolio">
|
||||
<legend>${_('Debian Developer Portfolio')}</legend>
|
||||
<ul>
|
||||
% for key in c.urldata['data']:
|
||||
<li>${key}<br />${h.link_to(h.truncate(
|
||||
c.urldata['data'][key], length=120), c.urldata['data'][key])}</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</fieldset>
|
||||
% endif
|
||||
% if c.urldata['errors']:
|
||||
<fieldset id="ddportfolioerrors">
|
||||
<legend>${_('Errors during URL creation')}</legend>
|
||||
<ul>
|
||||
% for key in c.urldata['errors']:
|
||||
<li>${key}<br />
|
||||
<span class="errormsg">${c.urldata['errors'][key][0]}<br />
|
||||
${c.urldata['errors'][key][1]}</span></li>
|
||||
% endfor
|
||||
</ul>
|
||||
</fieldset>
|
||||
% endif
|
||||
<p>${h.link_to(_('Restart'), h.url_for(action='index'))}</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue