src/pyams_content/component/extfile/__init__.py
changeset 384 d433c8c46ec9
parent 371 ceeb76aee369
child 571 b2e79295caec
--- a/src/pyams_content/component/extfile/__init__.py	Thu Feb 08 15:51:58 2018 +0100
+++ b/src/pyams_content/component/extfile/__init__.py	Thu Feb 08 17:21:30 2018 +0100
@@ -87,15 +87,19 @@
 
     @property
     def user_title(self):
+        title = II18n(self.context).query_attribute('title')
+        if not title:
+            title = self.context.filename
+        return title
+
+    @property
+    def user_icon(self):
         filename = self.context.filename
         if filename:
             name, ext = os.path.splitext(filename)
-            return '{title} <img class="margin-left-5 align-top" ' \
+            return '<img class="margin-left-5 align-top" ' \
                 'src="/--static--/pyams_skin/img/mimetypes/16x16/{thumb}" />'.format(
-                 title=II18n(self.context).query_attribute('title') or filename,
                  thumb=EXTENSIONS_THUMBNAILS.get(ext, 'unknown.png'))
-        else:
-            return '--'
 
     @property
     def inner_title(self):