diff --git a/CHANGELOG.md b/CHANGELOG.md index db162b92527ce937fca6e6eecc0f1f66c22dc2e7..1f9260a1c049c31ff724b3e1d4205e2976d038d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * A `#version_history` URI fragment which can be used to directly open the modal with the full version history of the first entity on the page. +* `BUILD_MODULE_SHOW_ID_IN_LABEL` build variable with which the showing of + entity ids together with their names if it is enabled (disabled by default). ### Changed (for changes in existing functionality) diff --git a/build.properties.d/00_default.properties b/build.properties.d/00_default.properties index 535a6c846a5c39c48937dee43f087501f43285ae..60616622c34259e572f3c1f984574972595e9316 100644 --- a/build.properties.d/00_default.properties +++ b/build.properties.d/00_default.properties @@ -53,6 +53,7 @@ BUILD_MODULE_EXT_ADD_QUERY_TO_BOOKMARKS=DISABLED BUILD_MODULE_EXT_ANNOTATION=ENABLED BUILD_MODULE_EXT_COSMETICS_LINKIFY=DISABLED BUILD_MODULE_EXT_QRCODE=ENABLED +BUILD_MODULE_SHOW_ID_IN_LABEL=DISABLED BUILD_MODULE_USER_MANAGEMENT=ENABLED BUILD_MODULE_USER_MANAGEMENT_CHANGE_OWN_PASSWORD_REALM=CaosDB diff --git a/src/core/css/webcaosdb.css b/src/core/css/webcaosdb.css index b76a5fe9ecc9f6d866dc159429ef7401ac3ddd5d..8fe10a153887a0c051846734a5a40cc195666f5b 100644 --- a/src/core/css/webcaosdb.css +++ b/src/core/css/webcaosdb.css @@ -279,9 +279,17 @@ h5 { left: 0px; } +.caosdb-label-link { + text-decoration: none; +} + +.caosdb-label-id { + margin-right: 0.3em; + display: none; +} + .caosdb-label-name { font-weight: bold; - text-decoration: none; } /* lists of values */ diff --git a/src/core/js/webcaosdb.js b/src/core/js/webcaosdb.js index 270c8891703ad4c257c514aef88701f15977170f..6d8971c044af8231dddb6c9d8f9b823262120ca9 100644 --- a/src/core/js/webcaosdb.js +++ b/src/core/js/webcaosdb.js @@ -4,8 +4,10 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen - * Copyright (C) 2019 IndiScale GmbH (info@indiscale.com) - * Copyright (C) 2019 Timm Fitschen (t.fitschen@indiscale.com) + * Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> + * Copyright (C) 2019 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> + * Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -1959,6 +1961,14 @@ function initOnDocumentReady() { if ("${BUILD_MODULE_USER_MANAGEMENT}" == "ENABLED") { caosdb_modules.register(user_management); } + + if ("${BUILD_MODULE_SHOW_ID_IN_LABEL}" == "ENABLED") { + // Remove the "display: none;" rule from the caosdb-label-id class + [...document.styleSheets] + .map(s => {return [...s.cssRules].find(x=> x.selectorText=='.caosdb-label-id')}) + .filter(Boolean) + .forEach( rule => rule.style.removeProperty("display")); + } } diff --git a/src/core/xsl/entity.xsl b/src/core/xsl/entity.xsl index d8ba00a9810e9861bfba741055ea113c7f2b88bc..ab7979367d2f77204a1e0c2e8acd9d5810649911 100644 --- a/src/core/xsl/entity.xsl +++ b/src/core/xsl/entity.xsl @@ -5,6 +5,10 @@ * * Copyright (C) 2018 Research Group Biomedical Physics, * Max-Planck-Institute for Dynamics and Self-Organization Göttingen + * Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> + * Copyright (C) 2021 Timm Fitschen <t.fitschen@indiscale.com> + * Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> + * Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -146,11 +150,14 @@ </xsl:for-each> </xsl:if> </span> - <a class="caosdb-label-name" title="Open this Entity separately."> + <a class="caosdb-label-link" title="Open this Entity separately."> <xsl:attribute name="href"> <xsl:value-of select="concat($entitypath, @id)"/> </xsl:attribute> - <xsl:value-of select="@name"/> + <span class="caosdb-label-id"><xsl:value-of select="@id"/></span> + <span class="caosdb-label-name"> + <xsl:value-of select="@name"/> + </span> </a> <div class="caosdb-v-entity-header-buttons-list ms-auto"> <xsl:apply-templates mode="entity-heading-attributes-state" select="State">