# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1241047190 -7200 # Node ID b64a0fe1fc865016cab8106f564467e6c2b8837a # Parent 86f9baff9dd6d1d8f49505ca6e7cf28dea6e04e7 cleanup diff -r 86f9baff9dd6 -r b64a0fe1fc86 web/views/schema.py --- a/web/views/schema.py Thu Apr 30 01:19:34 2009 +0200 +++ b/web/views/schema.py Thu Apr 30 01:19:50 2009 +0200 @@ -14,7 +14,7 @@ from cubicweb.selectors import implements, yes from cubicweb.schemaviewer import SchemaViewer from cubicweb.view import EntityView, StartupView -from cubicweb.common.uilib import ureport_as_html +from cubicweb.common import tags, uilib from cubicweb.web import uicfg, action from cubicweb.web.views import TmpFileViewMixin, primary, baseviews @@ -85,16 +85,16 @@ main_related_section = False skip_rels = SKIPPED_RELS - def render_entity_attributes(self, entity, siderelations): - super(CWETypeSchemaView, self).render_entity_attributes(entity, siderelations) + def render_entity_attributes(self, entity): + super(CWETypeSchemaView, self).render_entity_attributes(entity) eschema = self.vreg.schema.eschema(entity.name) viewer = SchemaViewer(self.req) layout = viewer.visit_entityschema(eschema, skiprels=self.skip_rels) - self.w(ureport_as_html(layout)) + self.w(uilib.ureport_as_html(layout)) if not eschema.is_final(): - self.w(u'%s' % ( - html_escape(entity.absolute_url(vid='eschemagraph')), - html_escape(self.req._('graphical schema for %s') % entity.name))) + msg = self.req._('graphical schema for %s') % entity.name + self.w(tags.img(src=entity.absolute_url(vid='eschemagraph'), + alt=msg)) class CWRTypeSchemaView(primary.PrimaryView): @@ -103,16 +103,16 @@ title = _('in memory relation schema') main_related_section = False - def render_entity_attributes(self, entity, siderelations): - super(CWRTypeSchemaView, self).render_entity_attributes(entity, siderelations) + def render_entity_attributes(self, entity): + super(CWRTypeSchemaView, self).render_entity_attributes(entity) rschema = self.vreg.schema.rschema(entity.name) viewer = SchemaViewer(self.req) layout = viewer.visit_relationschema(rschema) - self.w(ureport_as_html(layout)) + self.w(uilib.ureport_as_html(layout)) if not rschema.is_final(): - self.w(u'%s' % ( - html_escape(entity.absolute_url(vid='eschemagraph')), - html_escape(self.req._('graphical schema for %s') % entity.name))) + msg = self.req._('graphical schema for %s') % entity.name + self.w(tags.img(src=entity.absolute_url(vid='eschemagraph'), + alt=msg)) # schema images ###############################################################