From 25c379a0f0915f3a1408d43b3345452c12f3df28 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Fri, 2 Dec 2022 16:54:07 +0100 Subject: [PATCH] ENH: Set classes and attributes in xslt depending on build variable --- src/core/webcaosdb.xsl | 8 ++++++++ src/core/xsl/entity.xsl | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/core/webcaosdb.xsl b/src/core/webcaosdb.xsl index 96a09c92..c990e322 100644 --- a/src/core/webcaosdb.xsl +++ b/src/core/webcaosdb.xsl @@ -66,6 +66,14 @@ <xsl:call-template name="caosdb-head-js" /> </head> <body data-hidden-properties="false"> + <xsl:choose> + <xsl:when test="'${BUILD_MODULE_EXT_PROPERTY_DISPLAY}'='ENABLED'"> + <xsl:attribute name="data-hidden-properties">true</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="data-hidden-properties">false</xsl:attribute> + </xsl:otherwise> + </xsl:choose> <xsl:attribute name="data-response-count"> <xsl:value-of select="/Response/@count"/> </xsl:attribute> diff --git a/src/core/xsl/entity.xsl b/src/core/xsl/entity.xsl index bcb9aacd..264136f0 100644 --- a/src/core/xsl/entity.xsl +++ b/src/core/xsl/entity.xsl @@ -232,8 +232,15 @@ </xsl:template> <!-- PROPERTIES --> <xsl:template match="Property" mode="entity-body"> - <!-- all properties are now hidden by default --> - <li class="list-group-item caosdb-v-property-row caosdb-f-entity-property caosdb-v-hidden-property"> + <li> + <xsl:choose> + <xsl:when test="'${BUILD_MODULE_EXT_PROPERTY_DISPLAY}'='ENABLED'"> + <xsl:attribute name="class">list-group-item caosdb-v-property-row caosdb-f-entity-property caosdb-v-hidden-property</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="class">list-group-item caosdb-v-property-row caosdb-f-entity-property</xsl:attribute> + </xsl:otherwise> + </xsl:choose> <xsl:attribute name="id"> <xsl:value-of select="generate-id()"/> </xsl:attribute> -- GitLab