improved design, additional texts, base template

- add style classes to output table
- add Debian and AGPL logos
- use a base template for common template code
- add proper styles for output table
This commit is contained in:
Jan Dittberner 2009-01-22 23:32:19 +01:00
parent eb4341c0db
commit ed65846189
6 changed files with 196 additions and 127 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View file

@ -3,6 +3,19 @@ html, body {
font-size:10pt;
}
#debianlogo {
float:right;
}
#content {
clear:both;
}
#agpllogo {
float:left;
margin-right:10px;
}
table {
border-collapse:collapse;
width:100%;
@ -12,6 +25,23 @@ th, td {
border:1px solid grey;
}
tr.section {
background-color: #a0a0a0;
color: #f0f0f0;
}
tr.odd td {
background-color: #f0f0f0;
}
tr.even td {
background-color: #e0e0ff;
}
tr.error td {
background-color: #ffe0e0;
}
td {
vertical-align:top;
padding:2px;
@ -23,6 +53,5 @@ td p {
}
.errormsg {
font-size:80%;
color:red;
}

View file

@ -0,0 +1,45 @@
<!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>
This file is part of DDPortfolio service.
DDPortfolio service is free software: you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
DDPortfolio service is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
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>
<html>
<head>
<title>${_('Debian Developer Portfolio Service')}${self.titleaddon()}</title>
${h.stylesheet_link('/stylesheets/style.css')}
</head>
<body>
<div id="header">
${h.image('/images/openlogo-100.jpg', _('Debian Logo'), 100, 100,
id='debianlogo')}
<h1>${_('Debian Developer Portfolio Service')}</h1>
<p>${_('''This service has been inspired by Stefano Zachioli's <a href="http://wiki.debian.org/DDPortfolio">DDPortfolio page in the Debian Wiki</a>. You can create a set of customized links leading to a Debian Developer's or package maintainer's information regarding Debian.''')}</p>
</div>
<div id="content">
${self.body()}
</div>
<div id="footer">
${h.image('/images/agplv3-88x31.png', _('AGPL - Free Software'), 88, 31,
id='agpllogo')}
<p>${_('''The service is available under the terms of the <a href="http://www.gnu.org/licenses/agpl.html">GNU Affero General Public License</a> as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. You can <a href="http://ddportfolio.debian.net/gitweb?p=ddportfolioservice.git;a=summary">download the source code</a> using <a href="http://git.or.cz">git</a>.''')}</p>
<p>${_('''Copyright &copy; 2009 Jan Dittberner''')}</p>
</div>
</body>
</html>

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%inherit file="base.mako" />
<%doc>
Template for the data input form.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
@ -20,87 +19,82 @@ 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>
<html>
<head>
<title>${_('Debian Developer Portfolio')}</title>
${h.stylesheet_link('/stylesheets/style.css')}
</head>
<body>
${h.form(h.url_for(action='urllist'), method='get')}
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<div id="emailfield">
<label for="email">${_('Email address:')}
% if 'email' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['email']}</span>
% endif
</label><br />
${h.text('email', value=request.params.get('email', None))}<br />
</div>
<div id="namefield">
<label for="name">${_('Name:')}
% if 'name' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['name']}</span>
% endif
</label><br />
${h.text('name', value=request.params.get('name', None))}<br />
</div>
<div id="gpgfpfield">
<label for="gpgfp">${_('GPG fingerprint:')}
% if 'gpgfp' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['gpgfp']}</span>
% endif
</label><br />
${h.text('gpgfp', value=request.params.get('gpgfp', None))}<br />
</div>
<div id="usernamefield">
<label for="username">${_('Debian user name:')}
% if 'username' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['username']}</span>
% endif
</label><br />
${h.text('username',
value=request.params.get('username', None))}<br />
</div>
<div id="nonddemailfield">
<label for="nonddemail">${_('Non DD email address:')}
% if 'nonddemail' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['nonddemail']}</span>
% endif
</label><br />
${h.text('nonddemail',
value=request.params.get('nonddemail', None))}<br />
</div>
<div id="aliothusernamefield">
<label for="aliothusername">${_('Alioth user name:')}
% if 'aliothusername' in c.messages['errors']:
<br />
<span
class="errormsg">${c.messages['errors']['aliothusername']}</span>
% endif
</label><br />
${h.text('aliothusername',
value=request.params.get('username', None))}<br />
</div>
<div id="modefield">
<label for="mode_html">${_('Output format:')}
% if 'mode' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['mode']}</span>
% endif
</label><br />
${_('HTML')}&#160;${h.radio('mode', 'html',
checked=(request.params.get('mode',
'html') == 'html'))}&#160;${_('JSON')}&#160;${h.radio('mode',
'json', checked=(request.params.get('mode', 'html') == 'json'))}<br />
${h.submit('submit', value=_('Build DD Portfolio URLs'))}
</div>
</fieldset>
${h.end_form()}
</body>
</html>
<%def name="titleaddon()">
- ${_('Enter your personal information')}
</%def>
${h.form(h.url_for(action='urllist'), method='get')}
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<div id="emailfield">
<label for="email">${_('Email address:')}
% if 'email' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['email']}</span>
% endif
</label><br />
${h.text('email', request.params.get('email', None), id='email')}<br />
</div>
<div id="namefield">
<label for="name">${_('Name:')}
% if 'name' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['name']}</span>
% endif
</label><br />
${h.text('name', request.params.get('name', None), id='name')}<br />
</div>
<div id="gpgfpfield">
<label for="gpgfp">${_('GPG fingerprint:')}
% if 'gpgfp' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['gpgfp']}</span>
% endif
</label><br />
${h.text('gpgfp', request.params.get('gpgfp', None), id='gpgfp')}<br />
</div>
<div id="usernamefield">
<label for="username">${_('Debian user name:')}
% if 'username' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['username']}</span>
% endif
</label><br />
${h.text('username', request.params.get('username', None),
id='username')}<br />
</div>
<div id="nonddemailfield">
<label for="nonddemail">${_('Non DD email address:')}
% if 'nonddemail' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['nonddemail']}</span>
% endif
</label><br />
${h.text('nonddemail', request.params.get('nonddemail', None),
id='nonddemail')}<br />
</div>
<div id="aliothusernamefield">
<label for="aliothusername">${_('Alioth user name:')}
% if 'aliothusername' in c.messages['errors']:
<br />
<span
class="errormsg">${c.messages['errors']['aliothusername']}</span>
% endif
</label><br />
${h.text('aliothusername', request.params.get('username', None),
id='aliothusername')}<br />
</div>
<div id="modefield">
<label for="mode_html">${_('Output format:')}
% if 'mode' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['mode']}</span>
% endif
</label><br />
${_('HTML')}&#160;${h.radio('mode', 'html',
checked=(request.params.get('mode',
'html') == 'html'))}&#160;${_('JSON')}&#160;${h.radio('mode',
'json', checked=(request.params.get('mode', 'html') == 'json'))}<br />
${h.submit('submit', value=_('Build DD Portfolio URLs'))}
</div>
</fieldset>
${h.end_form()}

View file

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%inherit file="base.mako" />
<%doc>
Template for the url output page.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
@ -20,41 +19,43 @@ 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>
<html>
<head>
<title>${_('Debian Developer Portfolio')}</title>
${h.stylesheet_link('/stylesheets/style.css')}
</head>
<body>
% if c.urldata:
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<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.textile(row[4])}</td>
<td>${_('Error during URL creation')}<br />
<span class="errormsg">${row[3].replace("\n",
'<br />')}</span></td>
</tr>
% else:
<tr>
<td>${h.textile(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>
</body>
</html>
<%def name="titleaddon()">
- ${_('Your personal links')}
</%def>
% if c.urldata:
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<table id="urltable">
<thead>
<tr><th>${_('Usage')}</th><th>${_('URL')}</th></tr>
</thead>
<tbody>
% for row in c.urldata:
% if row[0] == 'section':
<tr class="section"><th class="sectionlabel" colspan="2">${row[2]}</th></tr>
<% urlclass = 'odd' %>
% elif row[0] == 'error':
<tr class="error">
<td>${h.textile(row[4])}</td>
<td>${_('Error during URL creation:')}
<span class="errormsg">${row[3].replace("\n",
'<br />')}</span></td>
</tr>
% else:
<tr class="url ${urlclass}">
<td>${h.textile(row[4])}</td>
<td>${h.link_to(h.truncate(row[3], length=120), row[3])}</td>
</tr>
<%
if urlclass == 'odd':
urlclass = 'even'
else:
urlclass = 'odd'
%>
% endif
% endfor
</tbody>
</table>
</fieldset>
% endif
<p>${h.link_to(_('Restart'), h.url_for(action='index'))}</p>