source: WAeUP_SRP/trunk/skins/waeup_pins/pins_view.pt @ 3784

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

add some simple security

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1<metal:html tal:define="info options/info;
2                        rendered options/rendered;
3                        mtool here/portal_membership;
4                        member mtool/getAuthenticatedMember;
5                        archive_allowed python: str(member) in ('admin','joachim',);
6                        ">
7  <metal:body use-macro="here/main_template/macros/master">
8    <metal:main fill-slot="main">
9      <span tal:condition="isAnon">
10      </span> 
11      <h3>Search PIN Section</h3>
12      <br />     
13      <span tal:condition="not:isAnon">
14        <span tal:replace="structure rendered" />
15      <form action="." method="post">
16        <table>
17          <tr tal:repeat="pin info/used">
18            <td>
19              <input type="checkbox" name="ids:list" value="" id="" class="noborder"
20                     tal:define="id string:${pin/serial}_${pin/prefix}"
21                     tal:attributes="value id;
22                     id python:'cb_' + id;"
23                     />
24            </td>
25            <td width="50px"> <span tal:content="pin/serial" />: </td>
26            <td tal:content="pin/pin" />
27            <td tal:content="pin/student_id" />
28            <td>
29              <a tal:condition="pin/student_url" href="" tal:content="pin/student"
30                 tal:attributes="href pin/student_url"></a>
31              <span tal:condition="python: not pin['student_url'] and not pin['student'].startswith('disabled')" tal:content="pin/student" />
32            </td>
33          </tr>
34        </table>
35
36        <span tal:condition="info/used">
37        <br />
38        <input type="submit" name="disable_pins:method"
39               value="disable pins"
40               class="destructive"
41               tal:attributes="onclick python:'return window.confirm(\'%s\')' %
42               (cpsmcat('really disable ?'), )"
43               />
44 
45        &nbsp;
46       
47        <input type="submit" name="enable_pins:method"
48               value="enable pins"
49               class="destructive"
50               tal:attributes="onclick python:'return window.confirm(\'%s\')' %
51               (cpsmcat('really enable ?'), )"
52               />
53         <br />     
54         </span>
55
56      </form>
57      <br />
58      <h3>PIN Batches</h3>
59      <form action="." method="post" class="group"
60            tal:define="rows info/batches;
61            choosen_ids info/choosen_ids|python:[]"
62            >
63        <table class="contentListing" width="100%">     
64          <tr tal:repeat="line rows"
65            tal:attributes="class python:test(repeat['line'].even(), 'even ajaxtd', 'odd ajaxtd')">
66            <span tal:repeat="row line">
67              <td align="left" valign="middle" style="width: 5px;">
68                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
69                       tal:define="id row"
70                       tal:condition="archive_allowed"                       
71                       tal:attributes="value id;
72                       id python:'cb_' + id;
73                       checked python:id in choosen_ids;"
74                       />
75              </td>
76              <td><a href="view" tal:attributes="href string:${context/absolute_url}/${row}">
77                  <strong tal:content="row" /></a> </td>
78            </span>
79          </tr>
80        </table>
81        <table width="100%" cellspacing="0" cellpadding="2"
82               class="folderButtons"
83               tal:condition="archive_allowed">
84          <tr>
85            <td align="left" valign="top" rowspan="3"></td>
86            <td align="left" valign="top">
87                <input tal:condition="nothing" type="button" value="button_select_all" class="context"
88                       onclick="someJavaScriptFunctionThatWillBeReplaced"
89                       i18n:attributes="value"
90                       tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
91                       % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
92                       />
93                <input type="submit" name="archive:method" value="Archive"
94                       class="destructive" i18n:attributes="value"
95                       />
96                <input type="submit" name="archive_delete:method" value="Archive & Delete"
97                       class="destructive" i18n:attributes="value"
98                       tal:attributes="onclick python:'return window.confirm(\'%s\')' %
99                       ('Do you really want to delete the pin batch?', )"
100                       />
101            </td>
102          </tr>
103        </table>
104      </form>
105      <form action="." method="get" tal:condition="nothing">
106        <select class="form-element" name=":action"
107                tal:attributes="onChange string:location.href='${context/absolute_url}/'+this.options[this.selectedIndex].value"
108                >
109          <option value="--">Goto Batch ...</option>
110          <option tal:repeat="batch info/batches"
111                  tal:attributes="value batch"
112                  tal:content="batch">
113          </option>
114        </select>
115      </form>
116      </span>
117    </metal:main>
118  </metal:body>
119</metal:html>
Note: See TracBrowser for help on using the repository browser.