public NonEscapedString StateLabel(string stateName) { if (String.IsNullOrWhiteSpace(stateName)) { return(Raw($"<em>{HtmlEncode(Strings.Common_NoState)}</em>")); } var style = $"background-color: {JobHistoryRenderer.GetForegroundStateColor(stateName)};"; return(Raw($"<span class=\"label label-default\" style=\"{HtmlEncode(style)}\">{HtmlEncode(stateName)}</span>")); }
public NonEscapedString StateLabel(string stateName) { if (String.IsNullOrWhiteSpace(stateName)) { return(Raw("<em>No state</em>")); } return(Raw(String.Format( "<span class=\"label label-default\" style=\"background-color: {0};\">{1}</span>", JobHistoryRenderer.GetForegroundStateColor(stateName), stateName))); }
public NonEscapedString StateLabel(string stateName, string text, bool hover = false) { if (String.IsNullOrWhiteSpace(stateName)) { return(Raw($"<em>{HtmlEncode(Strings.Common_NoState)}</em>")); } var style = $"background-color: {JobHistoryRenderer.GetForegroundStateColor(stateName)};"; var cssSuffix = JobHistoryRenderer.GetStateCssSuffix(stateName); var cssHover = hover ? "label-hover" : null; if (cssSuffix != null) { return(Raw($"<span class=\"label label-default {cssHover} label-state-{HtmlEncode(cssSuffix)}\">{HtmlEncode(text)}</span>")); } return(Raw($"<span class=\"label label-default {cssHover}\" style=\"{HtmlEncode(style)}\">{HtmlEncode(text)}</span>")); }