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

Last change on this file since 4818 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
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>
[4525]49               
50                <td> <a href="view" tal:attributes="href string:${row/url}/download_data"> <span tal:content="string:${row/id}.csv" /> </a></td>
[3314]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                 />
[4117]120          <input type="submit" name="edit" value="Save"
[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>
[4525]153              <td> <a href="view" tal:attributes="href string:${row/url}/download_data"> <span tal:content="string:${row/id}.csv" /> </a></td>
[3292]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                 />
[3297]166          <input type="submit" name="import_uploads:method" value="Import"
[3307]167                 tal:condition="info/import_allowed"
[3292]168                 class="destructive" i18n:attributes="value"
169                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
170                 (cpsmcat('description_confirm_delete'), )"
171                 />
[4117]172          <input type="submit" name="goto_edit" value="Edit File Header"
[3314]173                 class="destructive" i18n:attributes="value"
174                 />
[3292]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">
[3511]183        <h2>Imported Uploads (last ten)</h2>
[3292]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>
[3308]189              <th>File in Archive</th>
[3292]190              <th>Data Layout</th>
[3308]191              <th>Uploaded By</th>
192              <th>Upload Date</th>
193              <th>Imported By</th>
[3292]194              <th>Import Date</th>
195              <th>Message</th>
[3326]196              <th>Downloads</th>
[3292]197            </tr>           
[3511]198            <tr tal:repeat="row python:info['imported'][:10]"
[3292]199                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
[3759]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>
[3292]202              <td tal:content="row/import_layout"></td>
203              <td tal:content="row/uploaded_by" ></td>
204              <td tal:content="row/upload_date" ></td>
[3308]205              <td tal:content="row/imported_by" ></td>
206              <td tal:content="row/import_date" ></td>
[3292]207              <td tal:content="row/msg"></td>
[4120]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>
[3292]210            </tr>
211          </table>
212        </form>
213      </span>
[3277]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.