drop content_title tls-sprint
authorsylvain.thenault@logilab.fr
Mon, 11 May 2009 11:01:40 +0200
branchtls-sprint
changeset 1720 14c9a0a1aca1
parent 1719 bf26f32c8a72
child 1721 694f6a50e138
child 1724 8a3c3ae8c809
child 1727 19e3cfc065c2
drop content_title
web/views/cwuser.py
web/views/primary.py
web/views/schema.py
--- a/web/views/cwuser.py	Mon May 11 09:57:02 2009 +0200
+++ b/web/views/cwuser.py	Mon May 11 11:01:40 2009 +0200
@@ -42,13 +42,6 @@
         return self.build_url('cwuser/%s'%login, vid='epropertiesform')
 
 
-class CWUserPrimaryView(primary.PrimaryView):
-    __select__ = implements('CWUser')
-
-    def content_title(self, entity):
-        return entity.name()
-
-
 class FoafView(EntityView):
     id = 'foaf'
     __select__ = implements('CWUser')
--- a/web/views/primary.py	Mon May 11 09:57:02 2009 +0200
+++ b/web/views/primary.py	Mon May 11 11:01:40 2009 +0200
@@ -133,16 +133,12 @@
         self.w(u'</div>')
 
     def render_entity_title(self, entity):
-        title = self.content_title(entity) # deprecate content_title?
+        """default implementation return dc_title"""
+        title = html_escape(entity.dc_title())
         if title:
             self.w(u'<h1><span class="etype">%s</span> %s</h1>'
                    % (entity.dc_type().capitalize(), title))
 
-
-    def content_title(self, entity):
-        """default implementation return dc_title"""
-        return html_escape(entity.dc_title())
-
     def render_entity_metadata(self, entity):
         entity.view('metadata', w=self.w)
         summary = self.summary(entity) # deprecate summary?
--- a/web/views/schema.py	Mon May 11 09:57:02 2009 +0200
+++ b/web/views/schema.py	Mon May 11 11:01:40 2009 +0200
@@ -57,8 +57,10 @@
     __select__ = implements('CWAttribute', 'CWRelation')
     cache_max_age = 60*60*2 # stay in http cache for 2 hours by default
 
-    def content_title(self, entity):
-        return html_escape(entity.dc_long_title())
+    def render_entity_title(self, entity):
+        self.w(u'<h1><span class="etype">%s</span> %s</h1>'
+               % (entity.dc_type().capitalize(),
+                  html_escape(entity.dc_long_title()))
 
 
 class CWETypeOneLineView(baseviews.OneLineView):