comparison doc/customizing.txt @ 1730:2dd6b4c825e9

Final touches to fix query editing. It should work now.
author Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
date Sun, 10 Aug 2003 10:30:56 +0000
parents 3c3e44aacdb4
children 5f15fb95180c ae5ed85b111a
comparison
equal deleted inserted replaced
1729:8996815813df 1730:2dd6b4c825e9
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.92 $ 5 :Version: $Revision: 1.93 $
6 6
7 .. This document borrows from the ZopeBook section on ZPT. The original is at: 7 .. This document borrows from the ZopeBook section on ZPT. The original is at:
8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
9 9
10 .. contents:: 10 .. contents::
2430 ``<a href="issue?@template=search">Search Issues</a>``. This shows us 2430 ``<a href="issue?@template=search">Search Issues</a>``. This shows us
2431 that when you click on "Search Issues" it will be looking for a 2431 that when you click on "Search Issues" it will be looking for a
2432 ``issue.search.html`` file to display. So that is the file that we will 2432 ``issue.search.html`` file to display. So that is the file that we will
2433 change. 2433 change.
2434 2434
2435 This file should begin to look familiar, by now. It is a simple HTML 2435 If you look at this file it should be starting to seem familiar, although it
2436 form using a table to define structure. You can add the new category 2436 does use some new macros. You can add the new category search code anywhere you
2437 search code anywhere you like within that form:: 2437 like within that form::
2438 2438
2439 <tr> 2439 <tr tal:define="name string:category;
2440 <th>Category:</th> 2440 db_klass string:category;
2441 <td> 2441 db_content string:name;">
2442 <th>Priority:</th>
2443 <td metal:use-macro="search_select"></td>
2444 <td metal:use-macro="column_input"></td>
2445 <td metal:use-macro="sort_input"></td>
2446 <td metal:use-macro="group_input"></td>
2447 </tr>
2448
2449 The definitions in the <tr> opening tag are used by the macros:
2450
2451 - search_select expands to a drop-down box with all categories using db_klass
2452 and db_content.
2453 - column_input expands to a checkbox for selecting what columns should be
2454 displayed.
2455 - sort_input expands to a radio button for selecting what property should be
2456 sorted on.
2457 - group_input expands to a radio button for selecting what property should be
2458 group on.
2459
2460 The category search code above would expand to the following::
2461
2462 <tr>
2463 <th>Category:</th>
2464 <td>
2442 <select name="category"> 2465 <select name="category">
2443 <option value="">don't care</option> 2466 <option value="">don't care</option>
2444 <option value="">------------</option> 2467 <option value="">------------</option>
2445 <option tal:repeat="s db/category/list" 2468 <option value="1">scipy</option>
2446 tal:attributes="value s/name" 2469 <option value="2">chaco</option>
2447 tal:content="s/name">category to filter on</option> 2470 <option value="3">weave</option>
2448 </select> 2471 </select>
2449 </td> 2472 </td>
2450 <td><input type="checkbox" name=":columns" value="category" 2473 <td><input type="checkbox" name=":columns" value="category"></td>
2451 checked></td> 2474 <td><input type="radio" name=":sort" value="category"></td>
2452 <td><input type="radio" name=":sort" value="category"></td> 2475 <td><input type="radio" name=":group" value="category"></td>
2453 <td><input type="radio" name=":group" value="category"></td> 2476 </tr>
2454 </tr>
2455
2456 Most of this is straightforward to anyone who knows HTML. It is just
2457 setting up a select list followed by a checkbox and a couple of radio
2458 buttons.
2459
2460 The ``tal:repeat`` part repeats the tag for every item in the "category"
2461 table and sets "s" to each category in turn.
2462
2463 The ``tal:attributes`` part is setting up the ``value=`` part of the
2464 option tag to be the name part of "s", which is the current category in
2465 the loop.
2466
2467 The ``tal:content`` part is setting the contents of the option tag to be
2468 the name part of "s" again. For objects more complex than category,
2469 obviously you would put an id in the value, and the descriptive part in
2470 the content; but for categories they are the same.
2471
2472 2477
2473 Adding category to the default view 2478 Adding category to the default view
2474 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2479 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2475 2480
2476 We can now add categories, add issues with categories, and search for 2481 We can now add categories, add issues with categories, and search for

Roundup Issue Tracker: http://roundup-tracker.org/