public ListEntry GetBadCardEntry(BoardStatsAnalysis boardStatsAnalysis)
 {
     var errorRow = new ListEntry();
     errorRow.Elements.Add(new ListEntry.Custom() { LocalName = "startdate", Value = boardStatsAnalysis.FirstStartDate.ToString() });
     errorRow.Elements.Add(new ListEntry.Custom() { LocalName = "enddate", Value = "" });
     errorRow.Elements.Add(new ListEntry.Custom() { LocalName = "headline", Value = "Unproccessed Trello Cards" });
     errorRow.Elements.Add(new ListEntry.Custom() { LocalName = "text", Value = GetSummaryTextForErrorCards(boardStatsAnalysis) });
     return errorRow;
 }
Exemplo n.º 2
0
        internal string GetWeeklyStatsRows(BoardStatsAnalysis boardStatsAnalysis)
        {
            var weekStatsHeader = GetWeekStatsHtmlHeader();

            var weekStatsList = boardStatsAnalysis.WeekStats;
            var weekRows = new StringBuilder();
            weekStatsList.OrderByDescending(ws=>ws.WeekNumber).ToList().ForEach(w => weekRows.Append(GetWeekStatsHtmlRow(w, boardStatsAnalysis)));

            return weekStatsHeader + weekRows;
        }
 public ListEntry GetTitleCardEntry(BoardStatsAnalysis boardStatsAnalysis)
 {
     var titleRow = new ListEntry();
     titleRow.Elements.Add(new ListEntry.Custom() { LocalName = "startdate", Value = boardStatsAnalysis.FirstStartDate.ToString() });
     titleRow.Elements.Add(new ListEntry.Custom() { LocalName = "enddate", Value = "" });
     titleRow.Elements.Add(new ListEntry.Custom() { LocalName = "headline", Value = "Development Timeline" });
     titleRow.Elements.Add(new ListEntry.Custom() { LocalName = "text", Value = _htmlFactory.GetSummaryTextForBoardStat(boardStatsAnalysis) });
     titleRow.Elements.Add(new ListEntry.Custom() { LocalName = "type", Value = "title" });
     return titleRow;
 }
Exemplo n.º 4
0
 private string GetExtraListsStatsTableHtml(BoardStatsAnalysis boardStatsAnalysis)
 {
     var row = new StringBuilder(@"<table id=""list_stats"" class=""table-condensed table-bordered table-striped"">");
     row.AppendLine("<thead><th>List</th><th>Cards</th><th>Points</th></thead>");
     row.AppendLine("<tbody>");
     foreach (var listStat in boardStatsAnalysis.BoardStats.ListStats)
     {
         var pointsForList = listStat.ListData.CardDataCollection.Sum(c => c.Points);
         row.AppendLine(string.Format(@"<tr><th>{0}</th><td class=""text-center"">{1}</td><td class=""text-center"">{2}</td></tr>", listStat.ListData.List.Name, listStat.CardCount, pointsForList == 0 ? "-" : pointsForList.ToString()));
     }
     row.AppendLine("</tbody></table>");
     return row.ToString();
 }
Exemplo n.º 5
0
        public string GetSummaryTextForBoardStat(BoardStatsAnalysis boardStatsAnalysis)
        {
            var weekStatsHeader = GetWeekStatsHtmlHeader();

            var weekStatsList = boardStatsAnalysis.WeekStats;
            var weekRows = new StringBuilder();
            weekStatsList.ForEach(w => weekRows.Append(GetWeekStatsHtmlRow(w, boardStatsAnalysis)));

            var summaryText = String.Format(_configuration.SummaryTextTemplate,
                    boardStatsAnalysis.FirstStartDate.ToLongDateString(),
                    boardStatsAnalysis.NumberOfCompletedCards,
                    boardStatsAnalysis.LastDoneDate.ToLongDateString(),
                    boardStatsAnalysis.BoardStats.CreatedDate.ToLongDateString(),
                    boardStatsAnalysis.BoardStats.CreatedDate.ToLongTimeString(),
                    boardStatsAnalysis.TotalPoints
                );

            return summaryText;
        }
Exemplo n.º 6
0
 internal string GetExtraListsStatsTable(BoardStatsAnalysis boardStatsAnalysis)
 {
     return GetExtraListsStatsTableHtml(boardStatsAnalysis);
 }
Exemplo n.º 7
0
        private string GetWeekStatsHtmlRow(WeekStats w, BoardStatsAnalysis boardStatsAnalysis)
        {
            var row = new StringBuilder("<tr>");
            row.AppendLine(GetWeekStatsRow(w.WeekNumber));

            row.AppendLine(GetWeekStatsRow(w.StartDate.ToShortDateString(), "date"));
            row.AppendLine(GetWeekStatsRow(w.EndDate.ToShortDateString(), "date"));
            row.AppendLine(GetWeekStatsRow(GetNumberForTableDisplay(w.NumberOfCardsInProgress),"text-center"));
            row.AppendLine(GetWeekStatsRow(GetNumberForTableDisplay(w.NumberOfCardsInTest),"text-center"));

            row.AppendLine(GetWeekStatsRow(GetNumberForTableDisplay(w.NumberOfCompletedCards),"text-center"));

            foreach (var labelName in _configuration.LabelNames)
            {
                var labelNameSet = labelName.Split('/');
                if (labelNameSet.Length > 1)
                {
                    var value1 = w.GetNumberOfCardsWithLabel(labelNameSet[0]);
                    var value2 = w.GetNumberOfCardsWithLabel(labelNameSet[1]);
                    var valueSet = String.Format("{0}/{1}", value1, value2);
                    row.AppendLine(GetWeekStatsRow(valueSet,"text-center"));
                }
                else
                {
                    row.AppendLine(GetWeekStatsRow(GetNumberForTableDisplay(w.GetNumberOfCardsWithLabel(labelName)),"text-center"));
                }
            }

            row.AppendLine(GetWeekStatsRow(w.PointsCompleted,"text-center"));

            var hoursString = string.Format("{0}/{1}",Math.Ceiling(w.TotalHours),Math.Ceiling(w.TotalExcludedHours));
            row.AppendLine(GetWeekStatsRow(hoursString, "text-center"));

            row.Append("</tr>");

            return row.ToString();
        }
 private string GetSummaryTextForErrorCards(BoardStatsAnalysis boardStatsAnalysis)
 {
     var errorCards = new StringBuilder();
     boardStatsAnalysis.BoardStats.BadCardStats.ForEach(c => errorCards.AppendFormat("<div><a href=\"{0}\">{1}</a></div>", c.CardData.Card.Url, c.CardData.Card.Name));
     return errorCards.ToString();
 }