Skip to content

Commit

Permalink
Named template ldh:LoadBlock folded into the ldh:LoadBlock mode
Browse files Browse the repository at this point in the history
Fixed `$progress-container` value?
  • Loading branch information
namedgraph committed Sep 18, 2024
1 parent 1331225 commit cc9c6eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,9 @@ exclude-result-prefixes="#all"
<xsl:when test="$block/@about">
<xsl:for-each select="$block">
<xsl:variable name="doc" select="ixsl:get(ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || ac:absolute-path(xs:anyURI(ixsl:location())) || '`'), 'results')" as="document-node()"/>
<xsl:call-template name="ldh:LoadBlock">
<xsl:apply-templates select="." mode="ldh:LoadBlock">
<xsl:with-param name="doc" select="$doc"/>
</xsl:call-template>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
<!-- remove content that hasn't been saved yet -->
Expand Down Expand Up @@ -872,29 +872,16 @@ exclude-result-prefixes="#all"
<xsl:param name="acl-modes" as="xs:anyURI*"/>
<xsl:param name="doc" as="document-node()"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>

<xsl:call-template name="ldh:LoadBlock">
<xsl:with-param name="acl-modes" select="$acl-modes"/>
<xsl:with-param name="doc" select="$doc"/>
<xsl:with-param name="refresh-content" select="$refresh-content"/>
</xsl:call-template>
</xsl:template>

<xsl:template name="ldh:LoadBlock">
<xsl:context-item as="element()" use="required"/> <!-- block HTML element -->
<xsl:param name="acl-modes" as="xs:anyURI*"/>
<xsl:param name="doc" as="document-node()"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>

<xsl:variable name="this" select="ancestor::div[@about][1]/@about" as="xs:anyURI"/> <!-- the page URL -->
<xsl:variable name="block-uri" select="(@about, $this)[1]" as="xs:anyURI"/> <!-- fallback to @about for charts, queries etc. -->
<xsl:param name="this" select="ancestor::div[@about][1]/@about" as="xs:anyURI"/> <!-- the page URL -->
<xsl:param name="block-uri" select="(@about, $this)[1]" as="xs:anyURI"/> <!-- fallback to @about for charts, queries etc. -->
<xsl:message>
serialize(.): <xsl:value-of select="serialize(.)"/>
serialize(ancestor::div[@about]): <xsl:value-of select="ancestor::div[@about]"/>
ldh:LoadBlock @about: <xsl:value-of select="@about"/> @id: <xsl:value-of select="@id"/> $this: <xsl:value-of select="$this"/>
</xsl:message>

<xsl:variable name="progress-container" select="if (contains-token(@class, 'row-fluid')) then ./div[contains-token(@class, 'main')] else ." as="element()"/>
<!-- <xsl:variable name="progress-container" select="if (contains-token(@class, 'row-fluid')) then ./div[contains-token(@class, 'main')] else ." as="element()"/> -->
<xsl:variable name="progress-container" select=".//div[contains-token(@class, 'main')]" as="element()"/>
<xsl:message>
$progress-container: <xsl:value-of select="serialize($progress-container)"/>
</xsl:message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,9 @@ WHERE

<!-- if the updated resource is a content resource, load it TO-DO: this belongs in content.xsl -->
<!-- <xsl:if test="contains-token($new-block/@class, 'content')">-->
<xsl:call-template name="ldh:LoadBlock">
<xsl:apply-templates select="." mode="ldh:LoadBlock">
<xsl:with-param name="doc" select="$resources"/>
<!-- <xsl:with-param name="container" select="$container"/>-->
</xsl:call-template>
</xsl:apply-templates>
<!-- </xsl:if>-->

<!-- <xsl:if test="contains-token($new-block/@class, 'post-construct')"> -->
Expand Down

0 comments on commit cc9c6eb

Please sign in to comment.