private string GetCssClass() { var isStateDone = WorkItemState.IsDone(State); var isStateCommit = WorkItemState.IsCommited(State); var isStateInProgress = WorkItemState.IsInProgress(State); var stateClass = isStateDone ? "card-outline-success" : (isStateCommit || isStateInProgress ? "card-outline-primary" : null); var cssClass = $"card work-iteration-item {stateClass}".Trim(); return(cssClass); }
public override void Process(TagHelperContext context, TagHelperOutput output) { var isStateDone = WorkItemState.IsDone(State); var isStateCommit = WorkItemState.IsCommited(State); var isStateInProgress = WorkItemState.IsInProgress(State); var stateClass = isStateDone ? "badge-success" : (isStateCommit || isStateInProgress ? "badge-primary" : "badge-default"); var htmlContent = $@" <small> <span class=""badge badge-pill circle {stateClass}""> </span> </small> <code>{State}</code>"; output.Content.SetHtmlContent(htmlContent); output.Attributes.RemoveAll(nameof(State)); }