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

Last change on this file since 3435 was 3435, checked in by Henrik Bettermann, 16 years ago

abbreviate file names

  • Property svn:keywords set to Id
File size: 10.4 KB
RevLine 
[3277]1<metal:html tal:define="info options/info;
[3292]2            portal_status_message options/psm|request/portal_status_message;
[3277]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" />
[3285]21        <br />
22        <input type="submit" name="upload" value="Upload"
[3277]23               class="destructive" />
24      </form>
[3292]25      <span tal:condition="info/wrong">
[3297]26        <h2>Non-importable Uploads</h2>
[3292]27        <form  action="" method="post" class="group"
28               tal:attributes="action info/action"
29               >
[3318]30          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content" border=0>     
[3292]31            <tr>
32              <th></th>
33              <th>Filename</th>
34              <th>Data Layout</th>
[3318]35              <th>Uploaded By</th>
[3297]36              <th>Upload Date</th>
37              <th>Error Message</th>
[3292]38            </tr>           
[3314]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                <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
50                <td tal:content="string:${row/id}.csv" ></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>
[3318]63             
[3314]64              <tr>
[3318]65                <td>&nbsp;</td>
66                <td>&nbsp;</td>
67                <td>&nbsp;</td>
68                <td colspan="3">&nbsp;</td>
[3314]69              </tr>
[3318]70              <tr>
71                <th></th>
[3319]72                <th>Current Column Title</th>
[3318]73                <th>Possible Field Names</th>
74                <th colspan="3">First Record (Example)</th>
75              </tr>
[3316]76              <tr tal:repeat="key row/fields">
[3318]77                <td />
[3314]78                <td colspan="1">
[3316]79                  <font tal:attributes="color python: test(key[3],'red','black')">
[3318]80                    <span tal:content="python: key[0]" tal:omit-tag=""/>
[3316]81                    <span tal:condition="python: key[3]" tal:content="python: key[3]" tal:omit-tag=""/>
82                  </font>
[3314]83                </td>
84                <td colspan="1"
85                    tal:define="old_key python: key[0];new_key python: key[1];">
[3316]86                  <select tal:attributes="name string:${row/id}|${repeat/key/index}.valid_key:record">
[3292]87                    <option tal:repeat="new row/valid_keys"
[3316]88                            tal:attributes="value new; selected python: new_key == new"
[3292]89                            tal:content="new" />
[3314]90                  </select><br />
91                </td>
[3318]92                <td colspan="3" tal:content="python: key[2]" />
[3314]93              </tr>
[3326]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             
[3314]104            </span>
105            </table>
[3297]106         
107         
[3319]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.
[3306]111          If you have accidentally chosen the wrong import data layout, select the correct layout and press the Edit button.  </font>
[3297]112                   
113          <br /><br />
[3292]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                 />
[3297]120          <input type="submit" name="edit" value="Edit"
[3292]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">
[3297]131        <h2>Importable Uploads</h2>
[3292]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>
[3318]140              <th>Uploaded By</th>
[3297]141              <th>Upload Date</th>
[3292]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 tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
154              <td tal:content="string:${row/id}.csv" ></td>
155              <td tal:content="row/import_layout"></td>
156              <td tal:content="row/uploaded_by" ></td>
157              <td tal:content="row/upload_date" ></td>
158              <td tal:content="row/msg" ></td>
159            </tr>
160          </table>
161          <br />
162          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
163                 onclick="someJavaScriptFunctionThatWillBeReplaced"
164                 i18n:attributes="value"
165                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
166                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
167                 />
[3297]168          <input type="submit" name="import_uploads:method" value="Import"
[3307]169                 tal:condition="info/import_allowed"
[3292]170                 class="destructive" i18n:attributes="value"
171                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
172                 (cpsmcat('description_confirm_delete'), )"
173                 />
[3318]174          <input type="submit" name="goto_edit" value="Re-edit"
[3314]175                 class="destructive" i18n:attributes="value"
176                 />
[3292]177          <input type="submit" name="folder_delete:method" value="button_delete"
178                 class="destructive" i18n:attributes="value"
179                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
180                 (cpsmcat('description_confirm_delete'), )"
181                 />
182        </form>
183      </span>
184      <span tal:condition="info/imported">
[3297]185        <h2>Imported Uploads</h2>
[3292]186        <form action="" method="post" class="group"
187              tal:attributes="action info/action"
188              >
189          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
190            <tr>
[3308]191              <th>File in Archive</th>
[3292]192              <th>Data Layout</th>
[3308]193              <th>Uploaded By</th>
194              <th>Upload Date</th>
195              <th>Imported By</th>
[3292]196              <th>Import Date</th>
197              <th>Message</th>
[3326]198              <th>Downloads</th>
[3292]199            </tr>           
200            <tr tal:repeat="row info/imported"
201                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
[3435]202              <td nowrap tal:condition="python:len(row['id']) > 30" tal:content="python:row['id'][:30] + '[...].done'" ></td>
203              <td tal:condition="python:len(row['id']) <= 30" tal:content="python:row['id'] + '.done'" ></td>
[3292]204              <td tal:content="row/import_layout"></td>
205              <td tal:content="row/uploaded_by" ></td>
206              <td tal:content="row/upload_date" ></td>
[3308]207              <td tal:content="row/imported_by" ></td>
208              <td tal:content="row/import_date" ></td>
[3292]209              <td tal:content="row/msg"></td>
[3326]210              <td nowrap> <a href="view" tal:attributes="href string:${row/url}/download_pending">all pendings</a> <br /><br />
211                              <a href="view" tal:attributes="href string:${row/url}/download_errors">only errors</a>  </td>
[3292]212            </tr>
213          </table>
214        </form>
215      </span>
[3277]216    </metal:main>
217    <metal:sub fill-slot="sub"/>
218  </metal:body>
219</metal:html>
Note: See TracBrowser for help on using the repository browser.