summaryrefslogtreecommitdiffstats
path: root/tabellio/searchform/simple.pt
blob: 7ac53773c931754cbe1051223733ebec00461b3b (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
<!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">

    <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');
                searchable_text python: request.form.get('SearchableText');
                ">
    <form method="get" action="search2">
      <input name="SearchableText" type="text" tal:attributes="value searchable_text"/>
      <input type="submit" class="submit-widget" value="Recherche"/>
    </form>

     <div id="deputies-results" tal:condition="python:len(deputy_results)">
       <h2 id="b_deputy_start">Députés</h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(deputy_results)"/></span>
       <a class="button" tal:attributes="href view/deputy_form_url">Filtre avancé</a>
       </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) == 0 and searchable_text">
       <h2 id="b_doc_start">Documents et dossiers</h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(doc_results)"/></span>
       <a class="button" tal:attributes="href view/docdos_form_url">Filtre avancé</a>
       </div>

       <p>
         Aucun document n'a été trouvé lors d'une recherche simple, il est possible
         d'effectuer la recherche dans les textes des documents, cela peut prendre
         quelques dizaines de secondes.
       </p>

       <p>
       <a tal:attributes="href string:${view/docdos_form_url}?document.widgets.sort_on:list=Session&document.widgets.search_type_is_document=1&document.widgets.text=${searchable_text}#resultsbox">Recherche appronfondie dans les textes</a>
       </p>

     </div>

     <div id="docs-results" tal:condition="python:len(doc_results)">
       <h2 id="b_doc_start">Documents et dossiers</h2>
       <div class="resultsinfobox">
       <span>Nombre de résultats : <span tal:replace="python:len(doc_results)"/></span>
       <a class="button" tal:attributes="href view/docdos_form_url">Filtre avancé</a>
       </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>
       <a class="button" tal:attributes="href view/event_form_url">Filtre avancé</a>
       </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>
             <p><span tal:content="python: event.getObject().longdatetime"/> /
                <span tal:content="python: event.getObject().place"/></p>
          </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 type="text/javascript" tal:content="string: var PORTAL_URL='${view/portal_url}';"/>
<script metal:use-macro="view/js_macros/macros/labelboxes"></script>
<script metal:use-macro="view/js_macros/macros/livereload"></script>

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

</body>
</html>