Add email and phone display to communications workbench

This commit is contained in:
Eli Ribble 2026-04-27 16:23:31 +00:00
parent be8d92d7ae
commit ffe427564b
No known key found for this signature in database
2 changed files with 16 additions and 0 deletions

View file

@ -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)
}

View file

@ -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>