def html_full_contact(self):
parts = []
if self.contact_name and self.contact_email:
parts.append(format_html(
'{name} <<a href="mailto:{email}">{email}</a>>',
name=self.contact_name,
email=self.contact_email
))
elif self.contact_name:
parts.append(self.contact_name)
elif self.contact_email:
parts.append(format_html('<a href="mailto:{email}">{email}</a>', email=self.contact_email))
if self.contact_phone and not self.contact_hide_phone:
parts.append(self.contact_phone)
if parts:
return format_html_join(mark_safe(" — "), '{}', ((part,) for part in parts))
else:
return format_html("<em>{}</em>", _("Pas d'informations de contact"))
评论列表
文章目录