web/views/emailaddress.py
changeset 3230 1d25e928c299
parent 3023 7864fee8b4ec
parent 3220 11b6016e3970
child 3377 dd9d292b6a6d
equal deleted inserted replaced
3199:fc63b80ec979 3230:1d25e928c299
    22         super(EmailAddressPrimaryView, self).cell_call(row, col)
    22         super(EmailAddressPrimaryView, self).cell_call(row, col)
    23 
    23 
    24     def render_entity_attributes(self, entity):
    24     def render_entity_attributes(self, entity):
    25         self.w(u'<h3>')
    25         self.w(u'<h3>')
    26         entity.view('oneline', w=self.w)
    26         entity.view('oneline', w=self.w)
    27         if not entity.canonical:
    27         if entity.prefered:
    28             canonemailaddr = entity.canonical_form()
    28             self.w(u'&#160;(<i>%s</i>)' % entity.prefered.view('oneline'))
    29             if canonemailaddr:
    29         self.w(u'</h3>')
    30                 self.w(u'&#160;(<i>%s</i>)' % canonemailaddr.view('oneline'))
       
    31             self.w(u'</h3>')
       
    32         elif entity.identical_to:
       
    33             self.w(u'</h3>')
       
    34             identicaladdr = [e.view('oneline') for e in entity.identical_to]
       
    35             self.field('identical_to', ', '.join(identicaladdr))
       
    36         else:
       
    37             self.w(u'</h3>')
       
    38         try:
    30         try:
    39             persons = entity.reverse_primary_email
    31             persons = entity.reverse_primary_email
    40         except Unauthorized:
    32         except Unauthorized:
    41             persons = []
    33             persons = []
    42         if persons:
    34         if persons:
    86         if entity.alias:
    78         if entity.alias:
    87             self.w(u'&gt;\n')
    79             self.w(u'&gt;\n')
    88         if entity.reverse_primary_email:
    80         if entity.reverse_primary_email:
    89             self.w(u'</b>')
    81             self.w(u'</b>')
    90 
    82 
       
    83 
    91 class EmailAddressMailToView(baseviews.OneLineView):
    84 class EmailAddressMailToView(baseviews.OneLineView):
    92     """A one line view that builds a user clickable URL for an email with
    85     """A one line view that builds a user clickable URL for an email with
    93     'mailto:'"""
    86     'mailto:'"""
    94 
    87 
    95     id = 'mailto'
    88     id = 'mailto'