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

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

further improvements: error strings are now seperated by '+'

  • Property svn:keywords set to Id
File size: 9.9 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>
94            </span>
95            </table>
[3297]96         
[3292]97          <br />
[3297]98         
[3319]99          <font color='red'>Please see error message for further information. If there are errors in the headline of the import file
100          (e.g. invalid keys in heading), you can edit the uploaded file online. Select the correct field names
101          from the select boxes provided, tick the box in the first column of the table and press the Edit button.
[3306]102          If you have accidentally chosen the wrong import data layout, select the correct layout and press the Edit button.  </font>
[3297]103                   
104          <br /><br />
[3292]105          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
106                 onclick="someJavaScriptFunctionThatWillBeReplaced"
107                 i18n:attributes="value"
108                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
109                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
110                 />
[3297]111          <input type="submit" name="edit" value="Edit"
[3292]112                 class="destructive" i18n:attributes="value"
113                 />
114          <input type="submit" name="folder_delete:method" value="button_delete"
115                 class="destructive" i18n:attributes="value"
116                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
117                 (cpsmcat('description_confirm_delete'), )"
118                 />
119        </form>
120      </span>
121      <span tal:condition="info/importable">
[3297]122        <h2>Importable Uploads</h2>
[3292]123        <form action="" method="post" class="group"
124              tal:attributes="action info/action"
125              >
126          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
127            <tr>
128              <th></th>
129              <th>Filename</th>
130              <th>Data Layout</th>
[3318]131              <th>Uploaded By</th>
[3297]132              <th>Upload Date</th>
[3292]133            </tr>           
134            <tr tal:repeat="row info/importable"
135                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
136              <td align="left" valign="middle" style="width: 5px;">
137                <input type="checkbox" name="ids:list" value="" id="" class="noborder"
138                       tal:define="id string:${row/id}.csv"
139                       tal:attributes="value id;
140                       id python:'cb_' + id;
141                       checked python:id in info['choosen_ids'];"
142                       />
143              </td>
144              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
145              <td tal:content="string:${row/id}.csv" ></td>
146              <td tal:content="row/import_layout"></td>
147              <td tal:content="row/uploaded_by" ></td>
148              <td tal:content="row/upload_date" ></td>
149              <td tal:content="row/msg" ></td>
150            </tr>
151          </table>
152          <br />
153          <input tal:condition="nothing" type="button" value="button_select_all" class="context"
154                 onclick="someJavaScriptFunctionThatWillBeReplaced"
155                 i18n:attributes="value"
156                 tal:attributes="onclick python:'toggleSelect(this, \'%s\', \'%s\')'
157                 % (cpsmcat('button_select_all'), cpsmcat('button_deselect_all'))"
158                 />
[3297]159          <input type="submit" name="import_uploads:method" value="Import"
[3307]160                 tal:condition="info/import_allowed"
[3292]161                 class="destructive" i18n:attributes="value"
162                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
163                 (cpsmcat('description_confirm_delete'), )"
164                 />
[3318]165          <input type="submit" name="goto_edit" value="Re-edit"
[3314]166                 class="destructive" i18n:attributes="value"
167                 />
[3292]168          <input type="submit" name="folder_delete:method" value="button_delete"
169                 class="destructive" i18n:attributes="value"
170                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
171                 (cpsmcat('description_confirm_delete'), )"
172                 />
173        </form>
174      </span>
175      <span tal:condition="info/imported">
[3297]176        <h2>Imported Uploads</h2>
[3292]177        <form action="" method="post" class="group"
178              tal:attributes="action info/action"
179              >
180          <table tal:condition="python: 1" class="contentListing" width="100%" summary="content layout" id="folder_content">     
181            <tr>
[3308]182              <th>File in Archive</th>
[3292]183              <th>Data Layout</th>
[3308]184              <th>Uploaded By</th>
185              <th>Upload Date</th>
186              <th>Imported By</th>
[3292]187              <th>Import Date</th>
188              <th>Message</th>
189            </tr>           
190            <tr tal:repeat="row info/imported"
191                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
192              <td tal:condition="nothing"> <a href="view" tal:attributes="href string:${row/url}"> <span tal:content="row/id" /></a>  </td>
193              <td tal:content="string:${row/id}.done" ></td>
194              <td tal:content="row/import_layout"></td>
195              <td tal:content="row/uploaded_by" ></td>
196              <td tal:content="row/upload_date" ></td>
[3308]197              <td tal:content="row/imported_by" ></td>
198              <td tal:content="row/import_date" ></td>
[3292]199              <td tal:content="row/msg"></td>
200            </tr>
201          </table>
202        </form>
203      </span>
[3277]204    </metal:main>
205    <metal:sub fill-slot="sub"/>
206  </metal:body>
207</metal:html>
Note: See TracBrowser for help on using the repository browser.