diff --git a/browser/common.py b/browser/common.py index 42b1a35..62c5491 100644 --- a/browser/common.py +++ b/browser/common.py @@ -44,6 +44,7 @@ from zope.traversing.api import getName from cybertools.browser.view import GenericView from cybertools.relation.interfaces import IRelationRegistry +from cybertools.text import mimetypes from cybertools.typology.interfaces import IType, ITypeManager from loops.interfaces import IView from loops.resource import Resource @@ -173,6 +174,17 @@ class BaseView(GenericView): def typeTitle(self): return self.type.title + @Lazy + def longTypeTitle(self): + t = self.typeTitle + ct = getattr(self.context, 'contentType') + if ct: + ext = mimetypes.extensions.get(ct) + if ext: + #return '%s (%s)' % (t, ext.upper()) + return ext.upper() + return t + @Lazy def typeUrl(self): provider = self.typeProvider diff --git a/browser/concept_macros.pt b/browser/concept_macros.pt index c5bfe9b..b238c4c 100644 --- a/browser/concept_macros.pt +++ b/browser/concept_macros.pt @@ -91,22 +91,23 @@ Modification Date - + + tal:attributes="href string:${view/url}/.target${related/uniqueId}; + title description"> Resource Title - Type + Type Type Type - describing... diff --git a/browser/configure.zcml b/browser/configure.zcml index 9eb76f0..08b6042 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -249,6 +249,13 @@ class=".resource.ResourceView" attribute="show" /> + + + + Title

Description

+ + Download + Download diff --git a/search/search.pt b/search/search.pt index 3449f7e..1c94d98 100644 --- a/search/search.pt +++ b/search/search.pt @@ -56,20 +56,21 @@ - + - - Type + Type Size modified - describing...