diff src/main/webapp/browse/entityDetails.xhtml @ 148:b40a84944716

add public/private editing to Entity Details.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Tue, 11 Jul 2017 17:44:50 +0200
parents 1389c83028ef
children 2522985f44af
line wrap: on
line diff
--- a/src/main/webapp/browse/entityDetails.xhtml	Mon Jul 10 20:41:19 2017 +0200
+++ b/src/main/webapp/browse/entityDetails.xhtml	Tue Jul 11 17:44:50 2017 +0200
@@ -20,7 +20,6 @@
 			<h:panelGrid columns="1"
 				style="margin-left: auto; margin-right: auto; text-align: center; width: 700px">
 
-
 				<hr/>
 				
 				<h:panelGrid columns="3" styleClass="controlPanel">
@@ -73,6 +72,38 @@
 					<h:panelGrid id="entityDetailsPanel" columns="1"
 						styleClass="entityDetailsPanel" columnClasses="createPanelFirstColumn">
 
+                        <h:outputText value="Publication state: #{Session.entDetailsForm.entity.privacity}" styleClass="titlePanel"/>
+                        
+                        <h:panelGroup
+                            rendered="#{Session.canEdit}"
+                            style="display:block; margin-left:auto; margin-right:auto;">
+                            
+                            <a4j:commandButton value="Make entity public" title="Change publication state of this entity"
+                                rendered="#{!Session.entDetailsForm.entity.isPublic}"
+                                style="margin-right:10px;"
+                                onclick="if(!confirm('Do you really want to make this entity public?')){ return; };"
+                                action="#{Session.entDetailsForm.actionChangeEntityPrivacity}"/>
+                            <a4j:commandButton value="Make entity private" title="Change publication state of this entity"
+                                rendered="#{Session.entDetailsForm.entity.isPublic}"
+                                style="margin-right:10px;"
+                                onclick="if(!confirm('Do you really want to make this entity private?')){ return; };"
+                                action="#{Session.entDetailsForm.actionChangeEntityPrivacity}"/>
+                            
+                            <a4j:commandButton value="Make related entities public" 
+                                title="Change publication state of directly related entities"
+                                rendered="#{Session.entDetailsForm.entity.isPublic}"
+                                style="margin-right:10px;"
+                                onclick="if(!confirm('Do you really want to make all related entities public?')){ return; };"
+                                action="#{Session.entDetailsForm.actionChangeRelatedEntitiesPrivacity}"/>
+                            <a4j:commandButton value="Make related entities private" 
+                                title="Change publication state of directly related entities"
+                                rendered="#{!Session.entDetailsForm.entity.isPublic}"
+                                style="margin-right:10px;"
+                                onclick="if(!confirm('Do you really want to make all related entities private?')){ return; };"
+                                action="#{Session.entDetailsForm.actionChangeRelatedEntitiesPrivacity}"/>
+                            
+                        </h:panelGroup>
+
 						<h:outputText value="Attributes" styleClass="titlePanel"/>
 						
 						<rich:dataTable id="entity"