Roundup Wiki

Introduction

roundup tracker. The syntax for the regular expressions is of course the same syntax as used in Python's RE module. For more information about the syntax, we refer to the documentation belonging to that module.

Requirements

search to your tracker.

Implementation

and a new action handler that supports regular expressions.

_Search HTML Template_<br> The new template is based on the 'issue.search.html' template and it came out of the roundup 1.1.1 distribution. To see the changes, please run a diff against the new 'issue.search.html' template and the out of the box one from 1.1.1. Don't get scared. The changes are simple and not too much.

_Action Handler_<br> The action handler is also based on a standard out of the box action handler of roundup 1.1.1. That action handler is 'SearchAction' in 'actions.py'. The new handler supports all the features of the original handler as long as the user didn't ask for a regular expression search. To see the changes, please run a diff against the original action handler.

Best regards,<br> Marlon van den Berg

PS: Be aware that a regular expression search can consume some time when you run it on a slow server or in a tracker with a huge number of issues and messages.

<hr>

Source Code

Here is the new 'issue.search.html' template
  • <tal:block metal:use-macro="templates/page/macros/icing"> <title metal:fill-slot="head_title" i18n:translate="">Issue searching - <span

    • i18n:name="tracker" tal:replace="config/TRACKER_NAME" /></title>

    <span metal:fill-slot="body_title" tal:omit-tag="python:1"

    • i18n:translate="">Issue searching</span>

    <td class="content" metal:fill-slot="content">

    <disabled script language="javascript" type="text/javascript">

    • //<!-- function onClick_RegExp() {

      • if (self.document.itemSynopsis['reg_exp'].checked) {
        • self.document.itemSynopsis['re_ignorecase'].disabled = false;
        } else {
        • self.document.itemSynopsis['re_ignorecase'].checked = false; self.document.itemSynopsis['re_ignorecase'].disabled = true;
        }
      }

      //-->

    <disabled /script>

    <form method="GET" name="itemSynopsis"

    • tal:attributes="action request/classname">

    <table class="form" tal:define="

    • cols python:request.columns or 'id activity title status assignedto'.split(); sort_on python:request.sort[1] or 'activity'; group_on python:request.group[1] or 'priority'; search_input templates/page/macros/search_input; column_input templates/page/macros/column_input; sort_input templates/page/macros/sort_input; group_input templates/page/macros/group_input; search_select templates/page/macros/search_select;

      search_multiselect templates/page/macros/search_multiselect;">

    <tr tal:define="name string:@search_text">

    • <th i18n:translate="">All text*:</th> <td>

      • <input size="45"

        • tal:attributes="value python:request.form.getvalue(name) or nothing;
          • name name">

      </td> <td nowrap colspan="3">

      • <input type="checkbox" name="reg_exp" value="1" onClick="javascript: onClick_RegExp()"

        • tal:attributes="checked reguest/form/reg_exp/value | nothing">

        Regular Expression<br> <input type="checkbox" name="re_ignorecase" value="1"

        • tal:attributes="checked reguest/form/re_ignorecase/value | nothing">

        Ignore case<br> <br>

      </td>

    </tr>

    <tr>

    • <th class="header"> </th> <th class="header" i18n:translate="">Filter on</th> <th class="header" i18n:translate="">Display</th> <th class="header" i18n:translate="">Sort on</th> <th class="header" i18n:translate="">Group on</th>

    </tr>

    <tr tal:define="name string:title">

    • <th i18n:translate="">Title:</th> <td metal:use-macro="search_input"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td> </td>

    </tr>

    <tr tal:define="name string:topic;

    • db_klass string:keyword;

      db_content string:name;">

    • <th i18n:translate="">Topic:</th> <td metal:use-macro="search_select"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr tal:define="name string:id">

    • <th i18n:translate="">ID:</th> <td metal:use-macro="search_input"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td> </td>

    </tr>

    <tr tal:define="name string:creation">

    • <th i18n:translate="">Creation Date:</th> <td metal:use-macro="search_input"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr tal:define="name string:creator;

    • db_klass string:user; db_content string:username;"
    • tal:condition="db/user/is_view_ok">

    • <th i18n:translate="">Creator:</th> <td metal:use-macro="search_select">

      • <option metal:fill-slot="extra_options" i18n:translate=""

        • tal:attributes="value request/user/id">created by me</option>

      </td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr tal:define="name string:activity">

    • <th i18n:translate="">Activity:</th> <td metal:use-macro="search_input"></td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td> </td>

    </tr>

    <tr tal:define="name string:actor;

    • db_klass string:user; db_content string:username;"
    • tal:condition="db/user/is_view_ok">

    • <th i18n:translate="">Actor:</th> <td metal:use-macro="search_select">

      • <option metal:fill-slot="extra_options" i18n:translate=""

        • tal:attributes="value request/user/id">done by me</option>

      </td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td> </td>

    </tr>

    <tr tal:define="name string:priority;

    • db_klass string:priority;

      db_content string:name;">

    • <th i18n:translate="">Priority:</th> <td metal:use-macro="search_select">

      • <option metal:fill-slot="extra_options" value="-1" i18n:translate=""

        • tal:attributes="selected python:value == '-1'">not selected</option>

      </td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr tal:define="name string:status;

    • db_klass string:status;

      db_content string:name;">

    • <th i18n:translate="">Status:</th> <td metal:use-macro="search_select">

      • <tal:block metal:fill-slot="extra_options">

        • <option value="-1,1,2,3,4,5,6,7" i18n:translate=""

          • tal:attributes="selected python:value == '-1,1,2,3,4,5,6,7'">not resolved</option>

          <option value="-1" i18n:translate=""

          • tal:attributes="selected python:value == '-1'">not selected</option>

        </tal:block>

      </td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr tal:define="name string:assignedto;

    • db_klass string:user; db_content string:username;"
    • tal:condition="db/user/is_view_ok">

    • <th i18n:translate="">Assigned to:</th> <td metal:use-macro="search_select">

      • <tal:block metal:fill-slot="extra_options">

        • <option tal:attributes="value request/user/id"

          • i18n:translate="">assigned to me</option>

          <option value="-1" tal:attributes="selected python:value == '-1'"

          • i18n:translate="">unassigned</option>

        </tal:block>

      </td> <td metal:use-macro="column_input"></td> <td metal:use-macro="sort_input"></td> <td metal:use-macro="group_input"></td>

    </tr>

    <tr>

    • <th i18n:translate="">No Sort or group:</th> <td> </td> <td> </td> <td><input type="radio" name="@sort" value=""></td> <td><input type="radio" name="@group" value=""></td>

    </tr>

    <tr> <th i18n:translate="">Pagesize:</th> <td><input name="@pagesize" size="3" value="50"

    • tal:attributes="value request/form/@pagesize/value | default"></td>

    </tr>

    <tr> <th i18n:translate="">Start With:</th> <td><input name="@startwith" size="3" value="0"

    • tal:attributes="value request/form/@startwith/value | default"></td>

    </tr>

    <tr> <th i18n:translate="">Sort Descending:</th> <td><input type="checkbox" name="@sortdir"

    • tal:attributes="checked python:request.sort[0] == '-' or request.sort[0] is None">

    </td> </tr>

    <tr> <th i18n:translate="">Group Descending:</th> <td><input type="checkbox" name="@groupdir"

    • tal:attributes="checked python:request.group[0] == '-'">

    </td> </tr>

    <tr tal:condition="python:request.user.hasPermission('Edit', 'query')">

    • <th i18n:translate="">Query name**:</th> <td tal:define="value request/form/@queryname/value | nothing">

      • <input name="@queryname" tal:attributes="value value"> <input type="hidden" name="@old-queryname" tal:attributes="value value">

      </td>

    </tr>

    <tr>

    • <td>

      •   <input type="hidden" name="@action" value="regexp_search">

      </td> <td><input type="submit" value="Search" i18n:attributes="value"></td>

    </tr>

    <tr><td> </td>

    • <td colspan="4" class="help" i18n:translate="">

      • : The "all text" field will look in message bodies and issue titles<br> <span tal:condition="python:request.user.hasPermission('Edit', 'query')">

      • *: If you supply a name, the query will be saved off and available as a
        • link in the sidebar

        </span>

      </td>

    </tr> </table>

    </form>

    <disabled script language="javascript" type="text/javascript">

    • //<!-- onClick_RegExp(); //-->

    <disabled /script>

    </td>

    </tal:block> <!-- SHA: d7999f394badc861c290fe332cb72634191352fc -->

And here is the new action handler source code::