source: WAeUP_SRP/base/skins/waeup_upload/uploads_form.pt @ 3302

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

uploads_index.py: avoid traceback
uploads_form.pt: show instruction
upload.xml: show import_date

  • Property svn:keywords set to Id
File size: 9.0 KB
Line 
1<metal:html tal:define="info options/info;
2            portal_status_message options/psm|request/portal_status_message;
3            ds options/ds;
4            mode options/mode;
5            rendered options/rendered;"
6            >
7  <metal:body use-macro="here/main_template/macros/master">
8    <metal:block fill-slot="header">
9      <a href=""
10         tal:attributes="href string:${here/academicsParent}">
11        <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
12        Up one level
13      </a>
14      <h3 tal:content="here/title_or_id" />
15      <div tal:condition="python:0" tal:content="info/container_path"/>
16      <br />
17    </metal:block>
18    <metal:main fill-slot="main">
19      <form action="" method="post" enctype="multipart/form-data" class="group">
20        <span tal:replace="structure rendered" />
21        <br />
22        <input type="submit" name="upload" value="Upload"
23               class="destructive" />
24      </form>
25      <span tal:condition="info/wrong">
26        <h2>Non-importable Uploads</h2>
27        <form  action="" method="post" class="group"
28               tal:attributes="action info/action"
29               >
30          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
31            <tr>
32              <th></th>
33              <th>Filename</th>
34              <th>Data Layout</th>
35              <th>By</th>
36              <th>Upload Date</th>
37              <th>Error Message</th>
38              <th>Invalid Keys</th>
39            </tr>           
40            <tr tal:repeat="row info/wrong"
41                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
42              <td align="left" valign="middle" style="width: 5px;">
43                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
44                       tal:define="id string:${row/id}.csv"
45                       tal:attributes="value id;
46                       id python:'cb_' + id;
47                       checked python:id in info['choosen_ids'];"
48                       />
49              </td>
50              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
51              <td tal:content="string:${row/id}.csv" ></td>
52              <td>
53                <select name="import_layout:record" tal:attributes="name string:${row/id}.import_layout:record">
54                  <option tal:repeat="option python: context.portal_vocabularies.import_names.items()"
55                          tal:attributes="value python: option[0];
56                          selected python: option[0] == row['import_layout']"
57                          tal:content="python:option[1]" />
58                </select>
59              </td>
60              <td tal:content="row/uploaded_by" ></td>
61              <td tal:content="row/upload_date" ></td>
62              <td tal:content="row/msg" ></td>
63              <td>
64                <div tal:repeat="key row/invalid_keys">
65                  <span tal:replace="key" /><br />
66                  <select tal:attributes="name string:${row/id}|${key}.valid_key:record">
67                    <option tal:repeat="new row/valid_keys"
68                            tal:attributes="value new"
69                            tal:content="new" />
70                  </select>
71                </div>
72              </td>
73              <td tal:condition="python:0">
74                <a href="edit" tal:attributes="href string:${row/url}/external_edit_form"
75                   target="edit"
76                   onclick="javascript:window.open('','edit','width=600, height=700, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, status=no, resizable=no, dependent=no')">
77                  [edit]
78                </a>
79              </td>
80            </tr>
81          </table>
82         
83          <br />
84         
85          <font color='red'>Please see error message for further information. If there are
86          'invalid keys in heading', you can edit the uploaded file online. Select the correct keys
87          (columns titles) from the select boxes provided, check the box in the first column and press Edit.
88          If you have accidentally chosen the wrong import data layout, select the correct layout and press Edit.  </font>
89                   
90          <br /><br />
91          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
92                 onclick="someJavaScriptFunctionThatWillBeReplaced"
93                 i18n:attributes="value"
94                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
95                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
96                 />
97          <input type="submit" name="edit" value="Edit"
98                 class="destructive" i18n:attributes="value"
99                 />
100          <input type="submit" name="folder_delete:method" value="button_delete"
101                 class="destructive" i18n:attributes="value"
102                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
103                 (cpsmcat('description_confirm_delete'), )"
104                 />
105        </form>
106      </span>
107      <span tal:condition="info/importable">
108        <h2>Importable Uploads</h2>
109        <form action="" method="post" class="group"
110              tal:attributes="action info/action"
111              >
112          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
113            <tr>
114              <th></th>
115              <th>Filename</th>
116              <th>Data Layout</th>
117              <th>By</th>
118              <th>Upload Date</th>
119            </tr>           
120            <tr tal:repeat="row info/importable"
121                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
122              <td align="left" valign="middle" style="width: 5px;">
123                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
124                       tal:define="id string:${row/id}.csv"
125                       tal:attributes="value id;
126                       id python:'cb_' + id;
127                       checked python:id in info['choosen_ids'];"
128                       />
129              </td>
130              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
131              <td tal:content="string:${row/id}.csv" ></td>
132              <td tal:content="row/import_layout"></td>
133              <td tal:content="row/uploaded_by" ></td>
134              <td tal:content="row/upload_date" ></td>
135              <td tal:content="row/msg" ></td>
136            </tr>
137          </table>
138          <br />
139          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
140                 onclick="someJavaScriptFunctionThatWillBeReplaced"
141                 i18n:attributes="value"
142                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
143                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
144                 />
145          <input type="submit" name="import_uploads:method" value="Import"
146                 class="destructive" i18n:attributes="value"
147                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
148                 (cpsmcat('description_confirm_delete'), )"
149                 />
150          <input type="submit" name="folder_delete:method" value="button_delete"
151                 class="destructive" i18n:attributes="value"
152                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
153                 (cpsmcat('description_confirm_delete'), )"
154                 />
155        </form>
156      </span>
157      <span tal:condition="info/imported">
158        <h2>Imported Uploads</h2>
159        <form action="" method="post" class="group"
160              tal:attributes="action info/action"
161              >
162          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
163            <tr>
164              <th>Filename</th>
165              <th>Data Layout</th>
166              <th>By</th>
167              <th>Date</th>
168              <th>Import Date</th>
169              <th>Message</th>
170            </tr>           
171            <tr tal:repeat="row info/imported"
172                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
173              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
174              <td tal:content="string:${row/id}.done" ></td>
175              <td tal:content="row/import_layout"></td>
176              <td tal:content="row/uploaded_by" ></td>
177              <td tal:content="row/upload_date" ></td>
178              <td tal:content="row/imported_at" ></td>
179              <td tal:content="row/msg"></td>
180            </tr>
181          </table>
182        </form>
183      </span>
184    </metal:main>
185    <metal:sub fill-slot="sub"/>
186  </metal:body>
187</metal:html>
Note: See TracBrowser for help on using the repository browser.