upgrade mako templates, add explicit webhelpers

This commit is contained in:
Jan Dittberner 2010-04-17 12:48:31 +02:00
parent 716ca8d40a
commit 7cb0b383a3
8 changed files with 26 additions and 20 deletions

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# DDPortfolio service controllers package # DDPortfolio service controllers package
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> # Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
# #
# This file is part of DDPortfolio service. # This file is part of DDPortfolio service.
# #

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# DDPortfolio service DdportfolioController # DDPortfolio service DdportfolioController
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> # Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
# #
# This file is part of DDPortfolio service. # This file is part of DDPortfolio service.
# #
@ -23,9 +23,11 @@
import logging import logging
import simplejson import simplejson
from ddportfolioservice.lib.base import * from pylons.i18n import N_
from ddportfolioservice.model.form import *
from ddportfolioservice.model.urlbuilder import * from ddportfolioservice.lib.base import BaseController, render
from ddportfolioservice.model.form import DDDataRequest, DeveloperData
from ddportfolioservice.model.urlbuilder import build_urls
from ddportfolioservice.model import dddatabuilder from ddportfolioservice.model import dddatabuilder
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# DDPortfolio service ShowformscriptController. # DDPortfolio service ShowformscriptController.
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> # Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
# #
# This file is part of DDPortfolio service. # This file is part of DDPortfolio service.
# #
@ -23,8 +23,8 @@
import logging import logging
import simplejson import simplejson
from ddportfolioservice.lib.base import * from ddportfolioservice.lib.base import BaseController
from ddportfolioservice.model.form import * from ddportfolioservice.model.form import DDDataRequest
from ddportfolioservice.model import dddatabuilder from ddportfolioservice.model import dddatabuilder
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# DDPortfolio service TemplateController # DDPortfolio service TemplateController
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> # Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
# #
# This file is part of DDPortfolio service. # This file is part of DDPortfolio service.
# #
@ -20,7 +20,7 @@
# License along with this program. If not, see # License along with this program. If not, see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# #
from ddportfolioservice.lib.base import * from ddportfolioservice.lib.base import BaseController
class TemplateController(BaseController): class TemplateController(BaseController):

View file

@ -25,4 +25,7 @@
Consists of functions to typically be used within templates, but also Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'. available to Controllers. This module is available to templates as 'h'.
""" """
from webhelpers.html.builder import escape from webhelpers.html.builder import escape, literal
from webhelpers.html.tags import stylesheet_link, javascript_link, image, \
form, text, radio, submit, end_form
from routes import url_for

View file

@ -19,7 +19,7 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# #
[DEFAULT] [DEFAULT]
keyring.dir=/home/www/usr01/debian/keyring.debian.org/keyrings keyring.dir=${HOME}/debian/keyring.debian.org/keyrings
urlbuilder.sections=overview,bugs,build,qa,upload,lists,files,membership, urlbuilder.sections=overview,bugs,build,qa,upload,lists,files,membership,
miscellaneous miscellaneous

View file

@ -1,8 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
## -- coding: utf-8 --
<%doc> <%doc>
Base template for XHTML templates. Base template for XHTML templates.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
This file is part of DDPortfolio service. This file is part of DDPortfolio service.
@ -31,7 +32,7 @@ License along with this program. If not, see
${h.image(h.url_for('/images/openlogo-100.jpg'), _('Debian Logo'), 100, 100, ${h.image(h.url_for('/images/openlogo-100.jpg'), _('Debian Logo'), 100, 100,
id='debianlogo')} id='debianlogo')}
<h1>${_('Debian Developer Portfolio Service')}</h1> <h1>${_('Debian Developer Portfolio Service')}</h1>
<p>${_('''This service has been inspired by Stefano Zacchiroli'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> <p>${h.literal(_('''This service has been inspired by Stefano Zacchiroli'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>
<div id="content"> <div id="content">
${self.body()} ${self.body()}
@ -39,8 +40,8 @@ License along with this program. If not, see
<div id="footer"> <div id="footer">
${h.image(h.url_for('/images/agplv3-88x31.png'), _('AGPL - Free Software'), 88, 31, ${h.image(h.url_for('/images/agplv3-88x31.png'), _('AGPL - Free Software'), 88, 31,
id='agpllogo')} 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="%s">download the source code</a> using <a href="http://git.or.cz">git</a>.''') % ('http://ddportfolio.debian.net/gitweb?p?ddportfolioservice.git;a=summary')}</p> <p>${h.literal(_('''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="%s">download the source code</a> using <a href="http://git-scm.com/">git</a>.''') % ('http://ddportfolio.debian.net/gitweb?p?ddportfolioservice.git;a=summary'))}</p>
<p>${_('''Copyright &copy; 2009 Jan Dittberner''')}</p> <p>${_(u'''Copyright © 2009, 2010 Jan Dittberner''')}</p>
</div> </div>
</body> </body>
</html> </html>

View file

@ -1,7 +1,8 @@
<%inherit file="base.mako" /> <%inherit file="base.mako" />
## -- coding: utf-8 --
<%doc> <%doc>
Template for the data input form. Template for the data input form.
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info> Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
This file is part of DDPortfolio service. This file is part of DDPortfolio service.
@ -23,9 +24,8 @@ License along with this program. If not, see
- ${_('Enter your personal information')} - ${_('Enter your personal information')}
</%def> </%def>
<%def name="extrahead()">${h.javascript_link('/javascript/jquery/jquery.js', <%def name="extrahead()">${h.javascript_link('/javascript/jquery/jquery.js',
h.url_for(controller='showformscripts', h.url_for(controller='showformscripts', action='index'))}</%def>
action='index'))}</%def> ${h.form(h.url_for(action='urllist', controller='ddportfolio'), method='get')}
${h.form(h.url_for(action='urllist'), method='get')}
<fieldset id="ddportfolio"> <fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend> <legend>${_('Debian Developer Portfolio')}</legend>
<div id="emailfield" \ <div id="emailfield" \