web/views/emailaddress.py
changeset 2789 39712da6f397
parent 2312 af4d8f75c5db
child 3023 7864fee8b4ec
equal deleted inserted replaced
2788:8d3dbe577d3a 2789:39712da6f397
    74 
    74 
    75 class EmailAddressOneLineView(baseviews.OneLineView):
    75 class EmailAddressOneLineView(baseviews.OneLineView):
    76     __select__ = implements('EmailAddress')
    76     __select__ = implements('EmailAddress')
    77 
    77 
    78     def cell_call(self, row, col, **kwargs):
    78     def cell_call(self, row, col, **kwargs):
    79         entity = self.entity(row, col)
    79         entity = self.rset.get_entity(row, col)
    80         if entity.reverse_primary_email:
    80         if entity.reverse_primary_email:
    81             self.w(u'<b>')
    81             self.w(u'<b>')
    82         if entity.alias:
    82         if entity.alias:
    83             self.w(u'%s &lt;' % xml_escape(entity.alias))
    83             self.w(u'%s &lt;' % xml_escape(entity.alias))
    84         self.w('<a href="%s">%s</a>' % (xml_escape(entity.absolute_url()),
    84         self.w('<a href="%s">%s</a>' % (xml_escape(entity.absolute_url()),
    94 
    94 
    95     id = 'mailto'
    95     id = 'mailto'
    96     __select__ = implements('EmailAddress')
    96     __select__ = implements('EmailAddress')
    97 
    97 
    98     def cell_call(self, row, col, **kwargs):
    98     def cell_call(self, row, col, **kwargs):
    99         entity = self.entity(row, col)
    99         entity = self.rset.get_entity(row, col)
   100         if entity.reverse_primary_email:
   100         if entity.reverse_primary_email:
   101             self.w(u'<b>')
   101             self.w(u'<b>')
   102         if entity.alias:
   102         if entity.alias:
   103             alias = entity.alias
   103             alias = entity.alias
   104         elif entity.reverse_use_email:
   104         elif entity.reverse_use_email:
   117 
   117 
   118 class EmailAddressTextView(baseviews.TextView):
   118 class EmailAddressTextView(baseviews.TextView):
   119     __select__ = implements('EmailAddress')
   119     __select__ = implements('EmailAddress')
   120 
   120 
   121     def cell_call(self, row, col, **kwargs):
   121     def cell_call(self, row, col, **kwargs):
   122         self.w(self.entity(row, col).display_address())
   122         self.w(self.rset.get_entity(row, col).display_address())