public static HtmlString GetFullNameFirstLastAsUrl(this Person person, FirmaSession currentFirmaSession) { if (new UserViewFeature().HasPermission(currentFirmaSession, person).HasPermission) { return(UrlTemplate.MakeHrefString(person.GetDetailUrl(), person.GetFullNameFirstLast())); } return(new HtmlString(person.GetFullNameFirstLast())); }
/// <summary> /// Returns a HtmlString of the person's first and last name and their relationship to the provided project (if any) /// in a comma separated list inside parentheses /// /// e.g. "Stewart Gordon (Project Primary Contact, NTA Coordinator, NTA Manager)" if the person is multiple types of contacts on a project /// or "Stewart Gordon" if the person isn't any type of contact on the project /// </summary> /// <param name="person"></param> /// <param name="project"></param> /// <returns></returns> public static HtmlString GetPersonDisplayNameWithContactTypesListForProject(this Person person, Project project) { var personContactTypesList = person.GetListOfContactTypeStringsForProject(project); if (!personContactTypesList.Any()) { return(new HtmlString(person.GetFullNameFirstLast())); } return(new HtmlString($"{person.GetFullNameFirstLast()} <span class=\"small\">({string.Join(", ", personContactTypesList)})</span>")); }