From 0891d2420a689e46ae9f61f71325580377bed038 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 24 Jan 2017 19:18:43 +0100
Subject: [PATCH] modified html for new overlay panel

---
 .../WEB-INF/components/map/layoutPanel.xhtml  | 156 ++----------------
 1 file changed, 10 insertions(+), 146 deletions(-)

diff --git a/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml b/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml
index a405786425..d6a5b25cec 100644
--- a/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml
+++ b/web/src/main/webapp/WEB-INF/components/map/layoutPanel.xhtml
@@ -6,154 +6,18 @@
 	xmlns:cc="http://java.sun.com/jsf/composite/pfcomp"
 	xmlns:p="http://primefaces.org/ui">
 
-<h:outputStylesheet library="css" name="layouts.css"	/>
-
-<h:form id="layoutForm" class="layoutPanel">
-<p:scrollPanel	 mode="native" styleClass="bulletList"> 
-	<div class="layoutSubPanel">
-		<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
-
-		<h2 class="title">General overlays: </h2>	
-
-		<p:dataTable id="generalLayoutDataTable" rowIndexVar="rowId"	var="layout" value="#{layoutMB.generalLayouts}"
-			rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}">	
-		 	<p:column sortBy="name" headerText="Name" styleClass="highlightedColumn">	
-				<h:outputText id="name" value="#{layout.name}" />
-			</p:column>	
-	
-			<p:column style="width:4%" headerText="View">	
-				<p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="" title="#{layout.description}" update="generalLayoutDataTable, :tabView:layoutForm:layoutDataTable" ajax="true" styleClass="ui-icon-search2" rendered="#{not layout.inputDataAvailable}">	
-					<f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" />	
-				</p:commandButton>	
-				<p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/>
-			</p:column>						
-			<p:column style="width:4%" headerText="Data">	
-				<p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title="#{layout.inputDataAvailable?layout.description:'Not available'}" disabled="#{not layout.inputDataAvailable}" ajax="false"/>	
-			</p:column>						
-		</p:dataTable>	
+	<h:outputStylesheet library="css" name="global.css"	/>
+				
+<div id="overlayTab">
+	<div name="generalOverlays" class="searchPanel">	
+		<h5>GENERAL OVERLAYS:</h5>
+		<table cellpadding="4" name="generalOverlaysTab" class="table table-bordered" style="width:100%"/>
 	</div>
-	<div class="layoutSubPanel">
-					<cc:helpButton helpText='Managing custom overlays and file format is described in the &lt;a href="#{request.contextPath}/javax.faces.resource/user_guide.pdf.xhtml?ln=other" target="_user_manual_" &gt;manual&lt;/a&gt;.' style="float:right;" width="200px" my="right top" at="right bottom"/>	
-		<h2 class="title">User-provided overlays:</h2>
-		<h:panelGroup layout="block" rendered="#{userMB.loggedUser.login=='anonymous'}">
-			<center>
-				<h3 class="title"> You are not logged in. Please, log in to upload and view custom overlays</h3>	
-			</center>
-		</h:panelGroup>
-
-		<h:panelGroup layout="block" rendered="#{not (userMB.loggedUser.login=='anonymous')}">
-			<p:dataTable id="layoutDataTable" rowIndexVar="rowId" var="layout" value="#{layoutMB.customLayouts}"
-				rowStyleClass="#{('cv'.concat(layout.idObject) == mapMB.topModelMapData.selectedLayout) ? 'layoutSelectedRow' : ''}">	
-			 	<p:column sortBy="name" headerText="Name" styleClass="highlightedColumn">	
-					<h:outputText id="name" value="#{layout.name}" />
-				 	<h:outputText id="statusNotReady" value=" (status: #{layout.status} - #{layout.progress}%)" rendered="#{layout.status !='OK'}"/>	
-	 			</p:column>	
-				<p:column style="width:4%" headerText="View">	
-					<p:commandButton id="selectLayoutButton" onclick="customMap.openLayoutById('#{layout.idObject}');" icon="ui-icon-search" disabled="#{not (layout.status == 'OK')}" title="#{layout.description}" 
-						update=":tabView:layoutForm:generalLayoutDataTable, layoutDataTable" rendered="#{not layout.inputDataAvailable}" >	
-						<f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" />	
-					</p:commandButton>	
-					<p:selectBooleanCheckbox onchange="if (this.checked) customMap.addSelectedLayout(#{layout.idObject},'#{layout.name}'); else customMap.removeSelectedLayout(#{layout.idObject});" styleClass="smallCheckbox" rendered="#{layout.inputDataAvailable}"/>
-				</p:column>						
-
-				<p:column style="width:4%" headerText="Data">	
-					<p:commandButton id="downloadLayoutButton" actionListener="#{layoutMB.downloadInputData(layout)}" icon="ui-icon-arrowthickstop-1-s" title='#{layout.inputDataAvailable?layout.description:"Not available"}' disabled="#{not layout.inputDataAvailable}" ajax="false"/>	
-				</p:column>						
-
-				<p:column style="width:4%" headerText="Edit">	
-					<p:commandButton update=":#{p:component('layoutDlg')}" id="selectButton" oncomplete="PF('layoutDialog').show()" icon="ui-icon-document" title="Edit">	
-				 		<f:setPropertyActionListener value="#{layout}" target="#{layoutMB.selectedLayout}" />	
-				 	</p:commandButton>	
-			 	</p:column>						
-
-			</p:dataTable>	
-
-			<center>
-				<p:commandButton id="refreshLayoutsButton" actionListener="#{layoutMB.refreshCustomLayouts}" icon="ui-icon-refresh" update="layoutDataTable">
-				</p:commandButton>	
-			</center>
-
-			<h:panelGroup layout="block" rendered="#{not layoutMB.userHasAddLayoutPrivilege}">
-				<center>
-					<br/>
-					<h3 class="title"> You cannot add overlays. To add overlays please contact with system administartors.</h3>	
-				</center>
-			</h:panelGroup>
-
-			<p:panel id="layoutAddComponent" header = "ADDING" layout="block" rendered="#{layoutMB.userHasAddLayoutPrivilege}">
-				<h:panelGrid	columns="2" cellpadding="0" width="100%">	
-					<h:outputText value="NAME: "		styleClass="smallBoldText"/>
-					<p:inputText id="layoutName" value="#{layoutMB.layoutName}" style="width:180px !important"/>	
-
-					<h:outputText value="FILE: "	styleClass="smallBoldText"/>
 
-					<p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName,layoutType"  width="100px"/>
-<!--					<p:fileUpload fileUploadListener="#{layoutMB.handleFileUpload}" mode="advanced" auto="true" update="layoutName"  width="100px"/> -->
-
- 					<h:outputText value="TYPE: "		styleClass="smallBoldText"/>
-          <h:selectOneRadio  id="layoutType" value="#{layoutMB.layoutType}">
-            <f:selectItems value="#{layoutMB.colorSchemaTypes}" var="type" 
-              itemValue="#{type}" itemLabel="#{type}"/>
-          </h:selectOneRadio>
-	
-					<h:outputText value="AVAILABLE OVERLAYS: " styleClass="smallBoldText"/>
-					<h:outputText id="layoutNumberGreen" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{layoutMB.availableCustomLayoutNumber>0}" styleClass="greenText"/>	
-					<h:outputText id="layoutNumberRed" value="#{layoutMB.availableCustomLayoutNumber}" rendered="#{not (layoutMB.availableCustomLayoutNumber>0)}" styleClass="redText"/>	
-				</h:panelGrid>
-				<center>
-					<p:commandButton id="addLayoutButton" actionListener="#{layoutMB.addLayout}" update="layoutDataTable,layoutNumberGreen,layoutNumberRed" onclick="PF('layoutPanelBlock').show()" oncomplete="PF('layoutPanelBlock').hide()" disabled="#{not layoutMB.userHasAddLayoutPrivilege}" value="GENERATE" title="GENERATE" styleClass="mediumBoldText"/>
-				</center>
-			</p:panel>
-
-
-			<p:blockUI block="layoutAddComponent" widgetVar="layoutPanelBlock">	
-				UPLOADING<br />	
-				<p:graphicImage library="images" name="icons/ajax-loader.gif"/>
-			</p:blockUI>	
-
-		</h:panelGroup>
+	<div name="customOverlays" class="searchPanel">	
+		<h5>USER-PROVIDED OVERLAYS:</h5>
+		<table cellpadding="4" name="customOverlaysTab" class="table table-bordered"  style="width:100%"/>
 	</div>
-</p:scrollPanel>
-		<cc:helpButton helpText="Overlays tab allows to display or generate custom coloring of elements and interactions in the map. &lt;p&gt; General overlays are overlays accessible for every user viewing the content. &lt;p&gt; Custom overlays are user-provided overlays, this menu becomes available upon login (see below)." style="float:right;margin-top:53px;margin-right:29px;" at="right top"/> 
-</h:form>
-
-<h:form id="layoutForm2">	
-	<p:dialog header="Overlay Detail" widgetVar="layoutDialog" resizable="false" id="layoutDlg"	
-								showEffect="fade" modal="true">	
-		<h:panelGrid	columns="2" cellpadding="1">	
-			<h:outputText value="Id: " />
-			<h:outputText id="layoutId" value="#{layoutMB.selectedLayout.idObject}"/>	
-
-			<h:outputText value="Name: " />
-			<p:inputText id="layoutName" value="#{layoutMB.selectedLayout.name}"/>	
-
-			<h:outputText value="Description: " />
-			<p:inputTextarea id="descriptionName" value="#{layoutMB.selectedLayout.description}"/>	
-
-		</h:panelGrid	>	
-	
-		<br/>
-		<p:commandButton update=":#{p:component('layoutDataTable')}" actionListener="#{layoutMB.updateLayout}" id="saveLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-disk" value="Save" title="Save"/>	
-		<p:commandButton update=":#{p:component('layoutDataTable')}, :#{p:component('layoutNumberGreen')}, :#{p:component('layoutNumberRed')}" actionListener="#{layoutMB.removeLayout}" id="removeLayoutButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-trash" value="Remove" title="Remove"/>	
-		<p:commandButton id="cancelUserButton" oncomplete="PF('layoutDialog').hide()" icon="ui-icon-close" value="Cancel" title="Cancel"/>	
-	</p:dialog>	
-</h:form>
-
-<h:form id="layoutForm3">	
-	<h:inputHidden id="hidden2" value="#{layoutMB.visualizedLayout.name}" />
-	<h:inputHidden id="hidden_directory" value="#{layoutMB.visualizedLayout.directory}" />
-	<h:inputHidden id="hidden_layout_id" value="#{layoutMB.visualizedLayout.idObject}" />
-</h:form>
-
-<h:form id="layoutAccessAliasForm">
-	<p:remoteCommand name="_retreiveActiveAliasesForLayout" actionListener="#{layoutMB.retreiveActiveAliasesForLayout}" />
-</h:form>
-<h:form id="layoutAccessFullAliasForm">
-	<p:remoteCommand name="_retreiveFullAliasesForLayout" actionListener="#{layoutMB.retreiveFullAliasesForLayout}" />
-</h:form>
-<h:form id="layoutAccessReactionForm">
-	<p:remoteCommand name="_retreiveActiveReactionsForLayout" actionListener="#{layoutMB.retreiveActiveReactionsForLayout}" />
-</h:form>
-
 
+</div>
 </html>
-- 
GitLab