add labels for HTML output

- add translatable labels for HTML output (not used for JSON yet)
- add oldpeople URL
- modify the output template to use one table
- add styles
- rename action from handle_post to urllist to reflect its use
- use a property to determine the order of url sections
- use a list with a type to aggregate the urlbuilder results
- use textilize to display labels
This commit is contained in:
Jan Dittberner 2009-01-22 17:34:46 +01:00
parent 9c641cb79c
commit 709f2067cd
7 changed files with 163 additions and 41 deletions

View file

@ -1,3 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%doc>
Template for the data input form.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
@ -18,16 +20,13 @@ You should have received a copy of the GNU Affero General Public
License along with this program. If not, see
<http://www.gnu.org/licenses/>.
</%doc>
<!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>
${h.start_form(h.url_for(action='handle_post'), method='get')}
${h.start_form(h.url_for(action='urllist'), method='get')}
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<label for="name">${_('Name:')}

View file

@ -1,3 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%doc>
Template for the url output page.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
@ -18,35 +20,39 @@ You should have received a copy of the GNU Affero General Public
License along with this program. If not, see
<http://www.gnu.org/licenses/>.
</%doc>
<!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']:
% if c.urldata:
<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>
<table>
<thead>
<tr><th>${_('Usage')}</th><th>${_('URL')}</th></tr>
</thead>
<tbody>
% for row in c.urldata:
% if row[0] == 'section':
<tr><th class="sectionlabel" colspan="2">${row[2]}</th></tr>
% elif row[0] == 'error':
<tr>
<td>${h.textilize(row[4])}</td>
<td>${_('Error during URL creation')}<br />
<span class="errormsg">${row[3].replace("\n",
'<br />')}</span></td>
</tr>
% else:
<tr>
<td>${h.textilize(row[4])}</td>
<td>${h.link_to(h.truncate(row[3], length=120), row[3])}</td>
</tr>
% endif
% endfor
</tbody>
</table>
</fieldset>
% endif
<p>${h.link_to(_('Restart'), h.url_for(action='index'))}</p>