source: WAeUP_SRP/trunk/skins/waeup_upload/uploads_form.pt @ 4586

Last change on this file since 4586 was 4525, checked in by Henrik Bettermann, 15 years ago

provide link for download import file

  • Property svn:keywords set to Id
File size: 10.3 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" border=0>     
31            <tr>
32              <th></th>
33              <th>Filename</th>
34              <th>Data Layout</th>
35              <th>Uploaded By</th>
36              <th>Upload Date</th>
37              <th>Error Message</th>
38            </tr>           
39            <span tal:repeat="row info/wrong" tal:omit-tag="">
40              <tr tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
41                <td align="left" valign="middle" style="width: 5px;">
42                  <input type="checkbox" name="ids:list" value="" id="" class="noborder"
43                         tal:define="id string:${row/id}.csv"
44                         tal:attributes="value id;
45                         id python:'cb_' + id;
46                         checked python:id in info['choosen_ids'];"
47                         />
48                </td>
49               
50                <td> <a href="view" tal:attributes="href string:${row/url}/download_data"> <span tal:content="string:${row/id}.csv" /> </a></td>
51                <td>
52                  <select name="import_layout:record" tal:attributes="name string:${row/id}.import_layout:record">
53                    <option tal:repeat="option python: context.portal_vocabularies.import_names.items()"
54                            tal:attributes="value python: option[0];
55                            selected python: option[0] == row['import_layout']"
56                            tal:content="python:option[1]" />
57                  </select>
58                </td>
59                <td tal:content="row/uploaded_by" ></td>
60                <td tal:content="row/upload_date" ></td>
61                <td tal:content="row/msg" ></td>
62              </tr>
63             
64              <tr>
65                <td>&nbsp;</td>
66                <td>&nbsp;</td>
67                <td>&nbsp;</td>
68                <td colspan="3">&nbsp;</td>
69              </tr>
70              <tr>
71                <th></th>
72                <th>Current Column Title</th>
73                <th>Possible Field Names</th>
74                <th colspan="3">First Record (Example)</th>
75              </tr>
76              <tr tal:repeat="key row/fields">
77                <td />
78                <td colspan="1">
79                  <font tal:attributes="color python: test(key[3],'red','black')">
80                    <span tal:content="python: key[0]" tal:omit-tag=""/>
81                    <span tal:condition="python: key[3]" tal:content="python: key[3]" tal:omit-tag=""/>
82                  </font>
83                </td>
84                <td colspan="1"
85                    tal:define="old_key python: key[0];new_key python: key[1];">
86                  <select tal:attributes="name string:${row/id}|${repeat/key/index}.valid_key:record">
87                    <option tal:repeat="new row/valid_keys"
88                            tal:attributes="value new; selected python: new_key == new"
89                            tal:content="new" />
90                  </select><br />
91                </td>
92                <td colspan="3" tal:content="python: key[2]" />
93              </tr>
94             
95             
96              <tr>
97                <td>&nbsp;</td>
98                <td>&nbsp;</td>
99                <td>&nbsp;</td>
100                <td colspan="3">&nbsp;</td>
101              </tr>             
102             
103             
104            </span>
105            </table>
106         
107         
108          <font color='red'>Please see error message for further information. If there are errors in the headline of the import file
109          (e.g. invalid keys in heading), you can edit the uploaded file online. Select the correct field names
110          from the select boxes provided, tick the box in the first column of the table and press the Edit button.
111          If you have accidentally chosen the wrong import data layout, select the correct layout and press the Edit button.  </font>
112                   
113          <br /><br />
114          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
115                 onclick="someJavaScriptFunctionThatWillBeReplaced"
116                 i18n:attributes="value"
117                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
118                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
119                 />
120          <input type="submit" name="edit" value="Save"
121                 class="destructive" i18n:attributes="value"
122                 />
123          <input type="submit" name="folder_delete:method" value="button_delete"
124                 class="destructive" i18n:attributes="value"
125                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
126                 (cpsmcat('description_confirm_delete'), )"
127                 />
128        </form>
129      </span>
130      <span tal:condition="info/importable">
131        <h2>Importable Uploads</h2>
132        <form action="" method="post" class="group"
133              tal:attributes="action info/action"
134              >
135          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
136            <tr>
137              <th></th>
138              <th>Filename</th>
139              <th>Data Layout</th>
140              <th>Uploaded By</th>
141              <th>Upload Date</th>
142            </tr>           
143            <tr tal:repeat="row info/importable"
144                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
145              <td align="left" valign="middle" style="width: 5px;">
146                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
147                       tal:define="id string:${row/id}.csv"
148                       tal:attributes="value id;
149                       id python:'cb_' + id;
150                       checked python:id in info['choosen_ids'];"
151                       />
152              </td>
153              <td> <a href="view" tal:attributes="href string:${row/url}/download_data"> <span tal:content="string:${row/id}.csv" /> </a></td>
154              <td tal:content="row/import_layout"></td>
155              <td tal:content="row/uploaded_by" ></td>
156              <td tal:content="row/upload_date" ></td>
157            </tr>
158          </table>
159          <br />
160          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
161                 onclick="someJavaScriptFunctionThatWillBeReplaced"
162                 i18n:attributes="value"
163                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
164                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
165                 />
166          <input type="submit" name="import_uploads:method" value="Import"
167                 tal:condition="info/import_allowed"
168                 class="destructive" i18n:attributes="value"
169                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
170                 (cpsmcat('description_confirm_delete'), )"
171                 />
172          <input type="submit" name="goto_edit" value="Edit File Header"
173                 class="destructive" i18n:attributes="value"
174                 />
175          <input type="submit" name="folder_delete:method" value="button_delete"
176                 class="destructive" i18n:attributes="value"
177                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
178                 (cpsmcat('description_confirm_delete'), )"
179                 />
180        </form>
181      </span>
182      <span tal:condition="info/imported">
183        <h2>Imported Uploads (last ten)</h2>
184        <form action="" method="post" class="group"
185              tal:attributes="action info/action"
186              >
187          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
188            <tr>
189              <th>File in Archive</th>
190              <th>Data Layout</th>
191              <th>Uploaded By</th>
192              <th>Upload Date</th>
193              <th>Imported By</th>
194              <th>Import Date</th>
195              <th>Message</th>
196              <th>Downloads</th>
197            </tr>           
198            <tr tal:repeat="row python:info['imported'][:10]"
199                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
200              <td nowrap tal:condition="python:len(row['id']) > 8" tal:content="python:row['id'][:8] + '[...].done'" ></td>
201              <td tal:condition="python:len(row['id']) <= 8" tal:content="python:row['id'] + '.done'" ></td>
202              <td tal:content="row/import_layout"></td>
203              <td tal:content="row/uploaded_by" ></td>
204              <td tal:content="row/upload_date" ></td>
205              <td tal:content="row/imported_by" ></td>
206              <td tal:content="row/import_date" ></td>
207              <td tal:content="row/msg"></td>
208              <td nowrap> <a href="view" tal:attributes="href string:${row/url}/download_pending">pending data file</a> <br /><br />
209                              <a href="view" tal:attributes="href string:${row/url}/download_errors">error messages</a>  </td>
210            </tr>
211          </table>
212        </form>
213      </span>
214    </metal:main>
215    <metal:sub fill-slot="sub"/>
216  </metal:body>
217</metal:html>
Note: See TracBrowser for help on using the repository browser.