Changeset 3836 for autoqueryplugin

Show
Ignore:
Timestamp:
06/13/08 15:17:03 (3 months ago)
Author:
k0s
Message:

add excluded_fields to not be marked up by AutoQuery?; fixes #3178

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • autoqueryplugin/0.11/autoquery/autoquery.py

    r3816 r3836  
    77 
    88from trac.core import * 
     9from trac.config import ListOption 
    910from trac.config import Option 
    1011from trac.web import IRequestFilter 
     
    1718                        doc="additional arguments to the query string") 
    1819 
     20    excluded_fields = Option('autoquery', 'excluded_fields',  
     21                             default=['estimatedhours', 'hours', 'totalhours'], 
     22                             doc="fields to exclude from AutoQuery markup") 
    1923 
    2024    ### methods for ITemplateProvider 
     
    8791 
    8892            data['query_link'] = query_link 
     93            data['excluded_fields'] = self.excluded_fields 
    8994            template = 'autoquery_ticket.html' 
    9095        return (template, data, content_type) 
  • autoqueryplugin/0.11/autoquery/templates/autoquery_ticket.html

    r3696 r3836  
    164164                      <py:when test="'rendered' in field">${field.rendered}</py:when> 
    165165                      <py:otherwise> 
    166                       <py:if test="ticket[field.name]"> 
    167                         <a href="${query_link(field.name, ticket[field.name])}"> 
    168                           ${ticket[field.name]} 
    169                         </a> 
    170                         </py:if>                 
     166                        <py:if test="ticket[field.name]"> 
     167                          <py:if test="field.name not in excluded_fields"> 
     168                            <a href="${query_link(field.name, ticket[field.name])}"> 
     169                              ${ticket[field.name]} 
     170                            </a> 
     171                          </py:if> 
     172                          <py:if test="field.name in excluded_fields"> 
     173                            ${ticket[field.name]} 
     174                          </py:if> 
     175                        </py:if> 
    171176                      </py:otherwise> 
    172177                    </py:choose>