1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <xsl:stylesheet version="3.0" |
---|
4 | xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:xs ="http://www.w3.org/2001/XMLSchema" |
---|
6 | xmlns:ibis="http://www.ibisph.org" |
---|
7 | |
---|
8 | exclude-result-prefixes="ibis xs xsl" |
---|
9 | > |
---|
10 | <xsl:import href="../Page.xslt"/> |
---|
11 | |
---|
12 | <ibis:doc> |
---|
13 | <name>html/indicator/profile/view/Page</name> |
---|
14 | <summary>Base interactive indicator profile view page</summary> |
---|
15 | <description> |
---|
16 | Specific XSLT used to create the indicator profile view page. |
---|
17 | </description> |
---|
18 | </ibis:doc> |
---|
19 | |
---|
20 | |
---|
21 | <xsl:param name="Page.pageTitle" ibis:doc="Page's title text based on the 'INDICATOR/TITLE' element."> |
---|
22 | Health Indicator Report - <xsl:value-of select="$Page.completeIndicatorViewTitle"/> |
---|
23 | </xsl:param> |
---|
24 | <xsl:param name="Page.contentTitle" ibis:doc="Page's content block title text based on the 'INDICATOR/TITLE' element."> |
---|
25 | <xsl:value-of select="$Page.completeIndicatorViewTitle"/> |
---|
26 | </xsl:param> |
---|
27 | |
---|
28 | <xsl:param name="Page.showGrid" select="true()" |
---|
29 | ibis:doc="Allows an adopter to override this param value." |
---|
30 | /> |
---|
31 | <xsl:param name="Indicator.contentBlockType" select="'fixed'" |
---|
32 | ibis:doc="Allows an adopter to override the block type ie fixed/expandable." |
---|
33 | /> |
---|
34 | |
---|
35 | |
---|
36 | <xsl:template name="Page.contentBody" ibis:doc="Main page content template that determines if IP or Surrogate."> |
---|
37 | |
---|
38 | <!-- if no external content or external content AND a dest selector then call the default page. --> |
---|
39 | <xsl:if test="(0 = string-length($Indicator.indicatorView/EXTERNAL_CONTENT_URL)) or (0 != string-length($Indicator.indicatorView/EXTERNAL_CONTENT_DEST_SELECTOR))"> |
---|
40 | <xsl:call-template name="Page.interativeContent"/> |
---|
41 | </xsl:if> |
---|
42 | |
---|
43 | <!-- if external content of any type e.g. complete replacement or section. --> |
---|
44 | <xsl:if test="(0 != string-length($Indicator.indicatorView/EXTERNAL_CONTENT_URL))"> |
---|
45 | <xsl:call-template name="Page.insertAsyncContent"> |
---|
46 | <xsl:with-param name="sourceContentRequestURL" select="$Indicator.indicatorView/EXTERNAL_CONTENT_URL"/> |
---|
47 | <xsl:with-param name="sourceContentCSSSelector" select="$Indicator.indicatorView/EXTERNAL_CONTENT_SELECTOR"/> |
---|
48 | <xsl:with-param name="destContentCSSSelector" |
---|
49 | select="if(0 != string-length($Indicator.indicatorView/EXTERNAL_CONTENT_DEST_SELECTOR)) |
---|
50 | then $Indicator.indicatorView/EXTERNAL_CONTENT_DEST_SELECTOR |
---|
51 | else 'sectionsContainer'" |
---|
52 | /> |
---|
53 | </xsl:call-template> |
---|
54 | </xsl:if> |
---|
55 | </xsl:template> |
---|
56 | |
---|
57 | |
---|
58 | <xsl:template name="Page.interativeContent" |
---|
59 | ibis:doc="Main interactive sections content template." |
---|
60 | > |
---|
61 | <xsl:param name="indicator" select="$Indicator.indicator"/> |
---|
62 | <xsl:param name="indicatorView" select="$Indicator.indicatorView"/> |
---|
63 | <xsl:param name="measure" select="$Indicator.measure"/> |
---|
64 | |
---|
65 | <xsl:param name="recordDimensionFields"> |
---|
66 | <xsl:call-template name="Interactive.recordDimensionFields"> |
---|
67 | <xsl:with-param name="dimensions" select="$Indicator.dimensions"/> |
---|
68 | <xsl:with-param name="dimensionUsages" select="$Indicator.indicatorView/DIMENSION_USAGES"/> |
---|
69 | </xsl:call-template> |
---|
70 | </xsl:param> |
---|
71 | |
---|
72 | <xsl:param name="indicatorViewDatasetRecords"> |
---|
73 | <xsl:call-template name="Interactive.indicatorViewDatasetRecords"> |
---|
74 | <xsl:with-param name="datasetRecords" select="$Indicator.indicator/DATASETS/DATASET[NAME = $Indicator.indicatorView/DATASET_NAMES/DATASET_NAME]/RECORDS"/> |
---|
75 | <xsl:with-param name="dimensionUsages" select="$Indicator.indicatorView/DIMENSION_USAGES"/> |
---|
76 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
77 | </xsl:call-template> |
---|
78 | </xsl:param> |
---|
79 | |
---|
80 | <xsl:param name="showMap" select="ibis:DataViz.showMap($Indicator.indicatorView/MAP_NAME)"/> |
---|
81 | <xsl:param name="showChart" select="ibis:DataViz.showChart($Indicator.indicatorView/CHART_NAME)"/> |
---|
82 | |
---|
83 | <xsl:variable name="dataVizContainerIDPrefix" select="ibis:firstLetterLowerCase( replace($indicatorView/NAME, '\.', '_') )"/> |
---|
84 | <xsl:variable name="dataVizObjectName" select="concat($dataVizContainerIDPrefix, 'DataViz')"/> |
---|
85 | |
---|
86 | <xsl:call-template name="Page.contentOptions"> |
---|
87 | <xsl:with-param name="title">Indicator Report Data View Options</xsl:with-param> |
---|
88 | <xsl:with-param name="pageType" select="'view'"/> |
---|
89 | </xsl:call-template> |
---|
90 | |
---|
91 | <xsl:if test="$showMap"> |
---|
92 | <xsl:call-template name="DataViz.mapContainer"> |
---|
93 | <xsl:with-param name="containerID" select="concat($dataVizContainerIDPrefix, '_map')"/> |
---|
94 | <xsl:with-param name="title" select="ibis:getIndicatorViewMapTitle($indicatorView, $Page.completeIndicatorViewTitle)"/> |
---|
95 | <xsl:with-param name="footerContent" select="$indicatorView/MAP_NARRATIVE"/> |
---|
96 | </xsl:call-template> |
---|
97 | </xsl:if> |
---|
98 | |
---|
99 | <xsl:if test="$showChart"> |
---|
100 | <xsl:call-template name="DataViz.chartContainer"> |
---|
101 | <xsl:with-param name="containerID" select="concat($dataVizContainerIDPrefix, '_chart')"/> |
---|
102 | <xsl:with-param name="footerContent" select="$indicatorView/CHART_NARRATIVE/text()"/> |
---|
103 | </xsl:call-template> |
---|
104 | </xsl:if> |
---|
105 | |
---|
106 | <xsl:call-template name="Indicator.externalDataViz"> |
---|
107 | <xsl:with-param name="indicatorView" select="$indicatorView"/> |
---|
108 | </xsl:call-template> |
---|
109 | |
---|
110 | <xsl:call-template name="DataViz.gridContainer"> |
---|
111 | <xsl:with-param name="containerID" select="concat($dataVizContainerIDPrefix, '_grid')"/> |
---|
112 | <xsl:with-param name="valueAttributeNames" select="distinct-values($indicatorViewDatasetRecords//VALUE_ATTRIBUTE_NAME)"/> |
---|
113 | <xsl:with-param name="valueAttributes" select="$Indicator.valueAttributes"/> |
---|
114 | </xsl:call-template> |
---|
115 | |
---|
116 | <xsl:call-template name="Indicator.whyImportant"/> |
---|
117 | <xsl:call-template name="Indicator.definition"/> |
---|
118 | |
---|
119 | <xsl:call-template name="Indicator.viewDataNotes"/> |
---|
120 | <xsl:call-template name="Indicator.viewDataSources"/> |
---|
121 | <xsl:call-template name="Indicator.howCalculated"/> |
---|
122 | <xsl:call-template name="Indicator.viewDataIssues"/> |
---|
123 | |
---|
124 | <xsl:call-template name="Indicator.relatedIndicators"> |
---|
125 | <xsl:with-param name="indicatorBaseRequestPath" select="$Page.indicatorBaseRequestPath"/> |
---|
126 | </xsl:call-template> |
---|
127 | |
---|
128 | <xsl:call-template name="Indicator.relatedQueries"/> |
---|
129 | <xsl:call-template name="Indicator.relatedTopics"/> |
---|
130 | |
---|
131 | <xsl:call-template name="Indicator.moreResourcesAndLinks"/> |
---|
132 | |
---|
133 | |
---|
134 | <xsl:if test="$showMap"> |
---|
135 | <xsl:call-template name="DataViz.choroplethMapJavaScript"/> |
---|
136 | </xsl:if> |
---|
137 | <script> |
---|
138 | var <xsl:value-of select="$dataVizObjectName"/> = new KendoLeafletDataViz(); |
---|
139 | <xsl:call-template name="DataViz.populateKendoLeafletDataVizObject"> |
---|
140 | <xsl:with-param name="dataVizObjectName" select="$dataVizObjectName"/> |
---|
141 | <xsl:with-param name="containerIDPrefix" select="$dataVizContainerIDPrefix"/> |
---|
142 | |
---|
143 | <xsl:with-param name="dimensions" select="$Indicator.dimensions"/> |
---|
144 | <xsl:with-param name="dimensionUsages" select="$indicatorView/DIMENSION_USAGES"/> |
---|
145 | <xsl:with-param name="datasetRecords" select="$indicatorViewDatasetRecords"/> |
---|
146 | <xsl:with-param name="recordDimensionFields" select="$recordDimensionFields"/> |
---|
147 | <xsl:with-param name="recordAncillaryValueFields"> |
---|
148 | <xsl:call-template name="Indicator.recordAncillaryValueFields"/> |
---|
149 | </xsl:with-param> |
---|
150 | <xsl:with-param name="valueAttributes" select="$Indicator.valueAttributes"/> |
---|
151 | |
---|
152 | <xsl:with-param name="measure" select="$measure"/> |
---|
153 | <xsl:with-param name="measureTitle" select="ibis:getMeasureTitle($indicatorView/MEASURE_TITLE_OVERRIDE, $measure)"/> |
---|
154 | <xsl:with-param name="measureValueType" select="$Indicator.measureValueType"/> |
---|
155 | |
---|
156 | <xsl:with-param name="showMap" select="$showMap"/> |
---|
157 | <xsl:with-param name="mapName" select="$indicatorView/MAP_NAME"/> |
---|
158 | <xsl:with-param name="geoDimensionName" select="$indicatorView/MAP_DIMENSION_NAME"/> |
---|
159 | |
---|
160 | <xsl:with-param name="showChart" select="$showChart"/> |
---|
161 | <xsl:with-param name="chartName" select="$indicatorView/CHART_NAME"/> |
---|
162 | <xsl:with-param name="chartTitle" select="ibis:getIndicatorViewChartTitle($indicatorView, $Page.completeIndicatorViewTitle)"/> |
---|
163 | |
---|
164 | <xsl:with-param name="showGrid" select="$Page.showGrid"/> |
---|
165 | <xsl:with-param name="showValueAttributeColumn" select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(VALUE_ATTRIBUTE_NAME)])"/> |
---|
166 | <xsl:with-param name="showLabelColumn" select="exists($indicatorViewDatasetRecords/RECORD[0 != string-length(LABEL)])"/> |
---|
167 | <xsl:with-param name="baseExportFilename" select="$Page.completeIndicatorViewTitle"/> |
---|
168 | </xsl:call-template> |
---|
169 | |
---|
170 | $(document).ready(function() |
---|
171 | { |
---|
172 | <xsl:value-of select="$dataVizObjectName"/>.init(); |
---|
173 | }); |
---|
174 | |
---|
175 | <xsl:if test="$showChart"> |
---|
176 | $(window).resize(function () { |
---|
177 | <xsl:value-of select="$dataVizObjectName"/>.resizeKendoChart(); |
---|
178 | }); |
---|
179 | </xsl:if> |
---|
180 | </script> |
---|
181 | </xsl:template> |
---|
182 | |
---|
183 | </xsl:stylesheet> |
---|
184 | <!-- ============================= End of File ============================= --> |
---|