From eb4341c0db88c3907c0226fc6c3cbcbccee67e88 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Thu, 22 Jan 2009 22:18:26 +0100 Subject: [PATCH] replace deprecated rails helper dependent code --- ddportfolioservice/lib/helpers.py | 5 ++++- ddportfolioservice/templates/showform.mako | 22 +++++++++++----------- ddportfolioservice/templates/showurls.mako | 6 +++--- 3 files changed, 18 insertions(+), 15 deletions(-) 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 ${_('Debian Developer Portfolio')} - ${h.stylesheet_link_tag('style')} + ${h.stylesheet_link('/stylesheets/style.css')} - ${h.start_form(h.url_for(action='urllist'), method='get')} + ${h.form(h.url_for(action='urllist'), method='get')}
${_('Debian Developer Portfolio')}
@@ -36,7 +36,7 @@ License along with this program. If not, see ${c.messages['errors']['email']} % endif
- ${h.text_field('email', value=request.params.get('email', None))}
+ ${h.text('email', value=request.params.get('email', None))}

- ${h.text_field('name', value=request.params.get('name', None))}
+ ${h.text('name', value=request.params.get('name', None))}

- ${h.text_field('gpgfp', value=request.params.get('gpgfp', None))}
+ ${h.text('gpgfp', value=request.params.get('gpgfp', None))}

- ${h.text_field('username', + ${h.text('username', value=request.params.get('username', None))}
@@ -73,7 +73,7 @@ License along with this program. If not, see ${c.messages['errors']['nonddemail']} % endif
- ${h.text_field('nonddemail', + ${h.text('nonddemail', value=request.params.get('nonddemail', None))}
@@ -84,7 +84,7 @@ License along with this program. If not, see class="errormsg">${c.messages['errors']['aliothusername']} % endif
- ${h.text_field('aliothusername', + ${h.text('aliothusername', value=request.params.get('username', None))}
@@ -94,11 +94,11 @@ License along with this program. If not, see ${c.messages['errors']['mode']} % endif
- ${_('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'))}
- ${h.submit(value=_('Build DD Portfolio URLs'))} + ${h.submit('submit', value=_('Build DD Portfolio URLs'))}
${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 ${_('Debian Developer Portfolio')} - ${h.stylesheet_link_tag('style')} + ${h.stylesheet_link('/stylesheets/style.css')} % if c.urldata: @@ -39,14 +39,14 @@ License along with this program. If not, see ${row[2]} % elif row[0] == 'error': - ${h.textilize(row[4])} + ${h.textile(row[4])} ${_('Error during URL creation')}
${row[3].replace("\n", '
')}
% else: - ${h.textilize(row[4])} + ${h.textile(row[4])} ${h.link_to(h.truncate(row[3], length=120), row[3])} % endif