@@ -70,12 +70,14 @@ <h1 class="govuk-heading-xl">{{ row_name }}</h1>
70
70
</ th >
71
71
< td class ="govuk-table__cell app-table__cell ">
72
72
{% if field == 'geometry' %}
73
- < div id ="geometry-content ">
74
- {{ row[field][:200] }}{% if row[field]|length > 200 %}...< a href ="javascript:void(0); " onclick ="expandGeometry() "> Load More</ a > {% endif %}
75
- </ div >
76
- < div id ="geometry-full-content " style ="display: none; ">
73
+ < code class ="app-code-block " id ="geometry-content ">
74
+ {% if row[field] is not none %}
75
+ {{ row[field][:150] }}{% if row[field]|length > 150 %}... < a href ="javascript:void(0); " onclick ="expandGeometry() "> Load More</ a > {% endif %}
76
+ {% endif %}
77
+ </ code >
78
+ < code class ="app-code-block " id ="geometry-full-content " style ="display: none; ">
77
79
{{ row[field] }}
78
- </ div >
80
+ </ code >
79
81
{% else %}
80
82
{{ entityValue(field, row[field], fields, dataset_fields, organisation_entity, linked_entities) }}
81
83
{% endif %}
@@ -227,18 +229,18 @@ <h3 class="govuk-heading-s">{{ type|capitalize }}</h3>
227
229
document . querySelector ( '#tab_geojson' ) . addEventListener ( 'click' , function ( ) {
228
230
// Check if the content is already loaded
229
231
const geojsonContentElement = document . getElementById ( 'geojson-content' ) ;
230
- if ( geojsonContentElement && geojsonContentElement . textContent === 'Loading...' ) {
232
+ if ( geojsonContentElement && geojsonContentElement . innerHTML === 'Loading...' ) {
231
233
// Fetch the GeoJSON content
232
234
fetch ( '{{ geometry_url }}' )
233
235
. then ( response => {
234
236
return response . text ( ) ;
235
237
} )
236
238
. then ( data => {
237
- geojsonContentElement . textContent = data
239
+ geojsonContentElement . innerHTML = data
238
240
} )
239
241
. catch ( error => {
240
242
console . error ( 'Error loading GeoJSON:' , error ) ;
241
- geojsonContentElement . textContent = 'Error loading GeoJSON content' ;
243
+ geojsonContentElement . innerHTML = 'Error loading GeoJSON content' ;
242
244
} ) ;
243
245
}
244
246
} ) ;
0 commit comments