Skip to content

Commit c678a5b

Browse files
committed
Adding css
1 parent a90522c commit c678a5b

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

application/routers/entity.py

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def handle_entity_response(
123123
e_dict_sorted = {
124124
key: e_dict[key] for key in sorted(e_dict.keys(), key=entity_attribute_sort_key)
125125
}
126-
127126
# need to remove any dependency on facts this should be changed when fields added to postgis
128127
fields = None
129128
# get field specifications and convert to dictionary to easily access

application/templates/entity.html

+10-8
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ <h1 class="govuk-heading-xl">{{ row_name }}</h1>
7070
</th>
7171
<td class="govuk-table__cell app-table__cell">
7272
{% 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;">
7779
{{ row[field] }}
78-
</div>
80+
</code>
7981
{% else %}
8082
{{ entityValue(field, row[field], fields, dataset_fields, organisation_entity, linked_entities) }}
8183
{% endif %}
@@ -227,18 +229,18 @@ <h3 class="govuk-heading-s">{{ type|capitalize }}</h3>
227229
document.querySelector('#tab_geojson').addEventListener('click', function () {
228230
// Check if the content is already loaded
229231
const geojsonContentElement = document.getElementById('geojson-content');
230-
if (geojsonContentElement && geojsonContentElement.textContent === 'Loading...') {
232+
if (geojsonContentElement && geojsonContentElement.innerHTML === 'Loading...') {
231233
// Fetch the GeoJSON content
232234
fetch('{{ geometry_url }}')
233235
.then(response => {
234236
return response.text();
235237
})
236238
.then(data => {
237-
geojsonContentElement.textContent = data
239+
geojsonContentElement.innerHTML = data
238240
})
239241
.catch(error => {
240242
console.error('Error loading GeoJSON:', error);
241-
geojsonContentElement.textContent = 'Error loading GeoJSON content';
243+
geojsonContentElement.innerHTML = 'Error loading GeoJSON content';
242244
});
243245
}
244246
});

0 commit comments

Comments
 (0)