diff --git a/ckanext/odsh/templates/organization/snippets/organization_form.html b/ckanext/odsh/templates/organization/snippets/organization_form.html index a3cd0db79670eb990d1bb98a22c1495ddca45fb1..a14c122168039edefcc90ee433631a25bd3d2cad 100644 --- a/ckanext/odsh/templates/organization/snippets/organization_form.html +++ b/ckanext/odsh/templates/organization/snippets/organization_form.html @@ -47,8 +47,9 @@ {{ form.input_address('gnd','GND URI', value=extras.gnd, index=6, placeholder='https://d-nb.info/gnd/1136109587', type='text', attrs={}) }} {% for extra in data.extras %} - {% if extra.key not in ['person','street','location','telephone','mail','web','gnd'] %} - {% set prefix = 'extras__%d__' % (loop.index0 + 7) %} + {% set custom_extras = ['person','street','location','telephone','mail','web','gnd'] %} + {% if extra.key not in custom_extras %} + {% set prefix = 'extras__%d__' % (loop.index0 + (custom_extras|count)) %} {{ form.custom( names=(prefix ~ 'key', prefix ~ 'value', prefix ~ 'deleted'), id='field-extras-%d' % loop.index, @@ -65,7 +66,7 @@ {% if empty_extras <= 0 %}{% set empty_extras = 1 %}{% endif %} {% for extra in range(total_extras, total_extras + empty_extras) %} - {% set index = loop.index0 + (data.extras|count) + 7 %} + {% set index = loop.index0 + (data.extras|count) + (custom_extras|count) %} {% set prefix = 'extras__%d__' % index %} {{ form.custom( names=(prefix ~ 'key', prefix ~ 'value', prefix ~ 'deleted'),