source: WAeUP_SRP/base/skins/waeup_student/remove_students_form.pt @ 2402

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

fix security for remove_students

correct logging messages

File size: 7.4 KB
Line 
1<tal:block tal:define="portal_status_message options/psm;
2           students options/students;
3           info options/info|nothing;
4           is_so info/is_so;
5           allowed options/allowed|nothing;"
6           >
7<metal:body use-macro="here/main_template/macros/master">
8  <metal:main fill-slot="main">
9    <span tal:condition="not: allowed">
10      <span tal:content="here/illegal_view" />
11    </span>
12    <span tal:condition="allowed" tal:omit-tag="">
13      <h3> Remove Student Records</h3><br />
14      You are logged in as member <span tal:replace="info/member|nothing" />
15      <br /><br />
16      <form action="remove_students" method="post"
17            enctype="multipart/form-data" class="workflow">
18        <div class="">
19          <div class="documentFields">
20            <table width="" cellpadding="2" cellspacing="2" summary="Form layout">
21              <tr valign="top">
22                <td colspan="1">
23                  <div class=""
24                       id="widget__search_string_widget">
25                    <div class="label">
26                      <label for="search_string">Student Ids to be removed</label> (space-separated list)
27                    </div>
28                    <div class="field">
29                      <input name="search_string"
30                             type="text"
31                             id="search_string"
32                             value=""
33                             size="80"
34                             tal:attributes="value info/search_string"/>
35                    </div>
36                  </div>
37                </td>
38              </tr>
39            </table>
40            <input type="submit" class="standalone" name="cpsdocument_edit_button" value="Search" />
41          </div>       
42        </div>
43        <br /><br />
44        <span tal:condition="students">
45          <span
46            tal:define="items students;
47            columns python:3;
48            items_per_page python:40;
49            max_items python:300;
50            zoom python:0;
51            batches_all python:here.getBatchList(items,columns, items_per_page,zoom,max_items=400);
52            batches python:batches_all[0];
53            batch_info python:batches_all[1];
54            zoomed python:batches_all[2];
55            mq nocall:modules/ZTUtils/make_query;"
56            tal:omit-tag=""
57            >
58          <tal:block tal:condition="python: items and batch_info and batch_info['nb_pages'] > 1">
59            <div class="batchLayout">
60              <span i18n:translate="">
61                Objects:
62                <strong>
63                  <tal:block replace="batch_info/start"
64                             i18n:name="batch_start" /> - <tal:block replace="batch_info/limit"
65                                                                     i18n:name="batch_limit" />
66                </strong>
67                of <tal:block replace="batch_info/length"
68                              i18n:name="batch_length" />
69              </span>
70            </div>
71            <br />
72          </tal:block>
73            <table class="contentListing" width="100%">
74              <span tal:repeat="rows batches" tal:omit-tag="">
75                <span tal:repeat="student rows">
76                  <tr tal:condition="student"
77                      tal:attributes="class python:test(repeat['student'].even(), 'even ajaxtd', 'odd ajaxtd')">
78                    <td align="left" valign="middle" style="width: 5px;"
79                        tal:condition="is_so">
80                      <input type="checkbox" name="ids:list" value="" id="" class="noborder"
81                             tal:condition="student/show_checkbox"
82                             tal:define="id student/id"
83                             tal:attributes="value id;
84                             id python:'cb_' + id;
85                             checked python:id in info['choosen_ids'];"
86                             />
87                    </td>
88                    <td>
89                      <a href="id" tal:condition="student/show_checkbox"
90                         tal:attributes="href string:${context/portal_url}/campus/students/${student/id}"
91                         tal:content="student/id"></a>
92                      <span tal:content="student/id" tal:condition="not: student/show_checkbox" tal:omit-tag="" />
93                    </td>   
94                    <td>
95                      <span tal:replace="student/name" />
96                    </td>   
97                    <td><span tal:replace="student/matric_no" /></td>   
98                    <td><span tal:replace="student/jamb_reg_no" /></td>
99                  </tr>
100                </span>
101              </span>
102            </table>
103           
104            <br />
105
106            <div tal:condition="is_so">
107              <input type="button" value="button_select_all" class="context"
108                     onclick="someJavaScriptFunctionThatWillBeReplaced"
109                     i18n:attributes="value"
110                     tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
111                     % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
112                     />
113              <input type="submit" name="delete" value="Remove selected"
114                     class="destructive"
115                     tal:attributes="onclick python:'return window.confirm(\'%s\')' %
116                     (cpsmcat('description_confirm_delete'), )"
117                     />
118            </div>
119
120            <tal:block condition="python:batch_info and batch_info['nb_pages'] > 1">
121              <div class="pageNavigationLayout">
122                <a tal:define="previous batch_info/previous"
123                   tal:condition="python:previous is not None"
124                   tal:attributes="href python:'%s?%s'%(request['URL'],
125                   mq(request.form, b_start=0))"
126                   >
127                (&lt;&lt;)</a>
128                <a tal:define="previous batch_info/previous"
129                   tal:condition="python:previous is not None"
130                   tal:attributes="href python:'%s?%s'%(request['URL'],
131                   mq(request.form, b_start=previous))"
132                   i18n:translate="batch_previous">Previous</a>
133                <tal:block repeat="page batch_info/pages">
134                  <tal:block condition="python:page != batch_info['start'] - 1">
135                    <a tal:attributes="href python:'%s?%s'%(request['URL'],
136                    mq(request.form, b_start=page))"
137                    tal:content="repeat/page/number">1</a>&nbsp;
138                  </tal:block>
139                  <tal:block condition="python:page == batch_info['start'] - 1">
140                    <span tal:content="string:${repeat/page/number}" />&nbsp;
141                  </tal:block>
142                </tal:block>
143                <a tal:define="next batch_info/next"
144                   tal:condition="python:next is not None"
145                   tal:attributes="href python:'%s?%s'%(request['URL'],
146                   mq(request.form, b_start=next))"
147                   i18n:translate="batch_next">Next</a>
148                <a tal:define="next batch_info/next;
149                last_page python:batch_info['pages'][-1]"
150                tal:condition="python:next is not None"
151                tal:attributes="href python:'%s?%s'%(request['URL'],
152                mq(request.form, b_start=last_page))"
153                >
154                (&gt;&gt;)</a>
155              </div>
156            </tal:block>
157          </span>
158        </span>
159      </form>
160    </span>
161  </metal:main>
162</metal:body>
163</tal:block>
Note: See TracBrowser for help on using the repository browser.