source: WAeUP_SRP/trunk/skins/waeup_directory/search_members_results.pt @ 916

Last change on this file since 916 was 916, checked in by joachim, 18 years ago

Membersearch now shows a link Roles In
the pagetemplate for the results is search_members_results
for the search_mask is search_members_form.

the search is called with search_members

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1<tal:block define="results options/results;
2  params python:here.getDisplayParams(nb_items=len(results));
3  columns python:1;
4  items_per_page params/items_per_page;
5  batches_all python:here.getBatchList(results, columns, items_per_page);
6  batch_list python:batches_all[0];
7  batch_info python:batches_all[1];
8  form request/form;
9  mq nocall:modules/ZTUtils/make_query;
10  portal_url here/portal_url;
11  dirname here/getId;
12  title_field here/title_field;
13  fields python:here.getDirectoryResultFields(dirname);
14  isAdmin python:here.portal_membership.getAuthenticatedMember().has_role(['Manager',]);
15  cpsmcat nocall:here/translation_service;
16  ">
17  <div style="padding-left: 1.5em">
18    <form action="cpsdirectory_entry_delete" method="post">
19      <table tal:condition="results" summary="search result list">
20        <tr>
21          <th tal:condition="isAdmin" i18n:translate="label_selection">
22            Selection
23          </th>
24          <tal:block repeat="field fields">
25            <th i18n:translate="" tal:content="field/title">id</th>
26          </tal:block>
27        <th>Roles In</th>
28        </tr>
29        <tal:block repeat="result python:batch_list[0]">
30          <tal:block define="id python:result[0];
31            data python:result[1];
32            even repeat/result/even;
33            ">
34            <tr tal:attributes="class python:test(even, 'even', 'odd')">
35              <tal:block repeat="field fields">
36                <tal:block tal:condition="isAdmin">
37                  <td tal:condition="not:repeat/field/index">
38                    <input type="checkbox" name="ids:list" tal:attributes="value id" />
39                  </td>
40                </tal:block>
41                <td>
42                  <a href="."
43                    tal:attributes="href string:${portal_url}/cpsdirectory_entry_view?dirname=${dirname}&id=${id}"
44                    ><strong tal:content="structure python:data.get(field['id'])">john</strong></a>
45                </td>
46              </tal:block>
47          <td tal:define="roles python:data['roles']">
48            <span tal:repeat="role roles">
49              <a href="" tal:attributes="href string:${role/getPath}/folder_localrole_form"
50                 tal:content="role/getId"></a><br />
51            </span>
52          </td>
53        </tr>
54          </tal:block>
55        </tal:block>
56      </table>
57      <div tal:condition="not:results">
58        <span i18n:translate="label_no_results" />
59      </div>
60      <p>
61        <input type="hidden" name="dirname" tal:attributes="value dirname" />
62        <input type="hidden" name="ids:tokens:default" value="" />
63        <tal:block condition="python:isAdmin and results">
64          <input type="button" value="button_select_all" class="context"
65            i18n:attributes="value"
66            tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
67            % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))" />
68          <input type="submit" class="destructive" value="button_delete"
69            i18n:attributes="value"
70            tal:attributes="onclick python:'return window.confirm(\'%s\')'
71            % cpsmcat('description_confirm_delete')" />
72        </tal:block>
73        <input type="button" class="context" value="button_back"
74          onclick="javascript:history.back()" i18n:attributes="value" />
75      </p>
76    </form>
77    <tal:block condition="python:batch_info and batch_info['nb_pages'] > 1">
78      <br />
79      <table width="100%" cellspacing="0" cellpadding="0"
80        summary="navigation layout">
81        <tr class="even">
82          <td align="center" width="100%">
83            <span i18n:translate="label_page">Pages</span>:
84            <a tal:define="previous batch_info/previous"
85               tal:condition="python:previous is not None"
86               tal:attributes="href python:'%s?%s'%(request['URL'],
87                                              mq(request.form, b_start=previous))"
88               i18n:translate="batch_previous">Previous</a>
89            <tal:block repeat="page batch_info/pages">
90              <a tal:condition="python:page != batch_info['start'] - 1"
91                tal:attributes="href python:'%s?%s'%(request['URL'],
92                mq(request.form, b_start=page))"
93                tal:content="repeat/page/number">1</a>
94              <span tal:condition="python:page == batch_info['start'] - 1"
95                tal:content="string:[${repeat/page/number}]" />
96            </tal:block>
97            <a tal:define="next batch_info/next"
98               tal:condition="python:next is not None"
99               tal:attributes="href python:'%s?%s'%(request['URL'],
100                                                  mq(request.form, b_start=next))"
101               i18n:translate="batch_next">Next</a>
102          </td>
103        </tr>
104        <tr>
105          <td>&nbsp;</td>
106        </tr>
107      </table>
108    </tal:block>
109  </div>
110</tal:block>
Note: See TracBrowser for help on using the repository browser.