- Timestamp:
- Jun 21, 2007, 9:25:39 PM (16 years ago)
- Location:
- trunk/lib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Directory.cc
r378 r380 2 2 3 3 /* 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 6 5 7 6 This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest -
trunk/lib/Directory.h
r343 r380 72 72 std::string href(void) const; 73 73 74 / //75 /// @return directory76 ///74 /** 75 @return The explicit string "directory", nothing else. 76 */ 77 77 std::string node_type(void) const; 78 78 -
trunk/lib/File.cc
r379 r380 25 25 26 26 #include "Alias.h" 27 #include "Date.h" 27 28 #include "html_utility.h" 29 #include "HtmlStream.h" 28 30 #include "Stats.h" 31 #include "SVNblame.h" 29 32 #include "SVNlog.h" 30 33 … … 77 80 } 78 81 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 */ 104 105 void File::print_blame(std::ofstream& os, const std::string line_type) const 106 { 107 os << "<h3>Blame information</h3>"; 82 83 void File::print_blame(std::ofstream& os) const 84 { 85 os << "<br><h3>Blame Information</h3>"; 108 86 os << "<table class=\"blame\">\n"; 109 87 os << "<thead>\n"; 110 88 os << "<tr>\n"; 111 os << "<th>Rev</th>\n"; 112 os << "<th>Author</th>\n"; 89 os << "<th class=\"number\">Rev</th>\n"; 90 os << "<th class=\"date\">Date</th>\n"; 91 os << "<th class=\"author\">Author</th>\n"; 92 os << "<th class=\"number\">Lineno</th>\n"; 113 93 os << "<th>Line</th>\n"; 114 94 os << "</tr>\n</thead>\n"; 115 95 os << "<tbody>\n"; 116 96 HtmlStream hs(os); 97 SVNblame blame(path_); 98 while (const struct SVNblame::blame_information* bi=blame.next()) { 99 os << "<tr>\n<td class=\"number\">" << bi->revision 100 << "</td>\n<td class=\"date\">" << Date(bi->date)("%e %b %y") 101 << "</td>\n<td class=\"author\">"; 102 hs << bi->author; 103 os << "</td>\n<td class=\"number\">" << bi->line_no+1 104 << "</td>\n<td class=\"code\">"; 105 hs << bi->line; 106 os << "</td>\n</tr>\n"; 107 } 117 108 os << "</tbody>\n"; 118 109 os << "</table>\n"; … … 259 250 os << "</p>\n"; 260 251 261 print_blame(os ,line_type);252 print_blame(os); 262 253 263 254 print_footer(os); -
trunk/lib/File.h
r356 r380 5 5 6 6 /* 7 Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007 Peter Johansson 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 9 8 10 9 This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest … … 50 49 std::string href(void) const; 51 50 52 / //53 /// @return file54 ///51 /** 52 @return The explicit string "file", nothing else. 53 */ 55 54 std::string node_type(void) const; 56 55 … … 66 65 /// 67 66 const Stats& parse(const bool verbose=false); 68 69 ///70 /// print blame output71 ///72 void print_blame(std::ofstream&, const std::string line_type) const;73 67 74 68 void print_copyright(std::map<std::string, Alias>&) const; … … 88 82 File(const File&); 89 83 84 /** 85 @brief Print blame output 86 */ 87 void print_blame(std::ofstream&) const; 88 90 89 void print_core(bool verbose=false) const; 91 90 -
trunk/lib/HtmlStream.cc
r286 r380 2 2 3 3 /* 4 Copyright (C) 2007 Peter Johansson4 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 5 5 6 6 This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest … … 38 38 map_['>']=std::string(">"); 39 39 map_['&']=std::string("&"); 40 map_[' ']=std::string(" "); 40 41 // This should be configurable, but for now indentation is two spaces. 41 42 map_['\t']=std::string(" "); -
trunk/lib/Node.h
r361 r380 5 5 6 6 /* 7 Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson 8 Copyright (C) 2007 Peter Johansson 7 Copyright (C) 2005, 2006, 2007 Jari Häkkinen, Peter Johansson 9 8 10 9 This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest … … 114 113 { return svninfo_.last_changed_rev(); } 115 114 116 /// 117 /// @return file or directory 118 /// 115 /** 116 @return The explicit string identifying the underlying derived 117 class. 118 */ 119 119 virtual std::string node_type(void) const=0; 120 120 -
trunk/lib/SVNblame.h
r205 r380 5 5 6 6 /* 7 Copyright (C) 2006 Jari Häkkinen7 Copyright (C) 2006, 2007 Jari Häkkinen 8 8 9 9 This file is part of svndigest, http://lev.thep.lu.se/trac/svndigest … … 84 84 item. The pointer is only valid while the SVNblame object is in 85 85 scope. 86 86 87 @return Pointer to a blame_information struct if more lines are 88 available NULL otherwise. 89 87 90 @see struct blame_information. 88 91 */ -
trunk/lib/css.cc
r379 r380 147 147 s << "table.main td {\n"; 148 148 s << " padding: 0 1em .1em 0;\n"; 149 s << "}\n ";149 s << "}\n\n"; 150 150 151 151 s << "table.blame {\n"; … … 157 157 s << " width: 100%;\n"; 158 158 s << "}\n"; 159 s << "\n";160 159 s << "table.blame th {\n"; 161 160 s << " text-align: left;\n"; … … 163 162 s << " font-size: 12px\n"; 164 163 s << "}\n"; 164 s << "table.blame th.author { width: 8em; text-align:right }\n"; 165 s << "table.blame th.date { width: 8em; text-align:center }\n"; 166 s << "table.blame th.number { width: 2em }\n"; 165 167 s << "table.blame thead { background: #f7f7f0 }\n"; 166 168 s << "table.blame thead th {\n"; … … 172 174 s << " vertical-align: bottom;\n"; 173 175 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"; 176 s << "table.blame tbody td a:hover, table.blame tbody th a:hover {\n"; 177 s << " background-color: transparent;\n"; 178 s << "}\n"; 179 s << "table.blame tbody td, table.blame tbody th {\n"; 180 180 s << " border: 1px dotted #ddd;\n"; 181 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"; 182 s << " vertical-align: bottom;\n"; 183 s << "}\n"; 184 s << "table.blame tbody td a:hover, table.blame tbody th a:hover {\n"; 186 185 s << " background-color: transparent;\n"; 187 186 s << "}\n"; … … 191 190 s << "table.blame tbody tr:hover { background: #eed }\n"; 192 191 s << "table.blame tbody td { text-align: left }\n"; 192 s << "table.blame tbody td.author { text-align: right }\n"; 193 s << "table.blame tbody td.code { font: normal 12px monospace }\n"; 194 s << "table.blame tbody td.date { text-align: center }\n"; 195 s << "table.blame tbody td.number { text-align: right }\n"; 193 196 s << "table.blame tbody td a { display: block; }\n"; 194 197 s << "table.blame tbody td.directory a { font-weight: bold }\n";
Note: See TracChangeset
for help on using the changeset viewer.