From 47a5f0cf3d19ae2668d6ef084b0af357922d66f2 Mon Sep 17 00:00:00 2001 From: Prashant Kanse Date: Wed, 8 Nov 2023 17:22:44 +0530 Subject: [PATCH] DGIR-83: IP restricted Embargoes page Error fix --- .../embargo-ip-access-exemption.html.twig | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/templates/embargo-ip-access-exemption.html.twig b/templates/embargo-ip-access-exemption.html.twig index 09c96e3..cc977e8 100644 --- a/templates/embargo-ip-access-exemption.html.twig +++ b/templates/embargo-ip-access-exemption.html.twig @@ -1,13 +1,23 @@

- {% trans %} - Your request for the following resource could not be resolved: - {{ resources | safe_join(', ') }} - {% plural resources|length %} - Your request for the following resources could not be resolved: - {{ resources | safe_join(', ') }} - {% endtrans %} + {% if resources is not null and resources is iterable %} + {% set resource_list = resources|join(', ') %} + {% if resource_list|length == 0 %} + {# No resources available #} + {% elseif resource_list|length == 1 %} + {% trans %} + Your request for the following resource could not be resolved: + {{ resource_list }} + {% endtrans %} + {% else %} + {% trans %} + Your request for the following resources could not be resolved: + {{ resource_list }} + {% endtrans %} + {% endif %} + {% endif %}

+

{{ 'Access to this resource is restricted to the following networks:'|t }}