src/pyams_content/component/links/__init__.py
changeset 1258 49da29eef086
parent 1248 2419d4bad22b
child 1351 045be80a5645
equal deleted inserted replaced
1257:6027118fcde9 1258:49da29eef086
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
       
    12 
       
    13 __docformat__ = 'restructuredtext'
       
    14 
       
    15 from html import escape
       
    16 
    12 from pyramid.encode import url_quote
    17 from pyramid.encode import url_quote
    13 
       
    14 
       
    15 __docformat__ = 'restructuredtext'
       
    16 
       
    17 from zope.interface import implementer
    18 from zope.interface import implementer
    18 from zope.schema.fieldproperty import FieldProperty
    19 from zope.schema.fieldproperty import FieldProperty
    19 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
    20 from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
    20 
    21 
    21 from pyams_content import _
    22 from pyams_content import _
   291             title = self.context.address_name
   292             title = self.context.address_name
   292         return title or '--'
   293         return title or '--'
   293 
   294 
   294     @property
   295     @property
   295     def inner_title(self):
   296     def inner_title(self):
   296         return self.context.get_url()
   297         if self.context.address_name:
       
   298             return escape('{} <{}>'.format(self.context.address_name, self.context.address))
       
   299         else:
       
   300             return self.context.address
   297 
   301 
   298     @property
   302     @property
   299     def human_size(self):
   303     def human_size(self):
   300         return '--'
   304         return '--'
   301 
   305