Skip to content

Commit

Permalink
GGW-369: Structures section styling
Browse files Browse the repository at this point in the history
  • Loading branch information
brianbrix committed Nov 7, 2024
1 parent 82f28d0 commit 7480bfc
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 163 deletions.
Original file line number Diff line number Diff line change
@@ -1,87 +1,73 @@
<wicket:extend>
<tr>
<td colspan="4">
<tr>
<td colspan="12">
<!-- Button Row -->
<div style="display: flex; gap: 10px; align-items: center;">
<span wicket:id="addbutton" />
</td>
<td colspan="5">
<div wicket:id="resourcePanel">
<form wicket:id="form">
<table width="40%">
<button wicket:id="importStructures">Import Structures</button>
<span wicket:id="exportStructures" style="background-color: #9fe170;" />
</div>

<tr>
<td colspan="2">
<div style="white-space: nowrap;" >
<span class="upfile" wicket:id="file" />
</div>
</td>
</tr>
<tr>
<td colspan="2">
<button wicket:id="ajaxSubmit" >Import Structures</button>
</td>
</tr>
</table>
</form>
<!-- File Input Row -->
<div style="margin-top: 10px;">
<div style="white-space: nowrap;">
<span class="upfile" wicket:id="file" />
</div>
<br><br>
</td>
<td colspan="3">
<a wicket:id="downloadLink" style="display:none;">Download</a>
<span style="background-color: #9fe170;" wicket:id="exportStructures"/>
</td>
</tr>
<br>

<tr>
<td colspan="12">
<span wicket:id="listWithPaginator">
<table class="inside" wicket:id="list">
<tr>
<td background="/TEMPLATE/ampTemplate/img_2/ins_header.gif" class="inside inside-header" colspan="7">
<b class="ins_header"><wicket:trn>Structure</wicket:trn></b>
</td>
</tr>
<tr>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title"><wicket:trn key="trn:title">Title</wicket:trn></b></td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title"><wicket:trn key="trn:description">Description</wicket:trn></b></td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title"><wicket:trn key="trn:latitude">Latitude</wicket:trn></b></td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title"><wicket:trn key="trn:longitude">Longitude</wicket:trn></b></td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title"><wicket:trn key="trn:shape">Shape</wicket:trn></b></td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left"><b class="ins_title">&nbsp;</b></td>
</tr>
<tr class="structureRow">
<td class="inside add_form_title"><span wicket:id="name" /></td>
<td class="inside add_form_description"><span wicket:id="description" /></td>
<td class="inside add_form_latitude"><span wicket:id="latitude" /></td>
<td class="inside add_form_longtitude"><span wicket:id="longitude" /></td>
<td class="inside">

<span wicket:id="openMapPopup" />
<span wicket:id=viewCoords/>
<div style="display:none; overflow: hidden;">
<span><input wicket:id="coords" style="width:2px;border: 1px solid #FFFFFF;background-color: #FFFFFF;color: white;overflow:hidden;" /></span> <span wicket:id="shape" />
</div>
<div style="display:none; overflow: hidden;">
<span><input wicket:id="tempId" style="width:2px;border: 1px solid #FFFFFF;background-color: #FFFFFF;color: white;overflow:hidden;" /></span>
</div>
<div style="display:none; overflow: hidden;">
<span><input wicket:id="structureColorId" style="width:2px;border: 1px solid #FFFFFF;background-color: #FFFFFF;color: white;overflow:hidden;" /></span>
</div>
<div id="dialog">
</div>
</td>
<td class="inside" align="left"><span wicket:id="deleteStructure"/></td>
</tr>
<!--
<tr>
<td colspan="7"><span wicket:id="structureImgList" /></td>
</tr>
-->
<tr style="background-color: white;"><td colspan="7">&nbsp;</td></tr>
</table>
<span wicket:id="paging" />
</span>
</td>
</tr>
</div>
</td>
</tr>

<!-- Main Table Content -->
<tr>
<td colspan="12">
<span wicket:id="listWithPaginator">
<table class="inside" wicket:id="list">
<tr>
<td background="/TEMPLATE/ampTemplate/img_2/ins_header.gif" class="inside inside-header" colspan="7">
<b class="ins_header"><wicket:trn>Structure</wicket:trn></b>
</td>
</tr>
<tr>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title"><wicket:trn key="trn:title">Title</wicket:trn></b>
</td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title"><wicket:trn key="trn:description">Description</wicket:trn></b>
</td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title"><wicket:trn key="trn:latitude">Latitude</wicket:trn></b>
</td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title"><wicket:trn key="trn:longitude">Longitude</wicket:trn></b>
</td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title"><wicket:trn key="trn:shape">Shape</wicket:trn></b>
</td>
<td background="/TEMPLATE/ampTemplate/img_2/ins_bg.gif" class="inside" align="left">
<b class="ins_title">&nbsp;</b>
</td>
</tr>
<tr class="structureRow">
<td class="inside add_form_title"><span wicket:id="name" /></td>
<td class="inside add_form_description"><span wicket:id="description" /></td>
<td class="inside add_form_latitude"><span wicket:id="latitude" /></td>
<td class="inside add_form_longitude"><span wicket:id="longitude" /></td>
<td class="inside">
<span wicket:id="openMapPopup" />
<span wicket:id="viewCoords" />
<div style="display:none; overflow: hidden;">
<span><input wicket:id="coords" style="width:2px;border: 1px solid #FFFFFF;background-color: #FFFFFF;color: white;overflow:hidden;" /></span>
<span wicket:id="shape" />
</div>
</td>
<td class="inside" align="left"><span wicket:id="deleteStructure" /></td>
</tr>
<tr style="background-color: white;">
<td colspan="7">&nbsp;</td>
</tr>
</table>
<span wicket:id="paging" />
</span>
</td>
</tr>
</wicket:extend>
Original file line number Diff line number Diff line change
Expand Up @@ -335,73 +335,6 @@ public void onClick(AjaxRequestTarget target) {
add(addbutton);


// final FileUploadField fileUploadField = new FileUploadField("fileUpload");
// fileUploadField.setOutputMarkupId(true);
//
// final Form<?> form = new Form<Void>("form")
// {
// private static final long serialVersionUID = 1L;
// @Override
// protected void onSubmit() {
// FileUpload upload = fileUploadField.getFileUpload();
// if (upload == null) {
// logger.info("No file uploaded");
// } else {
// logger.info("File-Name: " + upload.getClientFileName() + " File-Size: " +
// Bytes.bytes(upload.getSize()));
// try {
// XSSFWorkbook workbook = new XSSFWorkbook(upload.getInputStream());
// XSSFSheet sheet = workbook.getSheetAt(0);
// Iterator<Row> rowIterator = sheet.iterator();
// rowIterator.next();
//
// while (rowIterator.hasNext()) {
// XSSFRow row = (XSSFRow) rowIterator.next();
// String title = getStringValueFromCell(row.getCell(0));
// String description = getStringValueFromCell(row.getCell(1));
// String latitude = getStringValueFromCell(row.getCell(2));
// String longitude = getStringValueFromCell(row.getCell(3));
//
// AmpStructure stru = new AmpStructure();
// stru.setTitle(title);
// stru.setDescription(description);
// stru.setLatitude(latitude);
// stru.setLongitude(longitude);
// list.addItem(stru);
// list.goToLastPage();
// }
//
//
// } catch (IOException e) {
// throw new RuntimeException(e);
// }
// }
// }
//
// };
// form.setMultiPart(true);
// form.setMaxSize(Bytes.megabytes(10));
// form.add(fileUploadField);
//
//
// Button importStructures = new Button("importStructures");
//// importStructures.add(new AttributeModifier("disabled", "true"));
// importStructures.setOutputMarkupId(true);
// form.add(importStructures);
// fileUploadField.add(new AjaxFormComponentUpdatingBehavior("change") {
// private static final long serialVersionUID = 1L;
//
// @Override
// protected void onUpdate(AjaxRequestTarget target) {
// importStructures.setEnabled(true);
// importStructures.add(new AttributeModifier("disabled", (String) null)); // Enable the button
// target.add(importStructures);
//
// }
// });
//
// add(form);

final Model<FileItem> fileItemModel = new Model<FileItem>();
FileUploadPanel fileUpload = new FileUploadPanel("file",String.valueOf(am.getObject().getAmpActivityId()), fileItemModel);
final Form<?> form = new Form<Void>("form") {
Expand Down Expand Up @@ -449,27 +382,16 @@ protected void onSubmit() {


WebMarkupContainer rc = new WebMarkupContainer("resourcePanel");
// rc.add(new AttributeModifier("id", getToggleId()));
rc.add(form);
// rc.add(name);
rc.add(fileUpload);
rc.setOutputMarkupId(true);
add(rc);


form.add(fileUpload);
Button submit = new Button("ajaxSubmit");

// AmpButtonField submit = new AmpButtonField("ajaxSubmit", "Import Structures", true){
// @Override
// protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
// logger.info("Submitting form");
// target.add(list);
//
//
//
// }
// };
Button submit = new Button("importStructures");
submit.add(new AttributeModifier("class", new Model("importStructures button_blue_btm")));


form.add(submit);
ResourceReference resourceReference = new ResourceReference("exportData-"+ System.currentTimeMillis()) {
Expand Down Expand Up @@ -512,7 +434,7 @@ public void onClick(AjaxRequestTarget target) {
};
add(exportStructures);

exportStructures.getButton().add(new AttributeModifier("class", new Model("exportStructures button_blue_btm")));
exportStructures.getButton().add(new AttributeModifier("class", new Model("exportStructures button_green_btm")));
add(exportStructures);


Expand Down

0 comments on commit 7480bfc

Please sign in to comment.