Project

General

Profile

« Previous | Next » 

Revision 7928

clean up data upload section

View differences:

lib/style/common/templates/metacatui/entryForm.tmpl
1303 1303
						</div>
1304 1304
						<div id="collapseUploadData" class="accordion-body collapse in">
1305 1305
							<div class="accordion-inner">
1306
								
1306 1307
								<!--  the INPUT -->
1307
								<div class="control-group">
1308
									<label class="control-label" for="fileUpload"></label>
1309
									<div class="controls">
1310
										<table class="tables" cellpadding="5" cellspacing="0" id="uploadTable">
1311
										  <tr class="sectbody">
1312
										    <td class="rightCol"><span class="label">Upload Data File:</span></td>
1313
										    <td colspan="5">
1314
										        <input type="file" id="file_element" name="file_1" class="longwidth">
1315
										
1316
										        [% IF form == 're_entry' && upCount %]
1317
										           [% cnt = 0 %]
1318
										           [% WHILE cnt < upCount %]
1319
										                [% SET fileSum = "upload_${cnt}" %]
1320
										                [% SET fileName = "uploadname_${cnt}" %]
1321
										                [% SET fileType = "uploadtype_${cnt}" %] 
1322
										                [% SET filePerm = "uploadperm_${cnt}" %]
1323
										                [% IF fileSum %]
1324
										                    <input type="hidden" name="[%fileSum%]" value="[% $fileSum %]"> 
1325
										                    <input type="hidden" name="[%fileName%]" value="[% $fileName %]"> 
1326
										                    <input type="hidden" name="[%fileType%]" value="[% $fileType %]"> 
1327
										                [% END %]
1328
										                [% cnt = cnt + 1 %]
1329
										            [% END %]
1330
										        <input type="hidden" id="upCount" name="upCount" value="[%upCount%]">
1331
										        [% END %]
1332
										
1333
										        <input type="hidden" id="fileCount" name="fileCount" value="[%fileCount%]"></td>
1334
										  </tr>
1335
										  <tr class="sectbody">
1336
										    <td class="rightCol" valign="top"><span class="label">Attached Files:</span></td>
1337
										    <td colspan="5" class="regtext">
1308
								<table class="tables" cellpadding="5" cellspacing="0" id="uploadTable">
1309
									<tr class="sectbody">
1310
									    <td class="rightCol"><span class="text-info">Upload Data File</span></td>
1311
									    <td colspan="5">
1312
								        	<input type="file" id="file_element" name="file_1" class="longwidth">
1313
								
1314
									        [% IF form == 're_entry' && upCount %]
1315
									           [% cnt = 0 %]
1316
									           [% WHILE cnt < upCount %]
1317
									                [% SET fileSum = "upload_${cnt}" %]
1318
									                [% SET fileName = "uploadname_${cnt}" %]
1319
									                [% SET fileType = "uploadtype_${cnt}" %] 
1320
									                [% SET filePerm = "uploadperm_${cnt}" %]
1321
									                [% IF fileSum %]
1322
									                    <input type="hidden" name="[%fileSum%]" value="[% $fileSum %]"> 
1323
									                    <input type="hidden" name="[%fileName%]" value="[% $fileName %]"> 
1324
									                    <input type="hidden" name="[%fileType%]" value="[% $fileType %]"> 
1325
									                [% END %]
1326
									                [% cnt = cnt + 1 %]
1327
									            [% END %]
1328
									        <input type="hidden" id="upCount" name="upCount" value="[%upCount%]">
1329
									        [% END %]
1330
									
1331
									        <input type="hidden" id="fileCount" name="fileCount" value="[%fileCount%]">
1332
										</td>
1333
									</tr>
1334
									<tr class="sectbody">
1335
										<td class="rightCol" valign="top"><span class="text-info">Attached Files</span></td>
1336
										<td colspan="5" class="regtext">
1338 1337
										    [% IF !upCount %]
1339 1338
										        <div id="file_comment">
1340 1339
										            (<i>None currently attached</i>)
1341 1340
										        </div>
1342 1341
										    [% END %]
1343
										    <div id="files_list">[% IF form == 're_entry' && upCount %]
1344
										    [% cnt = 0 %]
1345
										
1346
										    [% WHILE cnt < upCount %]
1347
										        [% SET fileName = "uploadname_${cnt}" %]
1348
										        [% SET filePerm = "uploadperm_${cnt}" %]
1349
										        [% IF $filePerm == 'public' %]
1350
										          [% SET perm_a = "checked" %]
1351
										          [% SET perm_b = "" %]
1352
										        [% ELSE %]
1353
										          [% SET perm_a = "" %]
1354
										          [% SET perm_b = "checked" %]
1355
										        [% END %]
1356
										        [% IF fileName %]<div>
1357
										          [% $fileName %]
1358
										          <input type="radio" name="[% filePerm %]" value="public" [% perm_a %]> Public
1359
										          <input type="radio" name="[% filePerm %]" value="private" [% perm_b %]> Private
1360
										
1361
										          <input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>[% END %]
1362
										
1363
										        [% cnt = cnt + 1 %]
1364
										    [% END %]
1365
										    [% END %]</div></td>
1366
										  </tr>
1367
										  </table>
1368
										  
1369
										  <script language="JavaScript" type="text/JavaScript">
1370
										    var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10);
1371
										    multi_selector.addElement( document.getElementById( 'file_element' ) );
1372
										  </script>
1373
										
1374
										
1375
									</div>
1376
								</div>
1342
										    <div id="files_list">
1343
											    [% IF form == 're_entry' && upCount %]
1344
											    	[% cnt = 0 %]
1345
											
1346
												    [% WHILE cnt < upCount %]
1347
												        [% SET fileName = "uploadname_${cnt}" %]
1348
												        [% SET filePerm = "uploadperm_${cnt}" %]
1349
												        [% IF $filePerm == 'public' %]
1350
												          [% SET perm_a = "checked" %]
1351
												          [% SET perm_b = "" %]
1352
												        [% ELSE %]
1353
												          [% SET perm_a = "" %]
1354
												          [% SET perm_b = "checked" %]
1355
												        [% END %]
1356
												        [% IF fileName %]<div>
1357
												          [% $fileName %]
1358
												          <label class="radio inline">
1359
															<input type="radio" name="[% filePerm %]" value="public" [% perm_a %]> Public
1360
												          </label>
1361
												          <label class="radio inline">	
1362
												          	<input type="radio" name="[% filePerm %]" value="private" [% perm_b %]> Private
1363
												          </label>
1364
												          <label class="text inline">	
1365
															<input type="button" value="Delete" onclick="deleteFile(event, [%fileName%]);"/></div>
1366
														[% END %]
1367
												
1368
												        [% cnt = cnt + 1 %]
1369
												    [% END %]
1370
										    	[% END %]
1371
										    </div>
1372
										</td>
1373
									</tr>
1374
								</table>
1375
								  
1376
								<script language="JavaScript" type="text/JavaScript">
1377
									var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10);
1378
								    multi_selector.addElement( document.getElementById( 'file_element' ) );
1379
								</script>
1380
							
1377 1381
								
1378 1382
						    </div>
1379 1383
						</div>

Also available in: Unified diff