replace deprecated rails helper dependent code

This commit is contained in:
Jan Dittberner 2009-01-22 22:18:26 +01:00
parent 8f32ef46b1
commit eb4341c0db
3 changed files with 18 additions and 15 deletions

View File

@ -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 *

View File

@ -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')}&#160;${h.radio_button('mode', 'html',
${_('HTML')}&#160;${h.radio('mode', 'html',
checked=(request.params.get('mode',
'html') == 'html'))}&#160;${_('JSON')}&#160;${h.radio_button('mode',
'html') == 'html'))}&#160;${_('JSON')}&#160;${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()}

View File

@ -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