source: WAeUP_SRP/trunk/skins/waeup_default/waeup_search_form.pt @ 1717

Last change on this file since 1717 was 1717, checked in by Henrik Bettermann, 17 years ago

waeup search form added (temporary solution until academics_search is ready)

File size: 5.0 KB
Line 
1<html xmlns:tal="http://xml.zope.org/namespaces/tal"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      metal:use-macro="here/main_template/macros/master">
4  <body>
5  <metal:block metal:fill-slot="main">
6  <tal:block define="SearchableText python:request.get('SearchableText','');
7                     sort_by python:request.get('sort_by', '');
8                     direction python:request.get('direction', '');
9                     folder_prefix python:request.get('folder_prefix', '');
10                     items python:here.search(query=request.form,
11                                              sort_by=sort_by,
12                                              direction=direction,
13                                              folder_prefix=folder_prefix);
14                     nav_action string:search_form;
15                     no_form python:1;
16                     site_wide python:1;
17                     items_length python:len(items);
18                     format string:detail;
19                     filter python:0;
20                     title_search request/title_search|nothing;
21                     swr request/search_within_results|nothing;
22                    ">
23
24    <div style="text-align:right;" class="group">
25      <form id="searchFormBottom" method="get" action="search_form"
26        onsubmit="return checkEmptySearch(this)">
27        <div class="label">
28          <label for="resultSearchText"
29                 i18n:translate="label_text_to_search">
30            Text to search
31          </label>
32        <input type="text" name="SearchableText" id="resultSearchText"
33               value="" class="focus" size="40"
34               tal:attributes="value SearchableText" />
35        <input class="standalone searchButton" type="submit" value="button_ok"
36               i18n:attributes="value" />
37        </div>
38        <tal:block condition="not:swr">
39          <metal:block
40            use-macro="here/generic_lib_search_folder_prefix_option/macros/search_folder_prefix_option" />
41        </tal:block>
42        <tal:block condition="swr"
43          define="criteria python:['search_within_results', 'title_search',
44                                   'folder_prefix', 'review_state'];
45                  criteria_list python:['portal_type'];">
46          <tal:block repeat="criterion criteria">
47            <input type="hidden" tal:condition="value"
48              tal:define="value request/?criterion|nothing"
49              tal:attributes="name criterion;
50                              value value" />
51          </tal:block>
52          <tal:block repeat="criterion criteria_list">
53            <tal:block tal:condition="values"
54               tal:define="values request/?criterion|nothing">
55              <tal:block repeat="value values">
56                <input type="hidden"
57                  tal:define="value value"
58                  tal:attributes="name python:criterion+':list'; value value" />
59              </tal:block>
60            </tal:block>
61          </tal:block>
62        </tal:block>
63     </form>
64    </div>
65                   
66    <h3 tal:condition="not:title_search"
67      i18n:translate="heading_search_results">Search Results</h3>
68    <h3 tal:condition="title_search"
69      tal:content="title_search">Title for search results</h3>
70
71    <p tal:condition="python:items_length == 0">
72      <tal:block i18n:translate="legend_no_search_result">
73        Your query gave no result.
74      </tal:block>
75      <tal:block i18n:translate="legend_search_for">
76        You searched for
77      </tal:block>
78      <span class="searchFor" tal:content="SearchableText">SearchableText</span>.
79    </p>
80    <p tal:condition="python:items_length == 1"
81       i18n:translate="legend_one_search_result">
82      Your query gave 1 result.
83    </p>
84    <p tal:condition="python:items_length > 1"
85       i18n:translate="">
86      Your query gave <span class="emphasis"
87                            tal:content="items_length"
88                            i18n:name="nb_results">n</span> results.
89    </p>
90
91     
92<table width="100%" cellspacing="0" cellpadding="2"
93      class="folderButtons"
94      tal:define="can_add python:checkPerm('Add portal content', here);
95                  can_del python:checkPerm('Delete objects', here);">
96
97
98
99  <thead>
100  <tr><td><strong>Title</strong></td><td><strong>Id</strong></td><td><strong>Type</strong></td>
101      <td><strong>Status</strong></td></tr>
102  </thead>
103
104  <tbody tal:repeat="item items">
105
106  <tr><td></td><td></td><td></td></tr>
107
108  <tr tal:define="objURL string:${item/getURL}/view;
109                  objPath item/getPath;
110                  title item/Title;
111                 ">
112  <td>
113  <a href="url"
114      tal:attributes="href objURL">
115   <span tal:content="python: title or '(No title)'" />
116  </a>
117  </td>
118
119  <td i18n:translate="">
120    <span tal:replace="item/id" />
121  </td>
122 
123  <td>
124    <span tal:replace="item/portal_type" />
125  </td>
126
127  <td>
128    <span tal:replace="item/review_state" />
129  </td>
130
131 </tr>
132
133
134 </tbody>
135</table>
136
137
138
139
140    <div style="text-align:right;" class="group">
141    </div>
142  </tal:block>
143
144  </metal:block>
145  </body>
146</html>
Note: See TracBrowser for help on using the repository browser.