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/docsearchpfb.pt

215 lines
8.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="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;">
<div tal:replace="structure provider:plone.abovecontenttitle" />
<h1 class="documentFirstHeading" tal:content="context/title" />
<div tal:replace="structure provider:plone.belowcontenttitle" />
<dl class="enableFormTabbing" id="search-tabs">
<dt id="fieldsetlegend-documents">Documents parlementaires</dt>
<dd id="fieldset-documents">
<form method="post" action="./#resultsbox">
<div tal:replace="structure view/document_pfb_search_form"/>
</form>
<div tal:define="search_results view/document_search_results;
search_batch python:Batch(list(search_results or []), b_size, int(b_start), orphan=1);"
tal:condition="python: search_results is not None">
<div id="resultsbox">
<span>Nombre de résultats : <span tal:content="python: len(search_results)"/></span>
</div>
<div id="results">
<ul>
<tal:entry tal:repeat="item search_batch">
<li tal:define="oddrow repeat/item/odd; object python: item.getObject()" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
<h4><a href="#" tal:attributes="href item/getURL" tal:content="python: object.doctype">Véronique Salvi</a> / <span class="session" tal:content="python: object.session"/></h4>
<p class="intitule" tal:content="item/Title"/>
<p class="authors" tal:content="python: object.get_authors_as_string()" tal:condition="python: object.authors" />
</div></li>
</tal:entry>
</ul>
</div>
<div tal:define="batch search_batch">
<div metal:use-macro="view/batch_macros/macros/navigation" />
<div metal:use-macro="view/batch_macros/macros/feed" />
</div>
</div>
</dd>
<dt id="fieldsetlegend-questions">Questions &amp; interpellations</dt>
<dd id="fieldset-questions">
<form method="post" action="./#resultsbox">
<div tal:replace="structure view/question_pfb_search_form"/>
</form>
<div tal:define="search_results view/question_search_results;
search_batch python:Batch(search_results or [], b_size, int(b_start), orphan=1);"
tal:condition="python: search_results is not None">
<input name="fieldset.current" type="hidden" value="#fieldset-questions"/>
<div id="resultsbox">
<span>Nombre de résultats : <span tal:replace="python: len(search_results)"/></span>
</div>
<div id="results">
<ul>
<tal:entry tal:repeat="item search_batch">
<li tal:define="oddrow repeat/item/odd; object python: item.getObject()" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
<h4><a href="#" tal:attributes="href item/getURL" tal:content="python: object.reftitle">Véronique Salvi</a></h4>
<p class="intitule" tal:content="item/Title"/>
<p class="authors" tal:condition="python: object.authors">Auteur(s) : <span tal:replace="python: object.get_authors_as_string()" tal:condition="python: object.authors" /></p>
</div></li>
</tal:entry>
</ul>
</div>
<div tal:define="batch search_batch">
<div metal:use-macro="view/batch_macros/macros/navigation" />
<div metal:use-macro="view/batch_macros/macros/feed" />
</div>
</div>
</dd>
<dt id="fieldsetlegend-textes">Textes adoptés</dt>
<dd id="fieldset-textes">
<form method="post" action="./#resultsbox">
<div tal:replace="structure view/adopted_document_pfb_search_form"/>
</form>
<div tal:define="search_results view/adopted_document_search_results;
search_batch python:Batch(search_results or [], b_size, int(b_start), orphan=1);"
tal:condition="python: search_results is not None">
<input name="fieldset.current" type="hidden" value="#fieldset-textes"/>
<div id="resultsbox">
<span>Nombre de résultats : <span tal:replace="python: len(search_results)"/></span>
</div>
<div id="results">
<ul>
<tal:entry tal:repeat="item search_batch">
<li tal:define="oddrow repeat/item/odd; object python: item.getObject()" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
<h4><a href="#" tal:attributes="href item/getURL" tal:content="python: object.reftitle">Véronique Salvi</a></h4>
<p class="intitule" tal:content="item/Title"/>
<p class="authors" tal:condition="python: object.authors">Auteur(s) : <span tal:replace="python: object.get_authors_as_string()" tal:condition="python: object.authors" /></p>
</div></li>
</tal:entry>
</ul>
</div>
<div tal:define="batch search_batch">
<div metal:use-macro="view/batch_macros/macros/navigation" />
<div metal:use-macro="view/batch_macros/macros/feed" />
</div>
</div>
</dd>
<div tal:replace="structure provider:plone.belowcontentbody" />
<script type="text/javascript" tal:content="string: var PORTAL_URL='${view/portal_url}';"></script>
<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 setup_default_session(index, elem)
{
if ($(elem).find('option[selected]').length == 0) {
$($(elem).find('option')[1]).attr('selected', 'selected');
}
}
(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').each(setup_sort_on);
$('#document-widgets-session').each(setup_default_session);
$('#question-widgets-session').each(setup_default_session);
$('#adopteddocument-widgets-session').each(setup_default_session);
$('#formfield-adopteddocument-widgets-l_doctypes').each(setup_appearance);
$('#formfield-adopteddocument-widgets-l_topics').each(setup_appearance);
$('#formfield-adopteddocument-widgets-l_polgroups').each(setup_appearance);
$('#formfield-adopteddocument-widgets-sort_on').each(setup_sort_on);
});
})(jQuery);
</script>
</tal:block>
</tal:main-macro>
</metal:main>
</body>
</html>