[primary view] display entity source in 'metadata' view if it's not the system source stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 29 Apr 2011 12:12:14 +0200
branchstable
changeset 7290 f2051e08cbff
parent 7289 f91e8e25510c
child 7291 1e28fac16834
[primary view] display entity source in 'metadata' view if it's not the system source
web/views/baseviews.py
--- a/web/views/baseviews.py	Fri Apr 29 12:07:59 2011 +0200
+++ b/web/views/baseviews.py	Fri Apr 29 12:12:14 2011 +0200
@@ -201,8 +201,15 @@
             self.w(u'<span class="value">%s</span>'
                    % self._cw.format_date(entity.creation_date))
         if entity.creator:
-            self.w(u' <span>%s</span> ' % _('by'))
+            if entity.creation_date:
+                self.w(u' <span>%s</span> ' % _('by'))
+            else:
+                self.w(u' <span>%s</span> ' % _('created by'))
             self.w(u'<span class="value">%s</span>' % entity.creator.name())
+        meta = entity.cw_metainformation()
+        if meta['source']['uri'] != 'system':
+            self.w(u' (<span>%s</span>' % _('from source'))
+            self.w(u' <span class="value">%s</span>)' % meta['source']['uri'])
         self.w(u'</div>')