From 39fb201f84b99cb2558b5c4504fa3f856b449684 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 18 Apr 2010 21:14:04 +0200 Subject: [PATCH] upgrade result page to Pylons 0.10 --- ddportfolioservice/controllers/ddportfolio.py | 5 ++++- ddportfolioservice/lib/helpers.py | 4 +++- ddportfolioservice/templates/showurls.mako | 13 +++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ddportfolioservice/controllers/ddportfolio.py b/ddportfolioservice/controllers/ddportfolio.py index 7dbb258..5f56baa 100644 --- a/ddportfolioservice/controllers/ddportfolio.py +++ b/ddportfolioservice/controllers/ddportfolio.py @@ -23,7 +23,10 @@ import logging import simplejson -from pylons.i18n import N_ +from pylons import request, tmpl_context as c +from pylons.i18n import N_, _ +import formencode.api +import formencode.validators from ddportfolioservice.lib.base import BaseController, render from ddportfolioservice.model.form import DDDataRequest, DeveloperData diff --git a/ddportfolioservice/lib/helpers.py b/ddportfolioservice/lib/helpers.py index 8c174df..57e9d64 100644 --- a/ddportfolioservice/lib/helpers.py +++ b/ddportfolioservice/lib/helpers.py @@ -27,5 +27,7 @@ available to Controllers. This module is available to templates as 'h'. """ from webhelpers.html.builder import escape, literal from webhelpers.html.tags import stylesheet_link, javascript_link, image, \ - form, text, radio, submit, end_form + form, text, radio, submit, end_form, link_to +from webhelpers.text import truncate +from webhelpers.textile import textile from routes import url_for diff --git a/ddportfolioservice/templates/showurls.mako b/ddportfolioservice/templates/showurls.mako index 29f7f3a..deca858 100644 --- a/ddportfolioservice/templates/showurls.mako +++ b/ddportfolioservice/templates/showurls.mako @@ -1,7 +1,8 @@ -<%inherit file="base.mako" /> +## -*- coding: utf-8 -*- +<%inherit file="base.mako" />\ <%doc> Template for the url output page. -Copyright (c) 2009 Jan Dittberner +Copyright © 2009, 2010 Jan Dittberner This file is part of DDPortfolio service. @@ -18,7 +19,7 @@ Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - +\ <%def name="titleaddon()"> - ${_('Your personal links')} @@ -36,14 +37,14 @@ License along with this program. If not, see <% urlclass = 'odd' %> % elif row[0] == 'error': - ${h.textile(row[4])} + ${h.literal(h.textile(row[4]))} ${_('Error during URL creation:')} ${row[3].replace("\n", '
')}
% else: - ${h.textile(row[4])} + ${h.literal(h.textile(row[4]))} ${h.link_to(h.truncate(row[3], length=120), row[3])} <% @@ -58,4 +59,4 @@ License along with this program. If not, see % endif -

${h.link_to(_('Restart'), h.url_for(action='index'))}

+

${h.link_to(_('Restart'), h.url_for(controller='ddportfolio', action='index'))}