@@ -639,7 +639,10 @@ LIMIT 100
639639 </xsl : if >
640640
641641 <div class =" row-fluid" >
642- <xsl : apply-templates select =" ." mode =" bs2:BreadCrumbBar" />
642+ <xsl : apply-templates select =" ." mode =" bs2:BreadCrumbBar" >
643+ <xsl : with-param name =" id" select =" 'breadcrumb-nav'" />
644+ <xsl : with-param name =" uri" select =" ac:absolute-path($ldh:requestUri)" />
645+ </xsl : apply-templates >
643646
644647 <div id =" doc-controls" class =" span4" >
645648 <xsl : apply-templates select =" key('resources', ac:absolute-path(ldh:base-uri(.)))" mode =" bs2:Timestamp" />
@@ -666,15 +669,18 @@ LIMIT 100
666669 <xsl : attribute name =" class" select =" $class" />
667670 </xsl : if >
668671
669- <xsl : apply-templates select =" ." mode =" bs2:MediaTypeList" />
672+ <xsl : apply-templates select =" ." mode =" bs2:MediaTypeList" >
673+ <xsl : with-param name =" uri" select =" ac:absolute-path($ldh:requestUri)" />
674+ </xsl : apply-templates >
670675
671676 <xsl : apply-templates select =" ." mode =" bs2:NavBarActions" />
672677 </div >
673678 </xsl : template >
674679
675680 <xsl : template match =" rdf:RDF" mode =" bs2:BreadCrumbBar" >
676- <xsl : param name =" id" select = " 'breadcrumb-nav' " as =" xs:string?" />
681+ <xsl : param name =" id" as =" xs:string?" />
677682 <xsl : param name =" class" select =" 'span8'" as =" xs:string?" />
683+ <xsl : param name =" uri" as =" xs:string?" />
678684
679685 <div >
680686 <xsl : if test =" $id" >
@@ -689,7 +695,7 @@ LIMIT 100
689695 <xsl : if test =" not($ldh:ajaxRendering)" >
690696 <ul class =" breadcrumb pull-left" >
691697 <!-- render breadcrumbs server-side -->
692- <xsl : apply-templates select =" key('resources', ac:absolute-path(ldh:base- uri(.)) )" mode =" bs2:BreadCrumbListItem" />
698+ <xsl : apply-templates select =" key('resources', $ uri)" mode =" bs2:BreadCrumbListItem" />
693699 </ul >
694700 </xsl : if >
695701 </div >
@@ -799,7 +805,7 @@ LIMIT 100
799805
800806 <xsl : template match =" rdf:RDF[not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))] | srx:sparql[not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))]" mode =" bs2:ExternalBar" priority =" 1" >
801807 <xsl : param name =" id" as =" xs:string?" />
802- <xsl : param name =" class" select =" 'navbar-inner action-bar'" as =" xs:string?" />
808+ <xsl : param name =" class" select =" 'navbar-inner action-bar external-bar '" as =" xs:string?" />
803809
804810 <div >
805811 <xsl : if test =" $id" >
@@ -835,7 +841,26 @@ LIMIT 100
835841 <xsl : attribute name =" class" select =" $class" />
836842 </xsl : if >
837843
838-
844+ <!-- <xsl:variable name="app" select="ldh:match-app($uri, ixsl:get(ixsl:window(), 'LinkedDataHub.apps'))" as="element()?"/>
845+ <xsl:choose>
846+ if a known app matches $uri, show link to its ldt:base
847+ <xsl:when test="$app">
848+ <a href="{$app/ldt:base/@rdf:resource}" class="label label-info pull-left">
849+ <xsl:apply-templates select="$app" mode="ac:label"/>
850+ </a>
851+ </xsl:when>
852+ otherwise show just a label with the hostname
853+ <xsl:otherwise>
854+ <xsl:variable name="hostname" select="tokenize(substring-after($uri, '://'), '/')[1]" as="xs:string"/>
855+ <span class="label label-info pull-left">
856+ <xsl:value-of select="$hostname"/>
857+ </span>
858+ </xsl:otherwise>
859+ </xsl:choose>-->
860+ <xsl : variable name =" hostname" select =" tokenize(substring-after(ldh:base-uri(.), '://'), '/')[1]" as =" xs:string" />
861+ <span class =" label label-info pull-left" >
862+ <xsl : value-of select =" $hostname" />
863+ </span >
839864 </div >
840865 </xsl : template >
841866
@@ -852,7 +877,10 @@ LIMIT 100
852877 </xsl : if >
853878
854879 <div class =" row-fluid" >
855- <xsl : apply-templates select =" ." mode =" bs2:BreadCrumbBar" />
880+ <xsl : apply-templates select =" ." mode =" bs2:BreadCrumbBar" >
881+ <xsl : with-param name =" id" select =" 'external-breadcrumb-nav'" />
882+ <xsl : with-param name =" uri" select =" ac:document-uri(ldh:base-uri(.))" />
883+ </xsl : apply-templates >
856884 </div >
857885 </div >
858886 </xsl : template >
@@ -869,9 +897,11 @@ LIMIT 100
869897 <xsl : attribute name =" class" select =" $class" />
870898 </xsl : if >
871899
872- <xsl : apply-templates select =" ." mode =" bs2:MediaTypeList" />
900+ <xsl : apply-templates select =" ." mode =" bs2:MediaTypeList" >
901+ <xsl : with-param name =" uri" select =" ldh:base-uri(.)" />
902+ </xsl : apply-templates >
873903
874- <xsl : apply-templates select =" ." mode =" bs2:NavBarActions " />
904+ <xsl : apply-templates select =" ." mode =" bs2:ExternalBarActions " />
875905 </div >
876906 </xsl : template >
877907
@@ -1131,6 +1161,8 @@ LIMIT 100
11311161 <!-- MEDIA TYPE LIST -->
11321162
11331163 <xsl : template match =" rdf:RDF | srx:sparql" mode =" bs2:MediaTypeList" priority =" 1" >
1164+ <xsl : param name =" uri" as =" xs:anyURI" />
1165+
11341166 <div class =" btn-group pull-right" >
11351167 <button type =" button" id =" export-rdf" title =" {ac:label(key('resources', 'nav-bar-action-export-rdf-title', document('translations.rdf')))}" >
11361168 <xsl : apply-templates select =" key('resources', '∾ Export', document(ac:document-uri('∾ ')))" mode =" ldh:logo" >
@@ -1143,15 +1175,15 @@ LIMIT 100
11431175 </button >
11441176 <ul class =" dropdown-menu" >
11451177 <li >
1146- <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'application/rdf+xml' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string(ldh:base- uri(.) ) })) else $params)" as =" xs:anyURI" />
1178+ <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'application/rdf+xml' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string($ uri) })) else $params)" as =" xs:anyURI" />
11471179 <a href =" {$href}" title =" application/rdf+xml" target =" _blank" >RDF/XML</a >
11481180 </li >
11491181 <li >
1150- <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'text/turtle' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string(ldh:base- uri(.) ) })) else $params)" as =" xs:anyURI" />
1182+ <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'text/turtle' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string($ uri) })) else $params)" as =" xs:anyURI" />
11511183 <a href =" {$href}" title =" text/turtle" target =" _blank" >Turtle</a >
11521184 </li >
11531185 <li >
1154- <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'application/ld+json' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string(ldh:base- uri(.) ) })) else $params)" as =" xs:anyURI" />
1186+ <xsl : variable name =" href" select =" ac:build-uri(ac:absolute-path($ldh:requestUri), let $params := map{ 'accept': 'application/ld+json' } return if (not(starts-with(ac:absolute-path(ldh:base-uri(.)), $ldt:base))) then map:merge(($params, map{ 'uri': string($ uri) })) else $params)" as =" xs:anyURI" />
11551187 <a href =" {$href}" title =" application/ld+json" target =" _blank" >JSON-LD</a >
11561188 </li >
11571189 </ul >
@@ -1227,7 +1259,22 @@ LIMIT 100
12271259 <xsl : apply-templates select =" key('resources', '∾ Delete', document(ac:document-uri('∾ ')))" mode =" ac:label" />
12281260 </button >
12291261 </div >
1230-
1262+
1263+ <div class =" btn-group pull-right" >
1264+ <button type =" button" title =" {ac:label(key('resources', 'acl-list-title', document('translations.rdf')))}" >
1265+ <xsl : apply-templates select =" key('resources', '&acl; Access', document(ac:document-uri('&acl; ')))" mode =" ldh:logo" >
1266+ <xsl : with-param name =" class" select =" 'btn'" />
1267+ </xsl : apply-templates >
1268+ <xsl : apply-templates select =" key('resources', '&acl; Access', document(ac:document-uri('&acl; ')))" mode =" ac:label" />
1269+ </button >
1270+ </div >
1271+ </xsl : if >
1272+ </xsl : template >
1273+
1274+ <xsl : template match =" rdf:RDF" mode =" bs2:ExternalBarActions" priority =" 1" >
1275+ <xsl : param name =" base-uri" select =" ac:absolute-path(ldh:base-uri(.))" as =" xs:anyURI" />
1276+
1277+ <xsl : if test =" $foaf:Agent//@rdf:about" >
12311278 <xsl : if test =" $ldh:ajaxRendering" >
12321279 <div class =" pull-right" >
12331280 <button type =" button" title =" {ac:label(key('resources', 'save-as-title', document('translations.rdf')))}" >
@@ -1243,15 +1290,6 @@ LIMIT 100
12431290 </button >
12441291 </div >
12451292 </xsl : if >
1246-
1247- <div class =" btn-group pull-right" >
1248- <button type =" button" title =" {ac:label(key('resources', 'acl-list-title', document('translations.rdf')))}" >
1249- <xsl : apply-templates select =" key('resources', '&acl; Access', document(ac:document-uri('&acl; ')))" mode =" ldh:logo" >
1250- <xsl : with-param name =" class" select =" 'btn'" />
1251- </xsl : apply-templates >
1252- <xsl : apply-templates select =" key('resources', '&acl; Access', document(ac:document-uri('&acl; ')))" mode =" ac:label" />
1253- </button >
1254- </div >
12551293 </xsl : if >
12561294 </xsl : template >
12571295
0 commit comments