Changeset 379


Ignore:
Timestamp:
Jun 20, 2007, 11:35:02 PM (13 years ago)
Author:
Jari Häkkinen
Message:

Addresses #62.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r356 r379  
    22
    33/*
    4   Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson
    5   Copyright (C) 2007 Peter Johansson
     4  Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson
    65
    76  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
     
    7877  }
    7978
    80 
    81   void File::print_core(const std::string& user, const std::string& line_type,
    82                         const SVNlog& log) const
    83   {
    84     std::string outpath = user+"/"+line_type+"/"+local_path();
    85     std::string imagefile = "images/"+line_type+"/"+local_path_+".png";
    86     std::string html_name(outpath + ".html");
    87     std::ofstream os(html_name.c_str());
    88     print_header(os, name(), level_+2, user, line_type, local_path()+".html");
    89     path_anchor(os);
    90     os << "<p align=center>\n<img src='";
    91     for (size_t i=0; i<level_; ++i)
    92       os << "../";
    93     os << "../../";
    94     if (user=="all")
    95       os << stats_.plot(imagefile,line_type);
    96     else
    97       os << imagefile;
    98     os << "' alt='[plot]' border=0>\n</p>";
    99 
    100     print_author_summary(os, line_type, log);
    101     os << "</p>\n";
    102 
    103     print_footer(os);
    104     os.close();
    105   }
    106 
    107 
    108   void File::print_core(const bool verbose) const
    109   {
    110   }
    111 
     79  /*
     80  void File::blame_anchor(std::ostream& os) const
     81  {
     82    os << "<h2 class=\"path\">\n";
     83    std::vector<std::string> words;
     84    words.reserve(level_+1);
     85    std::string word;
     86    words.push_back(Node::project_);
     87    std::stringstream ss(local_path());
     88    while(getline(ss,word,'/'))
     89      if (!word.empty()) // ignore double slash in path
     90        words.push_back(word);
     91    if (words.size()==1)
     92      os << anchor("index.html", Node::project_,0, "View " + Node::project_);
     93    else {
     94      for (size_t i=0; i<words.size()-1; ++i){
     95        os << anchor("index.html", words[i], level_-i, "View " + words[i]);
     96        os << "<span class=\"sep\">/</span>\n";
     97      }
     98      os << anchor(href(), words.back(), level_+2-words.size(),
     99             "View " + words.back());
     100    }
     101    os << "\n</h2>\n";
     102  }
     103  */
    112104
    113105  void File::print_blame(std::ofstream& os, const std::string line_type) const
    114106  {
     107    os << "<h3>Blame information</h3>";
    115108    os << "<table class=\"blame\">\n";
    116 
     109    os << "<thead>\n";
     110    os << "<tr>\n";
     111    os << "<th>Rev</th>\n";
     112    os << "<th>Author</th>\n";
     113    os << "<th>Line</th>\n";
     114    os << "</tr>\n</thead>\n";
     115    os << "<tbody>\n";
     116
     117    os << "</tbody>\n";
    117118    os << "</table>\n";
    118119  }
     
    152153      }
    153154    }
    154 
    155155
    156156    // Code copied from Gnuplot -r70
     
    228228    // finally move printed temporary file to original file
    229229    rename(tmpname, path().c_str());
    230    
    231   }
     230  }
     231
     232
     233  void File::print_core(const bool verbose) const
     234  {
     235  }
     236
     237
     238  void File::print_core(const std::string& user, const std::string& line_type,
     239                        const SVNlog& log) const
     240  {
     241    std::string outpath = user+"/"+line_type+"/"+local_path();
     242    std::string imagefile = "images/"+line_type+"/"+local_path_+".png";
     243    std::string html_name(outpath + ".html");
     244    std::ofstream os(html_name.c_str());
     245    print_header(os, name(), level_+2, user, line_type, local_path()+".html");
     246    path_anchor(os);
     247
     248    os << "<p align=center>\n<img src='";
     249    for (size_t i=0; i<level_; ++i)
     250      os << "../";
     251    os << "../../";
     252    if (user=="all")
     253      os << stats_.plot(imagefile,line_type);
     254    else
     255      os << imagefile;
     256    os << "' alt='[plot]' border=0>\n</p>";
     257
     258    print_author_summary(os, line_type, log);
     259    os << "</p>\n";
     260
     261    print_blame(os,line_type);
     262
     263    print_footer(os);
     264    os.close();
     265  }
     266
    232267}} // end of namespace svndigest and namespace theplu
  • trunk/lib/css.cc

    r367 r379  
    22
    33/*
    4   Copyright (C) 2006, 2007 Peter Johansson
     4  Copyright (C) 2006 Peter Johansson
     5  Copyright (C) 2007 Jari Häkkinen, Peter Johansson
    56
    67  This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest
     
    3637    s << "<-- svndigest.css generated by " << PACKAGE_STRING << "\n"
    3738
    38       << "Copyright (C) 2006, 2007 Peter Johansson\n\n"
     39      << "Copyright (C) 2006 Peter Johansson\n"
     40      << "Copyright (C) 2007 Jari Häkkinen, Peter Johansson\n\n"
    3941      << "This file is part of svndigest, "
    4042      << "http://lev.thep.lu.se/trac/svndigest\n\n"
     
    6769      << "1. Redistributions of source code must retain the above copyright\n"
    6870      << "   notice, this list of conditions and the following disclaimer.\n"
    69       << "2. Redistributions in binary form must reproduce the above "
    70       << "copyright\n"
     71      << "2. Redistributions in binary form must reproduce the above copyright\n"
    7172      << "   notice, this list of conditions and the following disclaimer in\n"
    7273      << "   the documentation and/or other materials provided with the\n"
     
    8889      << "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-->\n";
    8990
    90 
    9191    s << "body {\n";
    9292    s << " background: #fff; \n";
     
    9696    s << "} \n";
    9797    s << "\n";
     98
    9899    s << "#menu {\n";
    99100    s << " background: #eee;\n";
     
    117118    s << "}\n";
    118119    s << "\n";
     120
    119121    s << "body, th, td {\n";
    120122    s << " font: normal 13px verdana,arial,'Bitstream Vera Sans',"
     
    126128    s << "}\n";
    127129    s << "\n";
     130
    128131    s << "div.main {\n";
    129132    s << "margin-top: 50px;\n";         
     
    131134    s << " \n";
    132135    s << "}\n";
     136
    133137    s << "table.main {\n";
    134138    s << " text-align: left;\n";
     
    144148    s << " padding: 0 1em .1em 0;\n";
    145149    s << "}\n";
     150
     151    s << "table.blame {\n";
     152    s << " clear: both;\n";
     153    s << " border-bottom: 1px solid #d7d7d7;\n";
     154    s << " border-collapse: collapse;\n";
     155    s << " border-spacing: 0;\n";
     156    s << " margin-top: 1em;\n";
     157    s << " width: 100%;\n";
     158    s << "}\n";
     159    s << "\n";
     160    s << "table.blame th {\n";
     161    s << " text-align: left;\n";
     162    s << " padding: 0 1em .1em 0;\n";
     163    s << " font-size: 12px\n";
     164    s << "}\n";
     165    s << "table.blame thead { background: #f7f7f0 }\n";
     166    s << "table.blame thead th {\n";
     167    s << " border: 1px solid #d7d7d7;\n";
     168    s << " border-bottom-color: #999;\n";
     169    s << " font-size: 11px;\n";
     170    s << " font-wheight: bold;\n";
     171    s << " padding: 2px .5em;\n";
     172    s << " vertical-align: bottom;\n";
     173    s << "}\n";
     174    s << "\n";
     175    s << "table.blame tbody td a:hover, table.listing tbody th a:hover {\n";
     176    s << " background-color: transparent;\n";
     177    s << "}\n";
     178    s << "\n";
     179    s << "table.blame tbody td, table.listing tbody th {\n";
     180    s << " border: 1px dotted #ddd;\n";
     181    s << " padding: .33em .5em;\n";
     182    s << " vertical-align: top;\n";
     183    s << "}\n";
     184    s << "\n";
     185    s << "table.blame tbody td a:hover, table.listing tbody th a:hover {\n";
     186    s << " background-color: transparent;\n";
     187    s << "}\n";
     188    s << "table.blame tbody tr { border-top: 1px solid #ddd }\n";
     189    s << "table.blame tbody tr.light { background-color: #fcfcfc }\n";
     190    s << "table.blame tbody tr.dark { background-color: #f7f7f7 }\n";
     191    s << "table.blame tbody tr:hover { background: #eed }\n";
     192    s << "table.blame tbody td { text-align: left }\n";
     193    s << "table.blame tbody td a { display: block; }\n";
     194    s << "table.blame tbody td.directory a { font-weight: bold }\n";
     195    s << "\n";
     196
    146197    s << "table.listings {\n";
    147198    s << " clear: both;\n";
     
    189240    s << "table.listings tbody td.directory a { font-weight: bold }\n";
    190241    s << "\n";
     242
    191243    s << ".sep { color: #666}\n";
    192244    s << "\n";
Note: See TracChangeset for help on using the changeset viewer.