src/main.cpp

changeset 46
7e099403e5b0
parent 44
de22ded6d50a
child 52
e9edc3bd0301
equal deleted inserted replaced
45:2cb7fdd2ba18 46:7e099403e5b0
269 if (settings.exclude_author(author)) continue; 269 if (settings.exclude_author(author)) continue;
270 if (!h1_rendered) { 270 if (!h1_rendered) {
271 html::heading_repo(repo); 271 html::heading_repo(repo);
272 h1_rendered = true; 272 h1_rendered = true;
273 } 273 }
274 html::chart_begin(repo, author);
274 275
275 const auto commits_per_month = heatmap.commits_per_month(repo, author, report_year); 276 const auto commits_per_month = heatmap.commits_per_month(repo, author, report_year);
276 const auto total_commits = std::accumulate(commits_per_month.begin(), commits_per_month.end(), 0u); 277 const auto total_commits = std::accumulate(commits_per_month.begin(), commits_per_month.end(), 0u);
277 html::heading_author(author, total_commits); 278 html::heading_author(author, total_commits);
278 html::table_begin(report_year, commits_per_month); 279 html::table_begin(report_year, commits_per_month);
279 280
280 // initialize counters 281 // initialize counters
281 unsigned column = 0, row = 0; 282 unsigned column = 0, row = 0;
282 283
283 // initialize first day (which must be a Monday, possibly the year before) 284 // initialize the first day (which must be a Monday, possibly the year before)
284 sys_days day_to_check = January / Monday[1] / report_year; 285 sys_days day_to_check = January / Monday[1] / report_year;
285 if (year_month_day{day_to_check}.day() != 1d) { 286 if (year_month_day{day_to_check}.day() != 1d) {
286 day_to_check -= days{7}; 287 day_to_check -= days{7};
287 } 288 }
288 289
289 // remember the starting point 290 // remember the starting point
290 auto start = day_to_check; 291 auto start = day_to_check;
291 292
292 // now add all entries for Monday, Tuesdays, etc. always starting back in january 293 // now add all entries for Monday, Tuesdays, etc. always starting back in January
293 while (true) { 294 while (true) {
294 html::row_begin(row); 295 html::row_begin(row);
295 296
296 // check if we need to add blank cells 297 // check if we need to add blank cells
297 while (day_to_check < report_begin) { 298 while (day_to_check < report_begin) {
328 day_to_check = start; 329 day_to_check = start;
329 column =0; 330 column =0;
330 } 331 }
331 332
332 html::table_end(); 333 html::table_end();
334 html::chart_end();
333 } 335 }
334 } 336 }
335 html::close(settings.fragment); 337 html::close(settings.fragment);
336 338
337 return EXIT_SUCCESS; 339 return EXIT_SUCCESS;

mercurial