Add email and phone display to communications workbench
This commit is contained in:
parent
be8d92d7ae
commit
ffe427564b
2 changed files with 16 additions and 0 deletions
|
|
@ -22,6 +22,16 @@ func (c Contact) MarshalJSON() ([]byte, error) {
|
|||
to_marshal["name"] = c.Name
|
||||
to_marshal["has_email"] = (c.Email != nil && *c.Email != "")
|
||||
to_marshal["has_phone"] = (c.Phone != nil && *c.Phone != "")
|
||||
if c.Email != nil {
|
||||
to_marshal["email"] = *c.Email
|
||||
} else {
|
||||
to_marshal["email"] = ""
|
||||
}
|
||||
if c.Phone != nil {
|
||||
to_marshal["phone"] = *c.Phone
|
||||
} else {
|
||||
to_marshal["phone"] = ""
|
||||
}
|
||||
//log.Debug().Msg("marshaling contact")
|
||||
return json.Marshal(to_marshal)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,12 +58,18 @@
|
|||
class="form-label text-muted small mb-0"
|
||||
>
|
||||
<i class="bi bi-envelope"></i>
|
||||
<a :href="'mailto:' + report.reporter.email">{{
|
||||
report.reporter.email
|
||||
}}</a>
|
||||
</label>
|
||||
<label
|
||||
v-if="report.reporter.has_phone"
|
||||
class="form-label text-muted small mb-0"
|
||||
>
|
||||
<i class="bi bi-phone"></i>
|
||||
<a :href="'tel:+' + report.reporter.phone">{{
|
||||
report.reporter.phone
|
||||
}}</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue