Ignore:
Timestamp:
May 6, 2007, 7:54:09 PM (14 years ago)
Author:
Peter Johansson
Message:

moved css generation to separate file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/html_utility.cc

    r275 r284  
    6666
    6767 
    68   void print_css(const std::string& str)
    69   {
    70     std::ofstream s(str.c_str());
    71     s << "<-- svndigest.css generated by " << PACKAGE_STRING << "\n"
    72 
    73       << "Copyright (C) 2006, 2007 Peter Johansson\n\n"
    74       << "This file is part of svndigest, "
    75       << "http://lev.thep.lu.se/trac/svndigest\n\n"
    76 
    77       << "svndigest is free software; you can redistribute it and/or "
    78       << "modify it\n"
    79       << "under the terms of the GNU General Public License as published by\n"
    80       << "the Free Software Foundation; either version 2 of the License, or\n"
    81       << "(at your option) any later version.\n\n"
    82 
    83       << "svndigest is distributed in the hope that it will be useful, but\n"
    84       << "WITHOUT ANY WARRANTY; without even the implied warranty of\n"
    85       << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
    86       << "General Public License for more details.\n\n"
    87 
    88       << "You should have received a copy of the GNU General Public License\n"
    89       << "along with this program; if not, write to the Free Software\n"
    90       << "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n"
    91       << "02111-1307, USA.\n\n"
    92 
    93       << "This file was initially inspired by the cascading style sheet\n"
    94       << "within the Trac open source project (http://trac.edgewall.org/)\n"
    95       << "Copyright (C) 2003-2006 Edgewall Software\n"
    96       << "All rights reserved.\n\n"
    97 
    98       << "Redistribution and use in source and binary forms, with or without\n"
    99       << "modification, are permitted provided that the following conditions\n"
    100       << "are met:\n\n"
    101      
    102       << "1. Redistributions of source code must retain the above copyright\n"
    103       << "   notice, this list of conditions and the following disclaimer.\n"
    104       << "2. Redistributions in binary form must reproduce the above "
    105       << "copyright\n"
    106       << "   notice, this list of conditions and the following disclaimer in\n"
    107       << "   the documentation and/or other materials provided with the\n"
    108       << "   distribution.\n"
    109       << "3. The name of the author may not be used to endorse or promote\n"
    110       << "   products derived from this software without specific prior\n"
    111       << "   written permission.\n\n"
    112      
    113       << "THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS\n"
    114       << "OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n"
    115       << "WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n"
    116       << "ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n"
    117       << "DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"
    118       << "DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n"
    119       << "GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n"
    120       << "INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n"
    121       << "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n"
    122       << "NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n"
    123       << "SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.-->\n";
    124 
    125 
    126     s << "body {\n";
    127     s << " background: #fff; \n";
    128     s << " color: #000; \n";
    129     s << " margin: 0px; \n";
    130     s << " padding: 0; \n";
    131     s << "} \n";
    132     s << "\n";
    133     s << "#menu {\n";
    134     s << " background: #eee;\n";
    135     s << " width: 100%;\n";
    136     s << " margin: 0px;\n";
    137     s << " padding: 0px;\n";
    138     s << "}\n\n";
    139     s << "#menu ul\n";
    140     s << "{ \n";
    141     s << "padding: 0px;\n";
    142     s << "margin: 0px;list-style-type: none; text-align: center;"
    143       << "border-bottom: 1px solid black;}\n";
    144     s << "#menu ul li { display: inline; border-right: 1px solid black;}\n";
    145     s << "#menu ul li a {text-decoration: none; padding-right: 1em;"
    146       << "padding-left: 1em; margin: 0px;}\n";
    147     s << "#menu ul li a:hover{ color: #000; background: #ddd;}\n";
    148     s << "#menu ul li.highlight a {color: #fff; background: #777; }";
    149     s << "\n";
    150     s << "#main {\n";
    151     s << " margin: 10px; \n";
    152     s << "}\n";
    153     s << "\n";
    154     s << "body, th, td {\n";
    155     s << " font: normal 13px verdana,arial,'Bitstream Vera Sans',"
    156       << "helvetica,sans-serif;\n";
    157     s << "}\n";
    158     s << ":link, :visited {\n";
    159     s << " text-decoration: none;\n";
    160     s << " color: #b00;\n";
    161     s << "}\n";
    162     s << "\n";
    163     s << "div.main {\n";
    164     s << "margin-top: 50px;\n";         
    165     s << "margin-left: 50px;\n";
    166     s << " \n";
    167     s << "}\n";
    168     s << "table.main {\n";
    169     s << " text-align: left;\n";
    170     s << " padding: 0 1em .1em 0;\n";
    171     s << "}\n";
    172     s << "table.main th {\n";
    173     s << " text-align: left;\n";
    174     s << " padding: 0 1em 0.5em 0;\n";
    175     s << " font-size: 150%;\n";
    176     s << " font-wheight: bold;\n";
    177     s << "}\n";
    178     s << "table.main td {\n";
    179     s << " padding: 0 1em .1em 0;\n";
    180     s << "}\n";
    181 
    182 
    183 
    184 
    185     s << "table.listings {\n";
    186     s << " clear: both;\n";
    187     s << " border-bottom: 1px solid #d7d7d7;\n";
    188     s << " border-collapse: collapse;\n";
    189     s << " border-spacing: 0;\n";
    190     s << " margin-top: 1em;\n";
    191     s << " width: 100%;\n";
    192     s << "}\n";
    193     s << "\n";
    194     s << "table.listings th {\n";
    195     s << " text-align: left;\n";
    196     s << " padding: 0 1em .1em 0;\n";
    197     s << " font-size: 12px\n";
    198     s << "}\n";
    199     s << "table.listings thead { background: #f7f7f0 }\n";
    200     s << "table.listings thead th {\n";
    201     s << " border: 1px solid #d7d7d7;\n";
    202     s << " border-bottom-color: #999;\n";
    203     s << " font-size: 11px;\n";
    204     s << " font-wheight: bold;\n";
    205     s << " padding: 2px .5em;\n";
    206     s << " vertical-align: bottom;\n";
    207     s << "}\n";
    208     s << "\n";
    209     s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
    210     s << " background-color: transparent;\n";
    211     s << "}\n";
    212     s << "\n";
    213     s << "table.listings tbody td, table.listing tbody th {\n";
    214     s << " border: 1px dotted #ddd;\n";
    215     s << " padding: .33em .5em;\n";
    216     s << " vertical-align: top;\n";
    217     s << "}\n";
    218     s << "\n";
    219     s << "table.listings tbody td a:hover, table.listing tbody th a:hover {\n";
    220     s << " background-color: transparent;\n";
    221     s << "}\n";
    222     s << "table.listings tbody tr { border-top: 1px solid #ddd }\n";
    223     s << "table.listings tbody tr.light { background-color: #fcfcfc }\n";
    224     s << "table.listings tbody tr.dark { background-color: #f7f7f7 }\n";
    225     s << "table.listings tbody tr:hover { background: #eed }\n";
    226     s << "table.listings tbody td { text-align: left }\n";
    227     s << "table.listings tbody td.directory a { font-weight: bold }\n";
    228     s << "\n";
    229     s << ".sep { color: #666}\n";
    230     s << "\n";
    231     s << "\n";
    232     s.close();
    233   }
    234 
    235 
    23668  void print_main_page(const std::string& dir, const SVNlog& log,
    23769                       const Stats& stats)
Note: See TracChangeset for help on using the changeset viewer.