Edgewall Software

Changes between Version 9 and Version 10 of CookBook/SiteHtml/Genshi


Ignore:
Timestamp:
Nov 21, 2014, 7:37:02 PM (9 years ago)
Author:
Ryan J Ollos
Comment:

Add syntax coloring to snippets.

Legend:

Unmodified
Added
Removed
Modified
  • CookBook/SiteHtml/Genshi

    v9 v10  
    1 = Interface Customization using site.html =
     1= Interface Customization using site.html
    22
    33This page intends to collect useful snippets for inclusing in a project `site.html` file. Any snippet below is intended to be included inside the standard root element of the file:
     
    1717Remember, snippets are more useful if accompanied by a short description...
    1818
    19 == Quicksearch for tickets only ==
     19== Quicksearch for tickets only
    2020
    2121When no search filters are provided, Trac searches using all filters. This snippets adds a filter to the quicksearch that restricts searches to tickets only by default - more can of course be added by user after initial search:
     
    3232Explanation: It grabs the `<div/>` inside the quicksearch form into a new div, adding any attributes of the old (though no attributes by default) and then inserts any content (elements, text and comments) that the old element had with the `${select()}` call. To this new (identical) div, a new `<input/>` element is added that provides a filter for ticket-only search.
    3333
    34 == Add licensing information when adding attachments ==
     34== Add licensing information when adding attachments
    3535
    3636If adding attachments to your Trac site requires people to agree to some licensing, you can add the terms of the license on the "Add attachments" page as follows:
    3737
    38 {{{
    39 #!xml
     38{{{#!xml
    4039<py:match path="form[@id='attachment']/div[@class='buttons']" once="true">
    4140  <p>By submitting a file here, you accept that we can do whatever
     
    4948Explanation: This matches the `<div>` containing the submit buttons, adds a paragraph with the text at that location, then reconstructs the matched `<div>` with its initial content and attributes.
    5049
    51 == Rename Roadmaps header ==
     50== Rename Roadmap header
    5251
    5352If your team would prefer to see a different title instead of Roadmap, add the following code to your site.html and restart the server. Don't forget to edit trac.ini to [TracNavigation change the link title].
    5453
    55 {{{
     54{{{#!xml
    5655<span py:match="h1">
    5756  <py:if test="req.environ['PATH_INFO'] == '/roadmap'">
     
    6261
    6362
    64 == Replace footer ==
     63== Replace footer
    6564If you want to change the default footer, this snippet strips out the current one and puts in my own.  Tested with 1.0.1.  Apologies for the formatting.
    6665
    67 {{{
     66{{{#!xml
    6867  <!--! Replace standard footer with a site-specific footer -->
    6968  <div id="footer" py:match="//div[@id='footer']" py:strip="True">