mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-12 09:58:50 -04:00
Handle lists as CSV field values
Brings in: - [ ] https://github.com/alphagov/notifications-utils/pull/128 This means that `RecipientCSV` will sometimes return the value of a cell in a spreadsheet as a `list`, not a `string`. So we need to handle that, rather than putting a Python representation (`['one', 'two', 'three']`) on the page. This commit handles it by putting a bulleted list on the page instead. This breaks our model of showing the spreadsheet as it appears in Excel or whatever, because we’re showing the aggregation of the columns into a list. However: - this is the easier thing to do for now - it might actually be more usable because it keeps the table narrower
This commit is contained in:
@@ -81,7 +81,15 @@
|
||||
|
||||
{% macro text_field(text, status='') -%}
|
||||
{% call field(status=status) %}
|
||||
{{ text }}
|
||||
{% if text is iterable and text is not string %}
|
||||
<ul class="list list-bullet">
|
||||
{% for item in text %}
|
||||
<li>{{ item }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{{ text }}
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
{%- endmacro %}
|
||||
|
||||
|
||||
@@ -31,4 +31,4 @@ notifications-python-client>=3.1,<3.2
|
||||
awscli>=1.11,<1.12
|
||||
awscli-cwlogs>=1.4,<1.5
|
||||
|
||||
git+https://github.com/alphagov/notifications-utils.git@13.10.0#egg=notifications-utils==13.10.0
|
||||
git+https://github.com/alphagov/notifications-utils.git@14.0.0#egg=notifications-utils==14.0.0
|
||||
|
||||
Reference in New Issue
Block a user