Exemple #1
0
        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>"));
        }
Exemple #2
0
        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)));
        }
Exemple #3
0
        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>"));
        }