Skip to content

Commit 4d0cb94

Browse files
committed
View template refactoring
1 parent 7501202 commit 4d0cb94

6 files changed

Lines changed: 255 additions & 227 deletions

File tree

src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ li button.btn-edit-constructors, li button.btn-add-data, li button.btn-add-ontol
5050
.btn-import { background-image: url('../icons/ic_transform_black_24px.svg'); }
5151
.btn-chart { background-image: url('../icons/ic_show_chart_black_24px.svg'); }
5252
.btn-view { background-image: url('../icons/ic_view_list_black_24px.svg'); }
53-
.btn-latest { background-image: url('../icons/ic_new_releases_black_24px.svg'); }
54-
.btn-geo { background-image: url('../icons/ic_location_on_black_24px.svg'); }
5553
.btn-logo { background-position: left; background-repeat: no-repeat; padding-left: 32px; }
5654
.dropdown-menu .btn-logo { background-position: 12px center; padding-left: 40px; }
5755
.btn.btn-toggle-content { font-size: 0; color: transparent; background-image: url('../icons/baseline-expand_less-24px.svg'); background-position: center center; background-repeat: no-repeat; width: 48px; }
@@ -92,9 +90,12 @@ li button.btn-edit-constructors, li button.btn-add-data, li button.btn-add-ontol
9290
#left-sidebar .nav { max-height: 20em; overflow: auto; }
9391
}
9492
#left-sidebar .nav-list > li > a { margin-left: 0; margin-right: 0; }
95-
#left-sidebar .nav-list > li > a.btn-container, #left-sidebar .nav-list > li > a.btn-app, #left-sidebar .nav-list > li > a.btn-chart, #left-sidebar .nav-list > li > a.btn-file, #left-sidebar .nav-list > li > a.btn-geo, #left-sidebar .nav-list > li > a.btn-import, #left-sidebar .nav-list > li > a.btn-latest, #left-sidebar .nav-list > li > a.btn-query, #left-sidebar .nav-list > li > a.btn-service { padding-left: 24px; }
93+
#left-sidebar .nav-list > li > a.btn-container
9694
#left-sidebar li { max-height: 20em; overflow: auto; }
9795
#left-sidebar li > a { display: inline-block; }
96+
#left-sidebar .btn-latest { background-image: url('../icons/ic_new_releases_black_24px.svg'); background-color: inherit; }
97+
#left-sidebar .btn-geo { background-image: url('../icons/ic_location_on_black_24px.svg'); background-color: inherit; }
98+
9899
.btn.btn-expand-tree { height: 24px; width: 24px; background-image: url('../icons/expand_more_black_24dp.svg'); }
99100
.btn.btn-expand-tree:hover, .btn.btn-expand-tree:focus { background-position: 0 0; }
100101
.btn.btn-expanded-tree { height: 24px; width: 24px; background-image: url('../icons/chevron_right_black_24dp.svg'); }

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,36 @@ exclude-result-prefixes="#all"
454454

455455
<xsl:sequence select="$context"/>
456456
</xsl:function>
457-
457+
458+
<xsl:function name="ldh:update-progress" as="map(*)" ixsl:updating="yes">
459+
<xsl:param name="context" as="map(*)"/>
460+
<xsl:param name="percent" as="xs:double"/>
461+
462+
<xsl:message>ldh:update-progress <xsl:value-of select="$percent"/>%</xsl:message>
463+
464+
<!-- Defensive check: ensure context exists and is a map before checking for keys -->
465+
<xsl:if test="exists($context) and $context instance of map(*) and map:contains($context, 'container')">
466+
<xsl:variable name="container" select="$context('container')" as="element()"/>
467+
<xsl:variable name="progress-container" select="$container/ancestor::div[contains-token(@class, 'span12')][contains-token(@class, 'progress')][contains-token(@class, 'active')][1]" as="element()?"/>
468+
469+
<xsl:if test="exists($progress-container)">
470+
<!-- Update progress bar width -->
471+
<xsl:for-each select="$progress-container//div[contains-token(@class, 'bar')]">
472+
<ixsl:set-style name="width" select="$percent || '%'" object="."/>
473+
</xsl:for-each>
474+
475+
<!-- Auto-hide when 100% complete -->
476+
<xsl:if test="$percent ge 100">
477+
<xsl:sequence select="ixsl:call(ixsl:get($progress-container, 'classList'), 'toggle', [ 'progress', false() ])[current-date() lt xs:date('2000-01-01')]"/>
478+
<xsl:sequence select="ixsl:call(ixsl:get($progress-container, 'classList'), 'toggle', [ 'progress-striped', false() ])[current-date() lt xs:date('2000-01-01')]"/>
479+
<xsl:sequence select="ixsl:call(ixsl:get($progress-container, 'classList'), 'toggle', [ 'active', false() ])[current-date() lt xs:date('2000-01-01')]"/>
480+
</xsl:if>
481+
</xsl:if>
482+
</xsl:if>
483+
484+
<xsl:sequence select="$context"/>
485+
</xsl:function>
486+
458487
<!-- block delete -->
459488

460489
<xsl:template name="onBlockDelete">

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/object.xsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ exclude-result-prefixes="#all"
304304
</xsl:document>
305305
</xsl:variable>
306306

307+
<!-- create the cache object if it doesn't exist -->
308+
<xsl:if test="not(ixsl:contains(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $block/@about || '`'))">
309+
<ixsl:set-property name="{'`' || $block/@about || '`'}" select="ldh:new-object()" object="ixsl:get(ixsl:window(), 'LinkedDataHub.contents')"/>
310+
</xsl:if>
311+
307312
<!-- TO-DO: reuse similar initialization code from client.xsl -->
308313
<xsl:if test="$mode = '&ac;MapMode' and key('elements-by-class', 'map-canvas', $block)">
309314
<xsl:for-each select="$resource-doc">

0 commit comments

Comments
 (0)