File tree 2 files changed +28
-2
lines changed 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ from django import template
2
+
3
+ register = template .Library ()
4
+
5
+
6
+ @register .filter (name = "split" )
7
+ def split (value , separator = "," ):
8
+ """
9
+ Custom template filter to split a string by a given separator.
10
+ Defaults to splitting by comma if no separator is provided.
11
+ """
12
+ if isinstance (value , str ):
13
+ return value .split (separator )
14
+ return []
Original file line number Diff line number Diff line change 2
2
{% load crispy_forms_tags %}
3
3
{% load static %}
4
4
{% load dict_get %}
5
+ {% load split_filter %}
5
6
<!-- Data Table -->
6
7
< link rel ="stylesheet "
7
8
href ="https://cdn.datatables.net/v/dt/dt-2.1.8/b-3.2.0/b-colvis-3.2.0/cr-2.0.4/fc-5.0.4/fh-4.0.1/kt-2.12.1/r-3.0.3/rg-1.5.1/rr-1.5.0/sc-2.4.3/sp-2.3.3/sl-2.1.0/datatables.min.css ">
283
284
< td > {{ indicator_set.temporal_scope_start }}</ td >
284
285
< td > {{ indicator_set.temporal_scope_end }}</ td >
285
286
< td >
286
- < span class ="badge rounded-pill bg-dark "> {{ indicator_set.temporal_granularity }}</ span >
287
+ {% for item in indicator_set.temporal_granularity|split:"," %}
288
+ < span class ="badge rounded-pill bg-dark "> {{ item }}</ span >
289
+ {% endfor %}
287
290
</ td >
288
291
< td > {{ indicator_set.reporting_cadence }}</ td >
289
292
< td > {{ indicator_set.reporting_lag }}</ td >
318
321
</ div >
319
322
<!-- Loader Overlay -->
320
323
< div class ="loader-overlay " id ="loaderOverlay ">
321
- < div class ="lds-roller "> < div > </ div > < div > </ div > < div > </ div > < div > </ div > < div > </ div > < div > </ div > < div > </ div > < div > </ div > </ div >
324
+ < div class ="lds-roller ">
325
+ < div > </ div >
326
+ < div > </ div >
327
+ < div > </ div >
328
+ < div > </ div >
329
+ < div > </ div >
330
+ < div > </ div >
331
+ < div > </ div >
332
+ < div > </ div >
333
+ </ div >
322
334
</ div >
323
335
< div class ="float " id ="showSelectedIndicatorsButton " style ="display:none; ">
324
336
< a type ="button "
You can’t perform that action at this time.
0 commit comments