Changes between Version 9 and Version 10 of CookBook/SiteHtml/Genshi
- Timestamp:
- Nov 21, 2014, 7:37:02 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBook/SiteHtml/Genshi
v9 v10 1 = Interface Customization using site.html =1 = Interface Customization using site.html 2 2 3 3 This 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: … … 17 17 Remember, snippets are more useful if accompanied by a short description... 18 18 19 == Quicksearch for tickets only ==19 == Quicksearch for tickets only 20 20 21 21 When 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: … … 32 32 Explanation: 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. 33 33 34 == Add licensing information when adding attachments ==34 == Add licensing information when adding attachments 35 35 36 36 If 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: 37 37 38 {{{ 39 #!xml 38 {{{#!xml 40 39 <py:match path="form[@id='attachment']/div[@class='buttons']" once="true"> 41 40 <p>By submitting a file here, you accept that we can do whatever … … 49 48 Explanation: 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. 50 49 51 == Rename Roadmap s header ==50 == Rename Roadmap header 52 51 53 52 If 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]. 54 53 55 {{{ 54 {{{#!xml 56 55 <span py:match="h1"> 57 56 <py:if test="req.environ['PATH_INFO'] == '/roadmap'"> … … 62 61 63 62 64 == Replace footer ==63 == Replace footer 65 64 If 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. 66 65 67 {{{ 66 {{{#!xml 68 67 <!--! Replace standard footer with a site-specific footer --> 69 68 <div id="footer" py:match="//div[@id='footer']" py:strip="True">