Ignore:
Timestamp:
Jan 16, 2008, 2:35:00 PM (15 years ago)
Author:
Peter Johansson
Message:

Fixing statistics bugs and links on first page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/first_page.cc

    r546 r556  
    5151
    5252  void print_main_page(const std::string& dir, const SVNlog& log,
    53                        const Stats& stats, std::string url)
     53                       const StatsCollection& stats, std::string url)
    5454  {
    5555    std::string filename="index.html";
     
    6969      latest_commit.push_back(log.latest_commit(*i));
    7070
    71     print_summary_plot(os, stats);
     71    print_summary_plot(os, stats["classic"]);
    7272    print_general_information(os, log, authors.size(), url);
    7373    sort(latest_commit.begin(), latest_commit.end(), GreaterRevision());
    74     print_authors(os, latest_commit, stats);
    75     print_recent_logs(os, log);
     74    print_authors(os, latest_commit, stats["classic"]);
     75    print_recent_logs(os, log, stats);
    7676    os << "<hr width=100% />";
    7777    print_footer(os);
     
    130130       <<"</tr>";
    131131
    132     std::string timefmt("%b %d %H:%M:%S %Y");
     132    std::string timefmt("%Y %b %d %H:%M:%S");
    133133    using namespace std;
    134134    for (vector<Commitment>::const_iterator i=lc.begin(); i!=lc.end(); ++i) {
     
    158158
    159159
    160   void print_recent_logs(std::ostream& os, const SVNlog& log)
     160  void print_recent_logs(std::ostream& os, const SVNlog& log,
     161                         const StatsCollection& stats)
    161162  {
    162163    os << "<div class=\"main\">\n"
     
    172173    assert(log.author().size()==log.message().size());
    173174    assert(log.author().size()==log.revision().size());
    174     os << "<tr><td>Author</td><td>Date</td><td>Rev</td><td>Message</td></tr>\n";
     175    os << "<tr><td>Author</td><td>Date</td><td>Rev</td><td>Added</td>"
     176       << "<td>Removed</td><td>Message</td></tr>\n";
    175177    HtmlStream hs(os);
    176     std::string timefmt("%b %d %H:%M:%S %Y");
     178    std::string timefmt("%Y %b %d %H:%M:%S");
    177179    const size_t maxlength = 80;
    178180    const Configuration& conf = Configuration::instance();
     
    187189      os << "</td>";
    188190      os << "<td>";
     191      int added = stats["add"](LineTypeParser::total, "all", *r) -
     192        stats["add"](LineTypeParser::total, "all", *r - 1);
     193      os << added;
     194      os << "</td>";
     195      os << "<td>";
     196      os << added - (stats["blame"](LineTypeParser::total, "all", *r) -
     197                     stats["blame"](LineTypeParser::total, "all", *r - 1));
     198      os << "</td>";
     199      os << "<td>";
    189200      std::string mess = *m;
    190201      // replace newlines with space
Note: See TracChangeset for help on using the changeset viewer.