Skip to content

Commit 26d1d94

Browse files
namedgraphclaude
andcommitted
Move http:Response bs2:Header templates from layout.xsl to document.xsl
layout.xsl is only imported by the server-side stylesheet, so the alert/error well wrapper for 404 responses never reached client-side rendering — proxied or re-rendered http:Response resources fell through to the generic bs2:Header (plain well + type-pill + span-wrapped title). document.xsl is imported by both client.xsl and layout.xsl, so moving the templates there makes the same markup available on both sides. Adds the lacl: namespace to document.xsl for the priority-2 access-request variant; foaf:Agent is already in scope via the client.xsl/layout.xsl entry stylesheets. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d216841 commit 26d1d94

2 files changed

Lines changed: 53 additions & 52 deletions

File tree

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/document.xsl

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE xsl:stylesheet [
33
<!ENTITY lapp "https://w3id.org/atomgraph/linkeddatahub/apps#">
4+
<!ENTITY lacl "https://w3id.org/atomgraph/linkeddatahub/admin/acl#">
45
<!ENTITY def "https://w3id.org/atomgraph/linkeddatahub/default#">
56
<!ENTITY ldh "https://w3id.org/atomgraph/linkeddatahub#">
67
<!ENTITY ac "https://w3id.org/atomgraph/client#">
@@ -35,6 +36,7 @@ xmlns:xs="http://www.w3.org/2001/XMLSchema"
3536
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
3637
xmlns:json="http://www.w3.org/2005/xpath-functions"
3738
xmlns:lapp="&lapp;"
39+
xmlns:lacl="&lacl;"
3840
xmlns:ldh="&ldh;"
3941
xmlns:ac="&ac;"
4042
xmlns:a="&a;"
@@ -1234,11 +1236,59 @@ extension-element-prefixes="ixsl"
12341236
</xsl:template>
12351237

12361238
<xsl:template match="*" mode="bs2:Create"/>
1237-
1239+
12381240
<!-- OBJECT -->
1239-
1241+
12401242
<xsl:template match="rdf:RDF" mode="bs2:Object">
12411243
<xsl:apply-templates mode="#current"/>
12421244
</xsl:template>
1243-
1245+
1246+
<!-- HEADER -->
1247+
1248+
<xsl:template match="*[rdf:type/@rdf:resource = '&http;Response'][lacl:requestAccess/@rdf:resource][$foaf:Agent]" mode="bs2:Header" priority="2">
1249+
<xsl:param name="id" as="xs:string?"/>
1250+
<xsl:param name="class" select="'alert alert-info well'" as="xs:string?"/>
1251+
1252+
<div>
1253+
<xsl:if test="$id">
1254+
<xsl:attribute name="id" select="$id"/>
1255+
</xsl:if>
1256+
<xsl:if test="$class">
1257+
<xsl:attribute name="class" select="$class"/>
1258+
</xsl:if>
1259+
1260+
<h2>
1261+
<xsl:apply-templates select="." mode="ldh:logo"/>
1262+
1263+
<xsl:apply-templates select="." mode="ac:label"/>
1264+
1265+
<button type="button" class="btn btn-primary btn-access-form pull-right">
1266+
<xsl:value-of>
1267+
<xsl:apply-templates select="key('resources', 'request-access', document('translations.rdf'))" mode="ac:label"/>
1268+
</xsl:value-of>
1269+
</button>
1270+
</h2>
1271+
</div>
1272+
</xsl:template>
1273+
1274+
<xsl:template match="*[rdf:type/@rdf:resource = '&http;Response']" mode="bs2:Header" priority="1">
1275+
<xsl:param name="id" as="xs:string?"/>
1276+
<xsl:param name="class" select="'alert alert-error well'" as="xs:string?"/>
1277+
1278+
<div>
1279+
<xsl:if test="$id">
1280+
<xsl:attribute name="id" select="$id"/>
1281+
</xsl:if>
1282+
<xsl:if test="$class">
1283+
<xsl:attribute name="class" select="$class"/>
1284+
</xsl:if>
1285+
1286+
<h2>
1287+
<xsl:value-of>
1288+
<xsl:apply-templates select="." mode="ac:label"/>
1289+
</xsl:value-of>
1290+
</h2>
1291+
</div>
1292+
</xsl:template>
1293+
12441294
</xsl:stylesheet>

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layout.xsl

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -906,55 +906,6 @@ exclude-result-prefixes="#all">
906906
</xsl:if>
907907
</xsl:template>
908908

909-
<!-- HEADER -->
910-
911-
<!-- TO-DO: move http:Response templates to error.xsl -->
912-
<xsl:template match="*[rdf:type/@rdf:resource = '&http;Response'][lacl:requestAccess/@rdf:resource][$foaf:Agent]" mode="bs2:Header" priority="2">
913-
<xsl:param name="id" as="xs:string?"/>
914-
<xsl:param name="class" select="'alert alert-info well'" as="xs:string?"/>
915-
916-
<div>
917-
<xsl:if test="$id">
918-
<xsl:attribute name="id" select="$id"/>
919-
</xsl:if>
920-
<xsl:if test="$class">
921-
<xsl:attribute name="class" select="$class"/>
922-
</xsl:if>
923-
924-
<h2>
925-
<xsl:apply-templates select="." mode="ldh:logo"/>
926-
927-
<xsl:apply-templates select="." mode="ac:label"/>
928-
929-
<button type="button" class="btn btn-primary btn-access-form pull-right">
930-
<xsl:value-of>
931-
<xsl:apply-templates select="key('resources', 'request-access', document('translations.rdf'))" mode="ac:label"/>
932-
</xsl:value-of>
933-
</button>
934-
</h2>
935-
</div>
936-
</xsl:template>
937-
938-
<xsl:template match="*[rdf:type/@rdf:resource = '&http;Response']" mode="bs2:Header" priority="1">
939-
<xsl:param name="id" as="xs:string?"/>
940-
<xsl:param name="class" select="'alert alert-error well'" as="xs:string?"/>
941-
942-
<div>
943-
<xsl:if test="$id">
944-
<xsl:attribute name="id" select="$id"/>
945-
</xsl:if>
946-
<xsl:if test="$class">
947-
<xsl:attribute name="class" select="$class"/>
948-
</xsl:if>
949-
950-
<h2>
951-
<xsl:value-of>
952-
<xsl:apply-templates select="." mode="ac:label"/>
953-
</xsl:value-of>
954-
</h2>
955-
</div>
956-
</xsl:template>
957-
958909
<!-- CONTENT HEADER -->
959910

960911
<!-- hide the header of def:SelectChildren content -->

0 commit comments

Comments
 (0)