This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
pfwbged.contact/src/pfwbged/contact/table.pt

76 lines
2.5 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="pfwbged.contact">
<body>
<metal:main fill-slot="main">
<h1 class="documentFirstHeading" tal:content="context/Title" />
<div tal:replace="structure provider:plone.belowcontenttitle" />
<div id="contact-table-view">
<div class="metatypes">
Que cherchez-vous :
<label><input value="filter-all" name="contact-filter" checked="checked" type="radio">Tout</label>
<label><input value="filter-orgs" name="contact-filter" type="radio">Organisations</label>
<label><input value="filter-persons" name="contact-filter" type="radio">Personnes</label>
</div>
<div class="criteria-content" style="display:block;">
Rechercher : <input name="text-criteria-fulltext">
</div>
<div id="searchresults"/>
</div>
<script>
$.querywidget.updateSearch = function () {
var context_url = (function() {
var baseUrl, pieces;
baseUrl = $('base').attr('href');
if (!baseUrl) {
pieces = window.location.href.split('/');
pieces.pop();
baseUrl = pieces.join('/');
}
return baseUrl;
})();
var query = context_url + "/@@querybuilder_html_results?";
query += "query.i:records=portal_type&query.o:records=plone.app.querystring.operation.selection.is&";
var filter_val = $('input[name="contact-filter"]:checked').val();
if (filter_val == "filter-all" || filter_val == "filter-orgs") {
query += "query.v:records:list=organization&";
}
if (filter_val == "filter-all" || filter_val == "filter-persons") {
query += "query.v:records:list=person&";
}
query += "query.i:records=SearchableText&query.o:records=plone.app.querystring.operation.string.contains&query.v:records=";
query += $('input[name="text-criteria-fulltext"]').val();
query += '&sort_on=sortable_title';
$.querywidget.runQuery(query);
};
$(function() {
$.querywidget.updateSearch();
$('input[name="contact-filter"]').change(function() {
$.querywidget.updateSearch();
});
$('input[name="text-criteria-fulltext"]').on('keyup', function() {
$.querywidget.updateSearch();
});
});
</script>
</metal:main>
</body>
</html>