private static HtmlBuilder DetailsHeader(
     this HtmlBuilder hb,
     Context context,
     BurnDown burnDown,
     IEnumerable <int> updators,
     string ownerLabelText,
     Column column)
 {
     return(hb.Tr(css: "ui-widget-header", action: () =>
     {
         hb
         .Th(action: () => hb
             .Text(text: Displays.Date(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.PlannedValue(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.EarnedValue(context: context)))
         .Th(action: () => hb
             .Text(text: Displays.Difference(context: context)))
         .Th(action: () => hb
             .Text(text: ownerLabelText + " " + Displays.Total(context: context)));
         updators.ForEach(updatorId => hb
                          .Th(action: () => hb
                              .Text(text: SiteInfo.User(
                                        context: context,
                                        userId: updatorId).Name +
                                    " ({0})".Params(column.Display(
                                                        context: context,
                                                        value: burnDown
                                                        .Where(p => p.Updator == updatorId)
                                                        .Select(p => p.EarnedValueAdditions)
                                                        .Sum()) + column.Unit))));
     }));
 }
Example #2
0
        private static HtmlBuilder DetailsBody(
            this HtmlBuilder hb,
            IContext context,
            SiteSettings ss,
            BurnDown burnDown,
            IEnumerable <int> updators,
            Column column)
        {
            var colspan        = updators.Count() + 1;
            var minTime        = burnDown.MinTime;
            var updatedMaxTime = burnDown.LatestUpdatedTime;
            var count          = Times.DateDiff(Times.Types.Days, minTime, updatedMaxTime);
            var first          = true;

            return(hb.TBody(action: () =>
            {
                for (var d = count; d >= 0; d--)
                {
                    var currentTime = minTime.AddDays(d);
                    if (burnDown.Any(o =>
                                     o.UpdatedTime == currentTime &&
                                     o.EarnedValueAdditions != 0))
                    {
                        hb.DetailsRow(
                            context: context,
                            burnDown: burnDown,
                            updators: updators,
                            currentTime: currentTime,
                            column: column);
                        if (first)
                        {
                            hb.BurnDownRecordDetails(
                                context: context,
                                elements: burnDown.Where(o => o.UpdatedTime == currentTime),
                                progressRateColumn: ss.GetColumn(
                                    context: context, columnName: "ProgressRate"),
                                statusColumn: ss.GetColumn(
                                    context: context, columnName: "Status"),
                                colspan: updators.Count() + 5,
                                unit: column.Unit);
                            first = false;
                        }
                    }
                }
            }));
        }