...and the new files for the microservice validator
[scpubgit/stemmaweb.git] / root / src / testparse.tt
1 [% PROCESS header.tt
2         pagetitle = "Stemmaweb - Test a file upload"
3         applicationjs = c.uri_for( '/js/fileparse.js' )
4 %]
5
6   <div id="main_page">
7     <div id="topbanner">
8       <h1 class="title">Stemmaweb - Test a file upload</h1>
9       <p id="compatibility_check"><span class="error">This browser does not support 
10       the functions necessary for Stemmaweb to work properly. We recommend use of 
11       <a href="http://mozilla.org/firefox">Mozilla Firefox</a> or 
12       <a href="http://www.google.com/chrome">Google Chrome</a>.</span></p>
13     </div>
14
15     <div id="upload-collationform" title="Upload a collation">
16       <div id="docco">
17         <form id="new_tradition" method="POST" action="[% c.uri_for( '/microservice/parse' ) %]" enctype="multipart/form-data">
18                         <label for="new_file" id="new_file_label">Collation file: </label>
19                         <input id="new_file" name="file" type="file" onchange="file_selected(this)" required>
20             <label for="new_type">File type of this text / tradition: </label>
21             <select id="new_type" name="type">
22                 <option value="CollateX">CollateX GraphML</option>
23                 <option value="csv">Comma-separated values</option>
24                 <option value="CTE">Classical Text Editor XML export</option>
25                 <option value="tsv">Tab-separated values</option>
26                 <option value="TEI">TEI P5 parallel segmentation</option>
27                 <option value="xls">Excel 1997-2004</option>
28                 <option value="xlsx">Excel 2007+</option>
29             </select>
30             <label for="new_submit">Does it work?</label>
31             <input id="new_submit" type="submit" value="Find out">
32         </form>
33         <div id="upload_status"></div>
34         <div>
35           <h4>Supported file types / extensions:</h4>
36           <ul>
37             <li>*.txt - spreadsheet collation, tab-separated values</li>
38             <li>*.csv - spreadsheet collation, comma-separated values</li>
39             <li>*.xls - spreadsheet collation, Excel 97-2004 format</li>
40             <li>*.xlsx - spreadsheet collation, Excel 2007 XML format</li>
41             <li>*.xml - TEI XML parallel segmentation format</li>
42             <li>*.xml - TEI XML export from Classical Text Editor</li>
43             <li>*.xml - GraphML export from the CollateX tool</li>
44           </ul>
45           <p>All spreadsheet collations should be arranged with the witness sigla in the first row, and the words aligned by row each in its correct witness column.</p>
46         </div>
47       </div>
48     </div>
49     
50     <div id="parseresults" style="padding-left: 30px;">
51     [% IF result %]
52         <h3>Success! Probably.</h3>
53         <p>A tradition was successfully created, with the name [% result.name %].</p>
54     [% ELSIF errormsg %]
55                 <h3>Uh-oh, something went wrong.</h3>
56                 <p> A tradition was not created. Here is the error message:</p>
57                 <pre class="error">[% errormsg %]</pre>
58     [% END %]
59     [% IF warnings %]
60         <h3>Information and Warnings</h3>
61         <pre class="warning">[% warnings %]</pre>
62     [% END %]
63     </div>
64   </div>
65
66 [% PROCESS footer.tt %]