src/main.cpp

changeset 44
de22ded6d50a
parent 41
19cc90878968
equal deleted inserted replaced
43:f58fd8461e10 44:de22ded6d50a
31 #include <chrono> 31 #include <chrono>
32 #include <cstdlib> 32 #include <cstdlib>
33 #include <cstdio> 33 #include <cstdio>
34 #include <cstring> 34 #include <cstring>
35 #include <cerrno> 35 #include <cerrno>
36
37 #include <numeric>
36 38
37 using namespace std::chrono; 39 using namespace std::chrono;
38 40
39 static constexpr auto program_version = "1.1.0 (dev)"; 41 static constexpr auto program_version = "1.1.0 (dev)";
40 42
264 for (const auto &[repo, authors] : heatmap.data()) { 266 for (const auto &[repo, authors] : heatmap.data()) {
265 bool h1_rendered = false; 267 bool h1_rendered = false;
266 for (const auto &[author, entries] : authors) { 268 for (const auto &[author, entries] : authors) {
267 if (settings.exclude_author(author)) continue; 269 if (settings.exclude_author(author)) continue;
268 if (!h1_rendered) { 270 if (!h1_rendered) {
269 html::h1(repo); 271 html::heading_repo(repo);
270 h1_rendered = true; 272 h1_rendered = true;
271 } 273 }
272 html::h2(author); 274
273 html::table_begin(report_year); 275 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 html::heading_author(author, total_commits);
278 html::table_begin(report_year, commits_per_month);
274 279
275 // initialize counters 280 // initialize counters
276 unsigned column = 0, row = 0; 281 unsigned column = 0, row = 0;
277 282
278 // initialize first day (which must be a Monday, possibly the year before) 283 // initialize first day (which must be a Monday, possibly the year before)

mercurial