<div class="multiPairField form-group">
    <div ng-repeat="(index, item) in formValue"
         class="multiPairFieldTable multiPairFieldTable{{ index }} has{{ item.fieldCount }}Fields multiple valign-wrapper">

        <div piwik-field uicontrol="{{ field1.uiControl }}"
             name="{{ name + '-p1-' + $index }}"
             data-title="{{ field1.title }}"
             full-width="true"
             ng-if="field1.templateFile"
             template-file="{{ field1.templateFile }}"
             class="fieldUiControl fieldUiControl1"
             ng-class="{'hasMultiFields': (field1.templateFile && field2.templateFile)}"
             ng-model="formValue[index][field1.key]"
             options="field1.availableValues"
             ng-change="multiPairField.onEntryChange()"
             placeholder=" ">
        </div>

        <div piwik-field uicontrol="{{ field2.uiControl }}"
             name="{{ name + '-p2-' + $index }}"
             data-title="{{ field2.title }}"
             full-width="true"
             ng-if="field2.templateFile"
             class="fieldUiControl fieldUiControl2"
             template-file="{{ field2.templateFile }}"
             options="field2.availableValues"
             ng-change="multiPairField.onEntryChange()"
             ng-model="formValue[index][field2.key]"
             placeholder=" ">
        </div>

        <div piwik-field uicontrol="{{ field3.uiControl }}"
             data-title="{{ field3.title }}"
             full-width="true"
             ng-if="field3.templateFile"
             class="fieldUiControl fieldUiControl3"
             template-file="{{ field3.templateFile }}"
             options="field3.availableValues"
             ng-change="multiPairField.onEntryChange()"
             ng-model="formValue[index][field3.key]"
             placeholder=" ">
        </div>

        <div piwik-field uicontrol="{{ field4.uiControl }}"
             data-title="{{ field4.title }}"
             full-width="true"
             ng-if="field4.templateFile"
             class="fieldUiControl fieldUiControl4"
             template-file="{{ field4.templateFile }}"
             options="field4.availableValues"
             ng-change="multiPairField.onEntryChange()"
             ng-model="formValue[index][field4.key]"
             placeholder=" ">
        </div>

        <span ng-click="multiPairField.removeEntry(index)"
              title="{{ 'General_Remove'|translate }}"
              ng-hide="(index + 1) == (formValue|length)"
              class="icon-minus valign"></span>
    </div>
</div>