From 2fa4764aee45869c5d7b237f8f37dffb34c0e702 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 21 Apr 2020 12:36:27 +0200 Subject: [PATCH] WIP: cleanup, doc in CHANGELOG --- CHANGELOG.md | 7 ++++++- src/core/xsl/filesystem.xsl | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b48f78df..5b1de71c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated (for soon-to-be removed features) -### Removed (for now removed features) +### Removed (for now removed features) ### Security (in case of vulnerabilities) @@ -92,6 +92,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated (for soon-to-be removed features) +* Image Preview in the FileSystem. The functionality is to be replaced by real + thumbnails, which cover also non-image data-formats. The thumbnails resource + is part of the new file system API of the CaosDB Server which is currently + under development. + ### Removed (for now removed features) * Removed non-informative tests for webcaosdb.css diff --git a/src/core/xsl/filesystem.xsl b/src/core/xsl/filesystem.xsl index 95362ee7..93028ed2 100644 --- a/src/core/xsl/filesystem.xsl +++ b/src/core/xsl/filesystem.xsl @@ -48,6 +48,21 @@ </xsl:choose> </xsl:if> </xsl:template> + <!-- Thumbnails of images (Deprecated)--> + <xsl:template name="entity-body-thumbnail"> + <xsl:param name="path"/> + <xsl:if test="contains('.jpg.gif.png.svg',translate(substring($path, string-length($path) - 3), 'JPGIFNSV', 'jpgifnsv'))"> + <div class="row"> + <div class="col-sm-12"> + <img class="entity-image-preview" style="max-width: 200px; max-height: 140px;"> + <xsl:attribute name="src"> + <xsl:value-of select="concat($filesystempath,$path)"/> + </xsl:attribute> + </img> + </div> + </div> + </xsl:if> + </xsl:template> <xsl:template match="dir" mode="filesystem-item"> <li class="list-group-item"> <a class="caosdb-fs-dir"> @@ -84,6 +99,9 @@ </a> </div> </div> + <xsl:call-template name="entity-body-thumbnail"> + <xsl:with-param name="path" select="substring-after($file-uri,$filesystempath)"/> + </xsl:call-template> </li> </xsl:template> <xsl:template match="/Response/dir" mode="top-level-data"> -- GitLab