Edgewall Software

Ticket #3132: t3132.diff

File t3132.diff, 3.6 KB (added by Tim Hatch <trac@…>, 5 years ago)
  • htdocs/css/timeline.css

     
    1616 background: 3px 3px no-repeat; 
    1717 border: none; 
    1818 color: #000; 
    19  padding: 0 4px 2px 22px; 
     19 padding: 0 4px 0 22px; 
    2020} 
    21 dt>:link, dt>:visited { 
    22  /* Hide from IE/Win */ 
    23  background-position: 3px 4px; 
    24  display: block; 
    25 } 
     21dt:hover { background-color: #eed; } 
     22 
    2623dt :link:hover, dt :visited:hover { background-color: #eed; color: #000 } 
    2724dt em { 
    2825 border-bottom: 1px dotted #bbb; 
     
    3936} 
    4037 
    4138/* Apply icon background-image twice to avoid hover-flicker in IE/Win */ 
    42 dt.changeset, dt.changeset a { background-image: url(../changeset.png) !important } 
    43 dt.newticket, dt.newticket a { background-image: url(../newticket.png) !important } 
    44 dt.editedticket, dt.editedticket a { background-image: url(../editedticket.png) !important } 
    45 dt.closedticket, dt.closedticket a { background-image: url(../closedticket.png) !important } 
    46 dt.wiki, dt.wiki a { background-image: url(../wiki.png) !important } 
    47 dt.milestone, dt.milestone a { background-image: url(../milestone.png) !important } 
    48 dt.attachment, dt.attachment a { background-image: url(../attachment.png) !important } 
     39dt.changeset a { background-image: url(../changeset.png) !important } 
     40dt.newticket a { background-image: url(../newticket.png) !important } 
     41dt.editedticket a { background-image: url(../editedticket.png) !important } 
     42dt.closedticket a { background-image: url(../closedticket.png) !important } 
     43dt.wiki a { background-image: url(../wiki.png) !important } 
     44dt.milestone a { background-image: url(../milestone.png) !important } 
     45dt.attachment a { background-image: url(../attachment.png) !important } 
    4946 
    5047/* styles for the 'changeset_long_messages' option */ 
    5148dd.changeset p { margin: 0; padding: 0 } 
  • trac/web/api.py

     
    2222import os 
    2323from StringIO import StringIO 
    2424import sys 
     25from time import time 
    2526import urlparse 
    2627 
    2728from trac.core import Interface 
     
    346347            self.write(data) 
    347348        raise RequestDone 
    348349 
    349     def send_file(self, path, mimetype=None): 
     350    def send_file(self, path, mimetype=None, expires=None): 
    350351        """Send a local file to the browser. 
    351352         
    352353        This method includes the "Last-Modified", "Content-Type" and 
     
    374375        self.send_header('Content-Type', mimetype) 
    375376        self.send_header('Content-Length', stat.st_size) 
    376377        self.send_header('Last-Modified', last_modified) 
     378        if expires: 
     379            exp = datetime.fromtimestamp(time()+expires, localtz) 
     380            self.send_header('Expires', http_date(exp)) 
    377381        self.end_headers() 
    378382 
    379383        if self.method != 'HEAD': 
  • trac/web/chrome.py

     
    276276                path = os.path.normpath(os.path.join(dir, filename)) 
    277277                assert os.path.commonprefix([dir, path]) == dir 
    278278                if os.path.isfile(path): 
    279                     req.send_file(path, mimeview.get_mimetype(path)) 
     279                    req.send_file(path, mimeview.get_mimetype(path), 
     280                                  path[:-4] in ('.png', '.gif', '.jpg') and 
     281                                               2592000 or None) 
    280282 
    281283        self.log.warning('File %s not found in any of %s', filename, dirs) 
    282284        raise HTTPNotFound('File %s not found', filename)