Skip to content

Commit 26c05ba

Browse files
committed
GGW-369: Structures section styling
1 parent 82f28d0 commit 26c05ba

2 files changed

Lines changed: 8 additions & 85 deletions

File tree

amp/WEB-INF/src/org/dgfoundation/amp/onepager/components/features/sections/AmpStructuresFormSectionFeature.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
<div wicket:id="resourcePanel">
88
<form wicket:id="form">
99
<table width="40%">
10-
1110
<tr>
1211
<td colspan="2">
13-
<div style="white-space: nowrap;" >
14-
<span class="upfile" wicket:id="file" />
15-
</div>
12+
<button wicket:id="ajaxSubmit" >Import Structures</button>
1613
</td>
1714
</tr>
1815
<tr>
1916
<td colspan="2">
20-
<button wicket:id="ajaxSubmit" >Import Structures</button>
17+
<div style="white-space: nowrap;" >
18+
<span class="upfile" wicket:id="file" />
19+
</div>
2120
</td>
2221
</tr>
22+
2323
</table>
2424
</form>
2525
</div>
26-
<br><br>
26+
<br>
2727
</td>
2828
<td colspan="3">
2929
<a wicket:id="downloadLink" style="display:none;">Download</a>

amp/WEB-INF/src/org/dgfoundation/amp/onepager/components/features/sections/AmpStructuresFormSectionFeature.java

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -335,72 +335,6 @@ public void onClick(AjaxRequestTarget target) {
335335
add(addbutton);
336336

337337

338-
// final FileUploadField fileUploadField = new FileUploadField("fileUpload");
339-
// fileUploadField.setOutputMarkupId(true);
340-
//
341-
// final Form<?> form = new Form<Void>("form")
342-
// {
343-
// private static final long serialVersionUID = 1L;
344-
// @Override
345-
// protected void onSubmit() {
346-
// FileUpload upload = fileUploadField.getFileUpload();
347-
// if (upload == null) {
348-
// logger.info("No file uploaded");
349-
// } else {
350-
// logger.info("File-Name: " + upload.getClientFileName() + " File-Size: " +
351-
// Bytes.bytes(upload.getSize()));
352-
// try {
353-
// XSSFWorkbook workbook = new XSSFWorkbook(upload.getInputStream());
354-
// XSSFSheet sheet = workbook.getSheetAt(0);
355-
// Iterator<Row> rowIterator = sheet.iterator();
356-
// rowIterator.next();
357-
//
358-
// while (rowIterator.hasNext()) {
359-
// XSSFRow row = (XSSFRow) rowIterator.next();
360-
// String title = getStringValueFromCell(row.getCell(0));
361-
// String description = getStringValueFromCell(row.getCell(1));
362-
// String latitude = getStringValueFromCell(row.getCell(2));
363-
// String longitude = getStringValueFromCell(row.getCell(3));
364-
//
365-
// AmpStructure stru = new AmpStructure();
366-
// stru.setTitle(title);
367-
// stru.setDescription(description);
368-
// stru.setLatitude(latitude);
369-
// stru.setLongitude(longitude);
370-
// list.addItem(stru);
371-
// list.goToLastPage();
372-
// }
373-
//
374-
//
375-
// } catch (IOException e) {
376-
// throw new RuntimeException(e);
377-
// }
378-
// }
379-
// }
380-
//
381-
// };
382-
// form.setMultiPart(true);
383-
// form.setMaxSize(Bytes.megabytes(10));
384-
// form.add(fileUploadField);
385-
//
386-
//
387-
// Button importStructures = new Button("importStructures");
388-
//// importStructures.add(new AttributeModifier("disabled", "true"));
389-
// importStructures.setOutputMarkupId(true);
390-
// form.add(importStructures);
391-
// fileUploadField.add(new AjaxFormComponentUpdatingBehavior("change") {
392-
// private static final long serialVersionUID = 1L;
393-
//
394-
// @Override
395-
// protected void onUpdate(AjaxRequestTarget target) {
396-
// importStructures.setEnabled(true);
397-
// importStructures.add(new AttributeModifier("disabled", (String) null)); // Enable the button
398-
// target.add(importStructures);
399-
//
400-
// }
401-
// });
402-
//
403-
// add(form);
404338

405339
final Model<FileItem> fileItemModel = new Model<FileItem>();
406340
FileUploadPanel fileUpload = new FileUploadPanel("file",String.valueOf(am.getObject().getAmpActivityId()), fileItemModel);
@@ -449,27 +383,16 @@ protected void onSubmit() {
449383

450384

451385
WebMarkupContainer rc = new WebMarkupContainer("resourcePanel");
452-
// rc.add(new AttributeModifier("id", getToggleId()));
453386
rc.add(form);
454-
// rc.add(name);
455387
rc.add(fileUpload);
456388
rc.setOutputMarkupId(true);
457389
add(rc);
458390

459391

460392
form.add(fileUpload);
461393
Button submit = new Button("ajaxSubmit");
394+
submit.add(new AttributeModifier("class", new Model("addStructure button_green_btm")));
462395

463-
// AmpButtonField submit = new AmpButtonField("ajaxSubmit", "Import Structures", true){
464-
// @Override
465-
// protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
466-
// logger.info("Submitting form");
467-
// target.add(list);
468-
//
469-
//
470-
//
471-
// }
472-
// };
473396

474397
form.add(submit);
475398
ResourceReference resourceReference = new ResourceReference("exportData-"+ System.currentTimeMillis()) {
@@ -512,7 +435,7 @@ public void onClick(AjaxRequestTarget target) {
512435
};
513436
add(exportStructures);
514437

515-
exportStructures.getButton().add(new AttributeModifier("class", new Model("exportStructures button_blue_btm")));
438+
exportStructures.getButton().add(new AttributeModifier("class", new Model("addStructure button_blue_btm")));
516439
add(exportStructures);
517440

518441

0 commit comments

Comments
 (0)