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

Last change on this file since 17388 was 5613, checked in by Henrik Bettermann, 14 years ago

Improve message for pending data file.

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