Commit 313afda4 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[view] change html_escape into xml_escape

parent 6180597cd064
......@@ -45,6 +45,6 @@ def install(**kwargs):
url=web,
data_files=data_files,
**kwargs)
if __name__ == '__main__' :
install()
......@@ -6,7 +6,7 @@
"""
__docformat__ = "restructuredtext en"
from logilab.mtconverter import html_escape
from logilab.mtconverter import xml_escape
from cubicweb.selectors import implements, rql_condition
from cubicweb.web import uicfg, action
......@@ -23,9 +23,13 @@ uicfg.autoform_is_inlined.tag_subject_of(('Person', 'phone', '*'), True)
class PersonPrimaryView(primary.PrimaryView):
__select__ = implements('Person')
def render_entity_title(self, entity):
title = xml_escape(entity.dc_title())
self.w(u'<h1>%s</h1>' % entity.name(civility=True))
def render_entity_attributes(self, entity):
if getattr(entity, 'phone', None):
self.field('phone', ', '.join(html_escape(e.view('text'))
self.field('phone', ', '.join(xml_escape(e.view('text'))
for e in entity.phone))
if entity.use_email:
self.field('use_email',
......@@ -42,9 +46,9 @@ class PersonSecondaryView(baseviews.SecondaryView):
def cell_call(self, row, col):
entity = self.complete_entity(row, col)
self.w(u'&nbsp;')
name = html_escape(entity.name())
name = xml_escape(entity.name())
self.w(u'<a href="%s">%s</a><br/>%s' % (
html_escape(entity.absolute_url()), name,
xml_escape(entity.absolute_url()), name,
entity.printable_value('description')))
......@@ -66,7 +70,7 @@ class PersonEmailView(baseviews.EntityView):
entity = self.entity(row, col)
self.w(u'<h3>')
self.w(self.req._('emails sent or received by %s')
% html_escape(entity.dc_title()))
% xml_escape(entity.dc_title()))
self.w(u'</h3>')
done = set()
if getattr(entity, 'primary_email', None):
......@@ -81,8 +85,6 @@ class PersonEmailView(baseviews.EntityView):
email.view('shortprimary', w=self.w, skipeids=done)
class VCardPersonView(vcard.VCardCWUserView):
"""export a person information as a vcard"""
__select__ = implements('Person')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment