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'. available to Controllers. This module is available to both as 'h'.
""" """
from webhelpers import * 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> <html>
<head> <head>
<title>${_('Debian Developer Portfolio')}</title> <title>${_('Debian Developer Portfolio')}</title>
${h.stylesheet_link_tag('style')} ${h.stylesheet_link('/stylesheets/style.css')}
</head> </head>
<body> <body>
${h.start_form(h.url_for(action='urllist'), 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">
@ -36,7 +36,7 @@ License along with this program. If not, see
<span class="errormsg">${c.messages['errors']['email']}</span> <span class="errormsg">${c.messages['errors']['email']}</span>
% endif % endif
</label><br /> </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>
<div id="namefield"> <div id="namefield">
<label for="name">${_('Name:')} <label for="name">${_('Name:')}
@ -45,7 +45,7 @@ License along with this program. If not, see
<span class="errormsg">${c.messages['errors']['name']}</span> <span class="errormsg">${c.messages['errors']['name']}</span>
% endif % endif
</label><br /> </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>
<div id="gpgfpfield"> <div id="gpgfpfield">
<label for="gpgfp">${_('GPG fingerprint:')} <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> <span class="errormsg">${c.messages['errors']['gpgfp']}</span>
% endif % endif
</label><br /> </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>
<div id="usernamefield"> <div id="usernamefield">
<label for="username">${_('Debian user name:')} <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> <span class="errormsg">${c.messages['errors']['username']}</span>
% endif % endif
</label><br /> </label><br />
${h.text_field('username', ${h.text('username',
value=request.params.get('username', None))}<br /> value=request.params.get('username', None))}<br />
</div> </div>
<div id="nonddemailfield"> <div id="nonddemailfield">
@ -73,7 +73,7 @@ License along with this program. If not, see
<span class="errormsg">${c.messages['errors']['nonddemail']}</span> <span class="errormsg">${c.messages['errors']['nonddemail']}</span>
% endif % endif
</label><br /> </label><br />
${h.text_field('nonddemail', ${h.text('nonddemail',
value=request.params.get('nonddemail', None))}<br /> value=request.params.get('nonddemail', None))}<br />
</div> </div>
<div id="aliothusernamefield"> <div id="aliothusernamefield">
@ -84,7 +84,7 @@ License along with this program. If not, see
class="errormsg">${c.messages['errors']['aliothusername']}</span> class="errormsg">${c.messages['errors']['aliothusername']}</span>
% endif % endif
</label><br /> </label><br />
${h.text_field('aliothusername', ${h.text('aliothusername',
value=request.params.get('username', None))}<br /> value=request.params.get('username', None))}<br />
</div> </div>
<div id="modefield"> <div id="modefield">
@ -94,11 +94,11 @@ License along with this program. If not, see
<span class="errormsg">${c.messages['errors']['mode']}</span> <span class="errormsg">${c.messages['errors']['mode']}</span>
% endif % endif
</label><br /> </label><br />
${_('HTML')}&#160;${h.radio_button('mode', 'html', ${_('HTML')}&#160;${h.radio('mode', 'html',
checked=(request.params.get('mode', 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 /> '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> </div>
</fieldset> </fieldset>
${h.end_form()} ${h.end_form()}

View File

@ -23,7 +23,7 @@ License along with this program. If not, see
<html> <html>
<head> <head>
<title>${_('Debian Developer Portfolio')}</title> <title>${_('Debian Developer Portfolio')}</title>
${h.stylesheet_link_tag('style')} ${h.stylesheet_link('/stylesheets/style.css')}
</head> </head>
<body> <body>
% if c.urldata: % 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> <tr><th class="sectionlabel" colspan="2">${row[2]}</th></tr>
% elif row[0] == 'error': % elif row[0] == 'error':
<tr> <tr>
<td>${h.textilize(row[4])}</td> <td>${h.textile(row[4])}</td>
<td>${_('Error during URL creation')}<br /> <td>${_('Error during URL creation')}<br />
<span class="errormsg">${row[3].replace("\n", <span class="errormsg">${row[3].replace("\n",
'<br />')}</span></td> '<br />')}</span></td>
</tr> </tr>
% else: % else:
<tr> <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> <td>${h.link_to(h.truncate(row[3], length=120), row[3])}</td>
</tr> </tr>
% endif % endif