Skip to content

Conversation

@n00rsy
Copy link

@n00rsy n00rsy commented Dec 5, 2024

Issue number of the reported bug or feature request: RDISCROWD-7362

Describe your changes
Add parenthesis around country codes for easy identification

image

@n00rsy n00rsy requested a review from peterkle December 5, 2024 21:17
{% if form.data.locations %}
<p><strong>Location(s):</strong> {{form.data.locations|join(', ') }}</p>
<p><strong>Location(s):</strong>
{% for location in form.data.locations %} {{ '(' ~ location ~ ')' if location|length == 2 else location }}{% if not loop.last %}, {% endif %} {% endfor %}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we adjust this to display the format:

Country Name One (CO), Country Name Two (CP), Country Name Three (CQ)

<p><strong>Location(s):</strong>  
{% for i in range(0, form.data.locations|length, 2) %}  
{{ form.data.locations[i] }} ({{ form.data.locations[i+1] }}){% if not loop.last %}, {% endif %}  
{% endfor %}  
</p>  

Copy link
Author

@n00rsy n00rsy Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not guaranteed to have a country code mapping for each country, so unfortunately we cannot assume [i+1] is a country code.

Adjusted via 3267f47

Updated UI:

image

@n00rsy n00rsy merged commit 6b7e2c7 into main Dec 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants