summaryrefslogtreecommitdiffstats
path: root/tabellio/searchform/simple-pfb.pt
blob: 6860d846a94316d7200f45907622e188d2044abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="context/main_template/macros/master">
  <body>


<metal:main fill-slot="main">
    <tal:main-macro metal:define-macro="main">

      <h1 class="documentFirstHeading" tal:condition="python: request.form.get('SearchableText')">Page de résultats</h1>
      <h1 class="documentFirstHeading" tal:condition="python: not request.form.get('SearchableText')">Recherche</h1>

      <a id="other-search" href="pfbadvsearch">Recherche avancée</a>

    <div id="simplesearch"
         tal:define="Batch python:modules['Products.CMFPlone'].Batch;
                mq python:modules['ZTUtils'].make_query;
                url batch_base_url | request/ACTUAL_URL;
                batchformkeys batchformkeys|nothing;
                deputy_results view/deputy_results;
                page_results view/page_results;
                doc_results view/doc_results;
                event_results view/event_results;
                b_size python:5; b_size request/b_size | b_size;
                b_start python:0;
                b_deputy_start python:0;b_deputy_start request/b_deputy_start | b_start;
                b_page_start python:0;b_page_start request/b_page_start | b_start;
                b_doc_start python:0;b_doc_start request/b_doc_start | b_start;
                b_event_start python:0;b_event_start request/b_event_start | b_start;
                deputy_batch python:Batch(list(deputy_results), b_size, int(b_deputy_start), orphan=1, b_start_str='b_deputy_start');
                page_batch python:Batch(list(page_results), b_size, int(b_page_start), orphan=1, b_start_str='b_page_start');
                doc_batch python:Batch(list(doc_results), b_size, int(b_doc_start), orphan=1, b_start_str='b_doc_start');
                event_batch python:Batch(list(event_results), b_size, int(b_event_start), orphan=1, b_start_str='b_event_start');
                ">

    <form method="get" action="pfbsearch" tal:condition="python: not request.form.get('SearchableText')">
      <input name="SearchableText" type="text"
                tal:attributes="value python: request.form.get('SearchableText')"/>
      <input type="submit" class="submit-widget" value="Recherche"/>
    </form>
    <input type="hidden" id="SearchableText" tal:condition="python: request.form.get('SearchableText')"
        tal:attributes="value python: request.form.get('SearchableText')"/>

     <div id="deputies-results" tal:condition="python:len(deputy_results)">
       <h2 id="b_deputy_start">Députés
       <span class="sorton"><select id="deputies-sort">
          <option disabled="disabled">Trier par</option>
          <option value="name">Nom</option>
          <option value="polgroup">Groupe politique</option>
        </select></span>
       </h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(deputy_results)"/></span>
       </div>

       <div class="results-var">
       <div class="results">
       <ul>
         <tal:entry tal:repeat="deputy python: deputy_batch">
         <li tal:define="oddrow repeat/deputy/odd;" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
            <h4><a href="#" tal:attributes="href deputy/getURL" tal:content="deputy/Title">Véronique Salvi</a></h4>
            <p class="intitule" tal:define="deputy_object python: deputy.getObject()">
              Groupe politique : <span tal:content="deputy_object/polgroup/to_object/title"/>
              <tal:block tal:condition="deputy_object/district">
              -
              Arrondissement : <span tal:content="deputy_object/district"/>
              </tal:block>
              <tal:block tal:condition="not: deputy_object/active">
              -
              <i>Ce député ne siège plus.</i>
              </tal:block>
            </p>
          </div></li>
          </tal:entry>
       </ul>
       </div>

       <div tal:define="batch deputy_batch">
       <div metal:use-macro="view/batch_macros/macros/navigation" />
       </div>
       </div>

     </div>

     <div id="docs-results" tal:condition="python:len(doc_results)">
       <h2 id="b_doc_start">Documents et dossiers
        <span class="sorton"><select id="docs-sort">
          <option disabled="disabled">Trier par</option>
          <option value="session">Session</option>
          <option value="type">Type</option>
          <option value="number">Numéro</option>
        </select></span>
       </h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(doc_results)"/></span>
       </div>

       <div class="results-var">
       <div class="results">
       <ul>
         <tal:entry tal:repeat="doc doc_batch">
         <li tal:define="oddrow repeat/doc/odd;" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
            <h4><a href="#" tal:attributes="href doc/getURL" tal:content="python: doc.getObject().reftitle">Véronique Salvi</a></h4>
            <p class="intitule" tal:content="doc/Title"/>
          </div></li>
          </tal:entry>
       </ul>
       </div>

       <div tal:define="batch doc_batch">
       <div metal:use-macro="view/batch_macros/macros/navigation" />
       </div>
       </div>

     </div>

     <div id="events-results" tal:condition="python:len(event_results)">
       <h2 id="b_event_start">Événements</h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(event_results)"/></span>
       </div>

       <div class="results-var">
       <div class="results">
       <ul>
         <tal:entry tal:repeat="event event_batch">
         <li tal:define="oddrow repeat/event/odd;" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
            <h4><a href="#" tal:attributes="href event/getURL" tal:content="event/Title">Véronique Salvi</a></h4>
          </div></li>
         </tal:entry>
       </ul>
       </div>

       <div tal:define="batch event_batch">
       <div metal:use-macro="view/batch_macros/macros/navigation" />
       </div>
       </div>

     </div>

     <div id="pages-results" tal:condition="python:len(page_results)">
       <h2 id="b_page_start">Ailleurs sur le site</h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(page_results)"/></span>
       </div>

       <div class="results-var">
       <div class="results">
       <ul>
         <tal:entry tal:repeat="page page_batch">
         <li tal:define="oddrow repeat/page/odd;" tal:attributes="class python: oddrow and 'odd' or 'even'"><div>
            <h4><a href="#" tal:attributes="href page/getURL" tal:content="python: page.Title or page.id">Communiqué de presse</a></h4>
            <p tal:content="page/Description">bla</p>
          </div></li>
         </tal:entry>
       </ul>
       </div>

       <div tal:define="batch page_batch">
       <div metal:use-macro="view/batch_macros/macros/navigation" />
       </div>
       </div>

     </div>

     </div>

<script metal:use-macro="view/js_macros/macros/livereload"></script>
<script>
(function($) {
  $('.sorton select').change(function() {
    var url = window.location.href.split('?')[0];
    url = url + '?SearchableText=' + $('#SearchableText').val();
    $('.sorton select').each(function() {
      url = url + '&' + this.id + '=' + $(this).val();
    });
    url = url + '#' + $(this).parent().parent()[0].id;
    window.location.href = url;
  });
})(jQuery);
</script>

    </tal:main-macro>
</metal:main>

</body>
</html>