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

Last change on this file since 10833 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
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             
[5613]64              <span tal:condition="python:'fields from pending file in headline' not in row['msg']">
[3314]65              <tr>
[3318]66                <td>&nbsp;</td>
67                <td>&nbsp;</td>
68                <td>&nbsp;</td>
69                <td colspan="3">&nbsp;</td>
[3314]70              </tr>
[3318]71              <tr>
72                <th></th>
[3319]73                <th>Current Column Title</th>
[3318]74                <th>Possible Field Names</th>
75                <th colspan="3">First Record (Example)</th>
76              </tr>
[3316]77              <tr tal:repeat="key row/fields">
[3318]78                <td />
[3314]79                <td colspan="1">
[3316]80                  <font tal:attributes="color python: test(key[3],'red','black')">
[3318]81                    <span tal:content="python: key[0]" tal:omit-tag=""/>
[3316]82                    <span tal:condition="python: key[3]" tal:content="python: key[3]" tal:omit-tag=""/>
83                  </font>
[3314]84                </td>
85                <td colspan="1"
86                    tal:define="old_key python: key[0];new_key python: key[1];">
[3316]87                  <select tal:attributes="name string:${row/id}|${repeat/key/index}.valid_key:record">
[3292]88                    <option tal:repeat="new row/valid_keys"
[3316]89                            tal:attributes="value new; selected python: new_key == new"
[3292]90                            tal:content="new" />
[3314]91                  </select><br />
92                </td>
[3318]93                <td colspan="3" tal:content="python: key[2]" />
[3314]94              </tr>
[5613]95              </span>
[3326]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             
[3314]106            </span>
107            </table>
[3297]108         
109         
[5613]110          <font color='red'>
111          Please see error message for further information. If there are errors in the headline of the import file
[3319]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.
[5613]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>
[3297]117                   
118          <br /><br />
[3292]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                 />
[4117]125          <input type="submit" name="edit" value="Save"
[3292]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">
[3297]136        <h2>Importable Uploads</h2>
[3292]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>
[3318]145              <th>Uploaded By</th>
[3297]146              <th>Upload Date</th>
[3292]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>
[4525]158              <td> <a href="view" tal:attributes="href string:${row/url}/download_data"> <span tal:content="string:${row/id}.csv" /> </a></td>
[3292]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                 />
[3297]171          <input type="submit" name="import_uploads:method" value="Import"
[3307]172                 tal:condition="info/import_allowed"
[3292]173                 class="destructive" i18n:attributes="value"
174                 tal:attributes="onclick python:'return window.confirm(\'%s\')' %
175                 (cpsmcat('description_confirm_delete'), )"
176                 />
[4117]177          <input type="submit" name="goto_edit" value="Edit File Header"
[3314]178                 class="destructive" i18n:attributes="value"
179                 />
[3292]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">
[3511]188        <h2>Imported Uploads (last ten)</h2>
[3292]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>
[3308]194              <th>File in Archive</th>
[3292]195              <th>Data Layout</th>
[3308]196              <th>Uploaded By</th>
197              <th>Upload Date</th>
198              <th>Imported By</th>
[3292]199              <th>Import Date</th>
200              <th>Message</th>
[3326]201              <th>Downloads</th>
[3292]202            </tr>           
[3511]203            <tr tal:repeat="row python:info['imported'][:10]"
[3292]204                tal:attributes="class python:test(repeat['row'].even(), 'even ajaxtd', 'odd ajaxtd')">
[3759]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>
[3292]207              <td tal:content="row/import_layout"></td>
208              <td tal:content="row/uploaded_by" ></td>
209              <td tal:content="row/upload_date" ></td>
[3308]210              <td tal:content="row/imported_by" ></td>
211              <td tal:content="row/import_date" ></td>
[3292]212              <td tal:content="row/msg"></td>
[4120]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>
[3292]215            </tr>
216          </table>
217        </form>
218      </span>
[3277]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.