loops/search/search.pt
helmutm 1437934070 loops - work in progress: assign concepts via dojo.Dialog
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1379 fd906abe-77d9-0310-91a1-e0d9ade77398
2006-10-02 08:22:05 +00:00

201 lines
6.8 KiB
XML

<metal:search define-macro="search">
<div id="search"
tal:define="macros item/template/macros;
idPrefix string:${view/itemNum}.search;
formId string:$idPrefix.form;
resultsId string:$idPrefix.results">
<h3 tal:attributes="class string:content-$level;
ondblclick item/openEditWindow">
Search
</h3>
<div metal:define-macro="search_form" class="searchForm">
<fieldset class="box">
<form action="." method="post" id="1.search.form"
tal:attributes="id formId">
<input type="hidden" name="search.submitted" value="yes" />
<input type="hidden" name="search.resultsId" value="1.results"
tal:attributes="value resultsId" />
<table cellpadding="3">
<tal:block repeat="search_param python: ['type', 'text', 'concept']">
<metal:row use-macro="macros/search_row" />
</tal:block>
<tr tal:condition="nothing">
<td colspan="2">
<input type="button" value="Add concept filter" class="button" />
<input type="button" value="Add attribute filter" class="button" />
</td>
</tr>
<tr>
<td></td>
<td colspan="3">
<input type="submit" name="button.search" value="Search" class="submit"
tal:attributes="onclick python:
item.submitReplacing(resultsId, formId, view)" />
</td>
</tr>
</table>
</form>
</fieldset>
</div>
<div metal:define-macro="search_results" id="1.search.results"
tal:attributes="id resultsId | request/search.resultsId">
<fieldset class="box"
tal:condition="request/search.submitted | nothing">
<legend>Search results</legend>
<table class="listing" summary="Search results"
i18n:attributes="summary">
<thead>
<tr>
<th i18n:translate="label_title">Title</th>
<th i18n:translate="label_type">Type</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="row view/results">
<td>
<a tal:attributes="href string:${view/url}/.target${row/uniqueId}"
tal:content="row/title" />
</td>
<td tal:content="row/typeTitle">
</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>
</metal:search>
<div metal:define-macro="search_row" id="1.1.row"
tal:define="rowNum item/rowNum;
idPrefix string:$idPrefix.$rowNum;
namePrefix string:search.$rowNum;
param search_param | item/searchParam"
tal:attributes="id string:$idPrefix.row">
<div metal:use-macro="macros/?param" />
</div>
<metal:text define-macro="type">
<tr>
<td metal:use-macro="macros/minus"/>
<td colspan="3">
<h3>Type(s) to search for</h3>
</td>
<tr>
<td></td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">Type:</label>
<select name="text"
tal:attributes="name string:$namePrefix.text;
id string:$idPrefix.text;">
<tal:types repeat="type item/typesForSearch">
<option value="loops:*"
i18n:translate=""
tal:attributes="value type/token"
tal:content="type/title">Topic</option>
</tal:types>
</select>
<input type="button" value="+"
title="Add type"
tal:condition="nothing" />&nbsp;
</td>
<td colspan="2"></td>
</tr>
</metal:text>
<metal:text define-macro="text">
<tr>
<td metal:use-macro="macros/minus"/>
<td colspan="3">
<h3>Search text</h3>
</td>
<tr>
<td></td>
<td>
<input type="checkbox" checked
name="title" id="title" value="yes"
tal:attributes="name string:$namePrefix.title;
id string:$idPrefix.title;" />
<label for="title"
tal:attributes="for string:$idPrefix.title">Title</label>
<input type="checkbox"
name="full" id="full" value="yes"
tal:attributes="name string:$namePrefix.full;
id string:$idPrefix.full;" />
<label for="full"
tal:attributes="for string:$idPrefix.full">Full text</label>&nbsp;&nbsp;
</td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">Search text:</label>
</td>
<td>
<input type="text" name="text"
tal:attributes="name string:$namePrefix.text;
id string:$idPrefix.text;" />
<input type="button" value="+"
title="Add search word"
tal:condition="nothing" />&nbsp;
</td>
</tr>
</metal:text>
<metal:text define-macro="concept">
<tr>
<td metal:use-macro="macros/minus"/>
<td colspan="3">
<h3>Search via related concepts</h3>
</td>
<tr>
<td></td>
<td>
<label for="type"
tal:attributes="for string:$idPrefix.type">Type:</label>
<select name="type"
tal:attributes="name string:$namePrefix.type;
id string:$idPrefix.type;
onChange string:setConceptTypeForComboBox('$idPrefix.type', '$idPrefix.text')">
<tal:types repeat="type item/conceptTypesForSearch">
<option value="loops:*"
i18n:translate=""
tal:attributes="value type/token"
tal:content="type/title">Topic</option>
</tal:types>
</select>&nbsp;&nbsp;
</td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">Search text:</label>
<input type="text" name="text"
tal:condition="nothing"
tal:attributes="name string:$namePrefix.text;
id string:$idPrefix.text;" />
<input type="button" value="+"
title="Add type"
tal:condition="nothing" />&nbsp;
</td>
<td>
<tal:combo tal:define="dummy item/initDojo">
<input dojoType="comboBox" mode="remote" autoComplete="False"
tal:attributes="name string:$namePrefix.text;
id string:$idPrefix.text;
dataUrl string:${context/@@absolute_url}/listConceptsForComboBox.js?searchString=%{searchString}&searchType=" />
</tal:combo>
</td>
</tr>
</metal:text>
<td metal:define-macro="minus">
<input type="button" value="&minus;"
title="Remove search parameter"
tal:condition="python: param not in ['type', 'text', 'concept']" />&nbsp;
</td>