3e57af394d
custom details (such as those from the UserDetails plugin) can now be more deeply integrated throughtout the system
23 lines
626 B
Plaintext
23 lines
626 B
Plaintext
@model System.Collections.Generic.KeyValuePair<string, string>
|
|
@using System.Text.RegularExpressions
|
|
@{
|
|
var emailMatch = Regex.Match(Model.Value, @"^(?<name>.+)\s?<(?<address>.+@.+)>$");
|
|
if (!emailMatch.Success)
|
|
{
|
|
emailMatch = Regex.Match(Model.Value, @"^(?<address>.+@.+)$");
|
|
}
|
|
}
|
|
@if (emailMatch.Success)
|
|
{
|
|
var emailAddress = emailMatch.Groups["address"].Value;
|
|
var emailName = emailAddress;
|
|
if (emailMatch.Groups["name"].Success)
|
|
{
|
|
emailName = emailMatch.Groups["name"].Value;
|
|
}
|
|
<a href="mailto:@emailAddress">@emailName</a>
|
|
}
|
|
else
|
|
{
|
|
<span>@Model.Value</span>
|
|
} |