diff --git a/ddportfolioservice/lib/helpers.py b/ddportfolioservice/lib/helpers.py index cd99905..79d12f4 100644 --- a/ddportfolioservice/lib/helpers.py +++ b/ddportfolioservice/lib/helpers.py @@ -26,4 +26,7 @@ Consists of functions to typically be used within templates, but also available to Controllers. This module is available to both as 'h'. """ from webhelpers import * -from webhelpers.rails import * +from webhelpers.html.tags import * +from webhelpers.text import * +from webhelpers.textile import * +from routes.util import * diff --git a/ddportfolioservice/templates/showform.mako b/ddportfolioservice/templates/showform.mako index 14c6124..ddbf79e 100644 --- a/ddportfolioservice/templates/showform.mako +++ b/ddportfolioservice/templates/showform.mako @@ -23,10 +23,10 @@ License along with this program. If not, see <html> <head> <title>${_('Debian Developer Portfolio')}</title> - ${h.stylesheet_link_tag('style')} + ${h.stylesheet_link('/stylesheets/style.css')} </head> <body> - ${h.start_form(h.url_for(action='urllist'), method='get')} + ${h.form(h.url_for(action='urllist'), method='get')} <fieldset id="ddportfolio"> <legend>${_('Debian Developer Portfolio')}</legend> <div id="emailfield"> @@ -36,7 +36,7 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['email']}</span> % endif </label><br /> - ${h.text_field('email', value=request.params.get('email', None))}<br /> + ${h.text('email', value=request.params.get('email', None))}<br /> </div> <div id="namefield"> <label for="name">${_('Name:')} @@ -45,7 +45,7 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['name']}</span> % endif </label><br /> - ${h.text_field('name', value=request.params.get('name', None))}<br /> + ${h.text('name', value=request.params.get('name', None))}<br /> </div> <div id="gpgfpfield"> <label for="gpgfp">${_('GPG fingerprint:')} @@ -54,7 +54,7 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['gpgfp']}</span> % endif </label><br /> - ${h.text_field('gpgfp', value=request.params.get('gpgfp', None))}<br /> + ${h.text('gpgfp', value=request.params.get('gpgfp', None))}<br /> </div> <div id="usernamefield"> <label for="username">${_('Debian user name:')} @@ -63,7 +63,7 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['username']}</span> % endif </label><br /> - ${h.text_field('username', + ${h.text('username', value=request.params.get('username', None))}<br /> </div> <div id="nonddemailfield"> @@ -73,7 +73,7 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['nonddemail']}</span> % endif </label><br /> - ${h.text_field('nonddemail', + ${h.text('nonddemail', value=request.params.get('nonddemail', None))}<br /> </div> <div id="aliothusernamefield"> @@ -84,7 +84,7 @@ License along with this program. If not, see class="errormsg">${c.messages['errors']['aliothusername']}</span> % endif </label><br /> - ${h.text_field('aliothusername', + ${h.text('aliothusername', value=request.params.get('username', None))}<br /> </div> <div id="modefield"> @@ -94,11 +94,11 @@ License along with this program. If not, see <span class="errormsg">${c.messages['errors']['mode']}</span> % endif </label><br /> - ${_('HTML')} ${h.radio_button('mode', 'html', + ${_('HTML')} ${h.radio('mode', 'html', checked=(request.params.get('mode', - 'html') == 'html'))} ${_('JSON')} ${h.radio_button('mode', + 'html') == 'html'))} ${_('JSON')} ${h.radio('mode', 'json', checked=(request.params.get('mode', 'html') == 'json'))}<br /> - ${h.submit(value=_('Build DD Portfolio URLs'))} + ${h.submit('submit', value=_('Build DD Portfolio URLs'))} </div> </fieldset> ${h.end_form()} diff --git a/ddportfolioservice/templates/showurls.mako b/ddportfolioservice/templates/showurls.mako index 6c28f2d..b272043 100644 --- a/ddportfolioservice/templates/showurls.mako +++ b/ddportfolioservice/templates/showurls.mako @@ -23,7 +23,7 @@ License along with this program. If not, see <html> <head> <title>${_('Debian Developer Portfolio')}</title> - ${h.stylesheet_link_tag('style')} + ${h.stylesheet_link('/stylesheets/style.css')} </head> <body> % if c.urldata: @@ -39,14 +39,14 @@ License along with this program. If not, see <tr><th class="sectionlabel" colspan="2">${row[2]}</th></tr> % elif row[0] == 'error': <tr> - <td>${h.textilize(row[4])}</td> + <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.textilize(row[4])}</td> + <td>${h.textile(row[4])}</td> <td>${h.link_to(h.truncate(row[3], length=120), row[3])}</td> </tr> % endif