Attach _list_index to fields within list items so that the index/key is available

This commit is contained in:
Djamil Legato
2019-07-16 09:56:16 -07:00
parent 2562cfbb34
commit d85a6777de
2 changed files with 2 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
1. [](#improved)
* Better support for `array` field into `list` field
* Attach `_list_index` to fields within list items so that the index/key is available
1. [](#bugfix)
* Fixed 2FA regenerate for Flex Users
* Added missing closing </li> in language loops

View File

@@ -71,6 +71,7 @@
<li data-collection-item="{{ itemName }}" data-collection-key="{{ key }}" class="{{ collapsible and field.collapsed ? 'collection-collapsed' : '' }}">
<div class="collection-sort"><i class="fa fa-fw fa-bars"></i></div>
{% for childName, child in field.fields %}
{% set child = child|merge({ '_list_index': itemName }) %}
{%- if childName == 'value' -%}
{% set childKey = '' %}
{% set childValue = val %}