Esempio n. 1
0
 def getPrettyLink(self, item):
     pl = IPrettyLink(item)
     pl.display_tag_title = False
     if base_hasattr(pl.context, '_link_portal_type'):
         pl.additionalCSSClasses = ['contenttype-{}'.format(pl.context._link_portal_type)]
     else:
         pl.additionalCSSClasses = ['contenttype-{}'.format(pl.context.portal_type)]
     pl.contentValue = self.contentValue(item)
     return pl.getLink()
Esempio n. 2
0
 def adapted(self,
             showColors=False,
             display_tag_title=False,
             isViewable=True):
     plo = IPrettyLink(self.context)
     plo.showContentIcon = True
     plo.showColors = showColors
     plo.display_tag_title = display_tag_title
     plo.isViewable = isViewable
     plo.notViewableHelpMessage = ''
     return plo
Esempio n. 3
0
 def test_getLink_link_tooltip(self):
     """title attr is absent if display_tag_title is False."""
     pl = IPrettyLink(self.folder)
     self.assertEqual(
         pl.getLink(),
         u"<a class='pretty_link state-private' title='Folder' href='http://nohost/plone/folder' "
         u"target='_self'><span class='pretty_link_content'>Folder</span></a>")
     pl.display_tag_title = False
     self.assertEqual(
         pl.getLink(),
         u"<a class='pretty_link state-private' href='http://nohost/plone/folder' "
         u"target='_self'><span class='pretty_link_content'>Folder</span></a>")
Esempio n. 4
0
 def test_getLink_link_tooltip(self):
     """title attr is absent if display_tag_title is False."""
     pl = IPrettyLink(self.folder)
     self.assertEqual(
         pl.getLink(),
         u"<a class='pretty_link' title='Folder' href='http://nohost/plone/folder' "
         u"target='_self'><span class='pretty_link_content state-private'>Folder</span></a>"
     )
     pl.display_tag_title = False
     self.assertEqual(
         pl.getLink(),
         u"<a class='pretty_link' href='http://nohost/plone/folder' "
         u"target='_self'><span class='pretty_link_content state-private'>Folder</span></a>"
     )