loops/expert/browser/search.pt

443 lines
No EOL
17 KiB
XML

<html i18n:domain="loops">
<!-- $Id$ -->
<div metal:define-macro="quicksearch"
class="top-actions quicksearch">
<form method="get" action="search.html">
<input type="text" name="search.text"
tal:attributes="value request/search.text|string:" />
<input type="submit" name="search.submit" value="Search"
i18n:attributes="value" />
</form>
</div>
<div metal:define-macro="quicksearch_view" id="search.results"
tal:define="item nocall:view">
<h1 i18n:translate="">Search results</h1><br />
<metal:results use-macro="item/search_macros/results" />
</div>
<metal:search define-macro="search"
i18n:domain="loops">
<div id="search"
tal:define="macros item/search_macros;
idPrefix string:${view/itemNum}.search;
formId string:$idPrefix.form;
resultsId string:$idPrefix.results;
submitted request/search.submitted|nothing">
<h1 tal:attributes="class string:content-$level;
ondblclick item/openEditWindow"
tal:content="item/title">
Search
</h1>
<div class="message"
tal:define="message request/message|nothing"
tal:condition="message"
tal:content="message" />
<form action="." method="post" id="1.search.form"
tal:attributes="id formId">
<div metal:define-macro="search_form" class="searchForm">
<fieldset class="box">
<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', 'state']">
<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"><br />
<input type="submit" name="button.search" value="Search" class="submit"
i18n:attributes="value" />
</td>
</tr>
</table>
</fieldset>
</div>
<tal:results condition="request/search.submitted|nothing">
<metal:results use-macro="item/search_macros/search_results" />
</tal:results>
</form>
</div>
</metal:search>
<div metal:define-macro="search_results" id="search.results"
tal:define="item nocall:item|nocall:view">
<input type="hidden" name="form.action"
tal:attributes="value item/form_action" />
<fieldset class="box">
<h2 i18n:translate="">Search results</h2>
<metal:results define-macro="results">
<table class="listing" summary="Search results"
i18n:attributes="summary">
<thead>
<tr>
<th tal:condition="item/showActions"
class="checkbox">
<input type="checkbox"
onchange="checked = this.checked;
dojo.query('.select_item').forEach(function(n) {
n.checked = checked;});" /></th>
<th i18n:translate="">Title</th>
<th i18n:translate="">Type</th>
<th i18n:translate=""
tal:condition="view/useVersioning">V</th>
<th i18n:translate="">Size</th>
<th i18n:translate="">Modification Date</th>
<th i18n:translate="">Author(s)</th>
<th i18n:translate=""
tal:condition="view/showObjectActions">Info</th>
</tr>
</thead>
<tbody>
<tal:items tal:repeat="row item/results">
<tal:item define="class python: repeat['row'].odd() and 'even' or 'odd';
description row/description;
targetUrl python:view.getUrlForTarget(row);
selected_uids request/selection|python:[]">
<tr tal:attributes="class class">
<td tal:condition="item/showActions|nothing"
tal:define="uid row/uniqueId"
class="checkbox">
<input type="checkbox" name="selection:list" class="select_item"
tal:attributes="value uid;
checked python:
uid in selected_uids" /></td>
<td>
<a tal:attributes="href string:$targetUrl?version=this;
title description">
<img tal:define="icon row/icon"
tal:condition="icon"
tal:attributes="src icon/src" />
<div tal:content="row/listingTitle" /></a>
</td>
<td i18n:translate="" class="center"
tal:content="row/longTypeTitle|row/typeTitle">Type</td>
<tal:version condition="view/useVersioning">
<td class="center"
tal:define="versionId row/versionId|string:">
<a tal:condition="not:row/versionable/notVersioned|nothing"
tal:content="versionId"
tal:omit-tag="python: versionId and versionId=='1.1'"
tal:attributes="href
string:$targetUrl?loops.viewName=listversions">1.1</a>
</td>
</tal:version>
<td class="nowrap number">
<span tal:replace="row/context/sizeForDisplay|string:">Size</span>
</td>
<td><span tal:replace="row/modified">modified</span></td>
<td><span tal:replace="row/creators">John</span></td>
<td class="nowrap center"
tal:define="target nocall:row;
style nothing"
tal:condition="view/showObjectActions">
<div metal:use-macro="views/node_macros/object_actions" />
</td>
</tr>
</tal:item>
</tal:items>
</tbody>
</table>
</metal:results>
<metal:actions use-macro="item/search_macros/actions" />
</fieldset>
</div>
<div metal:define-macro="search_row" id="1.1.row"
tal:define="rowNum item/rowNum;
basicIdPrefix idPrefix;
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">
<h2 i18n:translate="">Type(s) to search for</h2>
</td>
<tr>
<td></td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">
<span i18n:translate="">Type</span>:</label>
<select name="text"
tal:define="name string:$namePrefix.text;
value request/?name|nothing"
tal:attributes="name name;
id string:$idPrefix.text;">
<tal:types repeat="type item/typesForSearch">
<option value="loops:*"
i18n:translate=""
tal:attributes="value type/token;
selected python: 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">
<h2 i18n:translate="">Text-based search</h2>
</td>
<tr>
<td></td>
<td>
<input type="checkbox" value="yes"
tal:define="name string:$namePrefix.title"
tal:attributes="name name;
id string:$idPrefix.title;
checked request/?name|not:submitted|string:yes" />
<label for="title"
i18n:translate=""
tal:attributes="for string:$idPrefix.title">Title</label>
<input type="checkbox" value="yes"
tal:define="name string:$namePrefix.full"
tal:attributes="name name;
id string:$idPrefix.full;
checked request/?name|nothing" />
<label for="full"
i18n:translate=""
tal:attributes="for string:$idPrefix.full">Full text</label>&nbsp;&nbsp;
</td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">
<span i18n:translate="">Search text</span>:</label>
</td>
<td>
<input type="text"
tal:define="name string:$namePrefix.text"
tal:attributes="name name;
id string:$idPrefix.text;
value request/?name|nothing" />
<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">
<h2 i18n:translate="">Search via related concepts</h2>
</td>
<tr tal:repeat="type item/presetSearchTypes">
<tal:preset define="rowNum item/rowNum;
idPrefix string:$basicIdPrefix.$rowNum;
namePrefix string:search.$rowNum;">
<td></td>
<td>
<span i18n:translate="">Type</span>:
<b tal:content="type/title" i18n:translate="" />
<input type="hidden" name="type" value=""
tal:attributes="name string:$namePrefix.type;
value type/token" />
</td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">
<span i18n:translate="">Concept for Search</span>:</label>
</td>
<td>
<select name="text_selected"
tal:define="name string:$namePrefix.text_selected;
value request/?name|nothing"
tal:attributes="name name;
id string:$idPrefix.text;">
<tal:concepts repeat="concept python: item.conceptsForType(type['token'])">
<option tal:attributes="value concept/token;
selected python: value == concept['token']"
i18n:translate=""
tal:content="concept/title">Zope Corp</option>
</tal:concepts>
</select>
</td>
</tal:preset>
</tr>
<tr>
<td></td>
<td>
<label for="type"
tal:attributes="for string:$idPrefix.type">
<span i18n:translate="">Type</span>:</label>
<select name="type"
tal:define="name string:$namePrefix.type;
global conceptTypeValue request/?name|string:"
tal:attributes="name name;
id string:$idPrefix.type;
value conceptTypeValue;
onChange string:setConceptTypeForComboBox('$idPrefix.type', '$idPrefix.text')">
<tal:types repeat="type item/conceptTypesForSearch">
<option value="loops:*"
i18n:translate=""
tal:attributes="value type/token;
selected python: conceptTypeValue == type.token"
tal:content="type/title">Topic</option>
</tal:types>
</select>&nbsp;&nbsp;
</td>
<td>
<label for="text"
tal:attributes="for string:$idPrefix.text">
<span i18n:translate="">Concept for Search</span>:</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;
name string:$namePrefix.text;
value request/?name|nothing;
concept python:
value and view.getObjectForUid(value);
displayValue python:
concept and concept.title or u''">
<div dojoType="dojox.data.QueryReadStore" jsId="conceptSearch"
url="listConceptsForComboBox.js?searchType="
tal:attributes="url
string:listConceptsForComboBox.js?searchType=$conceptTypeValue">
</div>
<input dojoType="dijit.form.FilteringSelect" store="conceptSearch"
autoComplete="False" labelAttr="name" style="height: 16px"
name="concept.search.text" id="concept.search.text"
tal:attributes="name name;
id string:$idPrefix.text;
displayedValue displayValue" />
</tal:combo>
</td>
</tr>
</metal:text>
<metal:text define-macro="state"
tal:define="stateDefs item/statesDefinitions;
deftype string:resource"
tal:condition="stateDefs">
<tr>
<td metal:use-macro="macros/minus"/>
<td colspan="3">
<h2 i18n:translate="">Restrict to objects with certain states</h2>
</td>
<tr>
<td></td>
<th i18n:translate="">Workflow</th>
<th colspan="2"
i18n:translate="">States</th>
</tr>
<tr tal:repeat="def stateDefs">
<td></td>
<td valign="top"
tal:content="def/name"
i18n:translate=""></td>
<td colspan="2">
<tal:states repeat="state def/states">
<tal:state define="xx_name string:state.$deftype.${def/name};
name string:state.${def/name};
value state/name">
<input type="checkbox"
tal:attributes="name string:$name:list;
value value;
checked python:
value in item.selectedStates.get(name, ());
id string:$name.$value"
/>&nbsp;<label tal:content="state/title"
i18n:translate=""
tal:attributes="for string:$name.$value" />
&nbsp;
</tal:state>
</tal:states>
</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', 'state']" />&nbsp;
</td>
<div metal:define-macro="actions"
tal:condition="item/showActions">
<div id="search_actions_plus"
onclick="dojo.query('#search_actions').style('display', 'block');
dojo.query('#search_actions_plus').style('display', 'none')" >
<img src="/++resource++cybertools.icons/plus.gif" />Show Actions</div>
<div id="search_actions" style="display: none">
<h4 onclick="dojo.query('#search_actions_plus').style('display', 'block');
dojo.query('#search_actions').style('display', 'none')">
<img src="/++resource++cybertools.icons/minus.gif" />Actions for Selected Objects</h4>
<div class="buttons">
<div tal:define="stateDefs item/statesDefinitions;"
tal:condition="stateDefs">
<table>
<tr tal:repeat="def stateDefs">
<td>
<input type="submit" name="action.change_state"
value="Change state" class="submit"
tal:condition="repeat/def/start"
i18n:attributes="value" /></td>
<td valign="top"
tal:content="def/name"
i18n:translate=""></td>
<td tal:define="transitions def/transitions">
<select tal:attributes="name string:trans.${def/name}">
<option i18n:translate="" value="-">No change</option>
<option tal:repeat="trans transitions"
tal:attributes="value trans/name"
tal:content="trans/title">publish</option>
</select>
</td>
</tr>
</table><br />
</div>
<div>
<input type="submit" name="action.delete"
value="Delete objects" class="submit"
onClick="confirm('Do you really want to delete the selected objects?')"
i18n:attributes="value; onclick" /></div>
</div>
</div>
</div>
</html>