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.
tabellio.searchform/tabellio/searchform/advsearch-pfb.pt

116 lines
4.3 KiB
XML

<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="tabellio.searchform">
<body>
<metal:main fill-slot="main">
<tal:main-macro metal:define-macro="main">
<tal:block tal:define="Batch python:modules['Products.CMFPlone'].Batch;
mq python:modules['ZTUtils'].make_query;
url batch_base_url | request/ACTUAL_URL;
batchformkeys batchformkeys|nothing;
batchlinkparams python:batchformkeys and dict([(key, unicode(request.form[key]).encode('utf-8')) for key in batchformkeys if key in request]) or dict([(key, unicode(request.form[key]).encode('utf-8')) for key in request.form]);
b_size python:10; b_size request/b_size | b_size;
b_start python:0;b_start request/b_start | b_start;">
<h1 class="documentFirstHeading">Recherche avancée</h1>
<a id="other-search" href="pfbsearch">Recherche</a>
<div id="deputies-results" class="advbox">
<h2 id="b_deputy_start">Députés</h2>
<form method="post" tal:attributes="action string:${view/deputiesform_url}">
<div tal:replace="structure view/deputy_search_form"/>
</form>
</div>
<div id="docs-results" class="advbox">
<h2 id="b_doc_start">Documents</h2>
<form method="post" tal:attributes="action string:${view/docform_url}#resultsbox">
<div tal:replace="structure view/document_pfb_search_form"/>
</form>
</div>
<div id="events-results" class="advbox">
<h2 id="b_event_start">Événements</h2>
<form method="post" tal:attributes="action string:${view/eventform_url}#resultsbox">
<div tal:replace="structure view/event_search_form"/>
</form>
</div>
<div tal:replace="structure provider:plone.belowcontentbody" />
<script type="text/javascript" tal:content="string: var PORTAL_URL='${view/portal_url}';"/>
<script metal:use-macro="view/js_macros/macros/labelboxes"></script>
<script type="text/javascript">
function sync_from_checkboxes(elem, dummyinput)
{
t = '';
$(elem).find('span.option').each(function(idx, el) {
if ($(el).find('input').attr('checked')) {
if (t.length > 0) {
t = t + ', ';
}
t = t + $(el).find('label span').text();
}
});
$(dummyinput).attr('value', t);
}
function setup_appearance(index, elem)
{
var dummyinput = $('<input type="text" readonly="readonly"/>');
sync_from_checkboxes(elem, dummyinput);
dummyinput.click(function() {
$(elem).find('div.droppedcheckboxes').toggle();
});
$(elem).find('.fieldErrorBox').after(dummyinput);
$(elem).find('span.option').wrapAll('<div class="droppedcheckboxes">').click(function() {
sync_from_checkboxes(elem, dummyinput);
});
$(elem).find('div.droppedcheckboxes').hide();
}
function setup_sort_on(index, elem)
{
$(elem).find('label.horizontal').click(function() {
$(elem).find('div.droppedradios').toggle();
});
$(elem).find('span.option').wrapAll('<div class="droppedradios">');
$(elem).find('div.droppedradios').hide();
}
(function($) {
$().ready(function() {
$('#formfield-document-widgets-l_doctypes').each(setup_appearance);
$('#formfield-document-widgets-l_topics').each(setup_appearance);
$('#formfield-document-widgets-l_polgroups').each(setup_appearance);
$('#formfield-document-widgets-sort_on').hide();
$('select.date-field').each(function() {
$(this).parent().contents().filter(function() {
return (this.nodeType==3 || $(this).hasClass('date-field'));
}).wrapAll('<div class="date-field">');
});
$('div.date-field').each(function() {
var parent = $(this).parent();
$(this).detach().appendTo(parent);
});
$('div.advbox h2').click(function() { $(this).parent().find('form').toggle(); });
});
})(jQuery);
</script>
</tal:block>
</tal:main-macro>
</metal:main>
</body>
</html>