Commit 174577c 1 parent 79fa248 commit 174577c Copy full SHA for 174577c
File tree 1 file changed +7
-7
lines changed
src/resources/views/fields
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
<!-- array input -->
2
2
3
3
<?php
4
- $max = isset ($field [' max' ]) ? $field [' max' ] : - 1 ;
5
- $min = isset ($field [' min' ]) ? $field [' min' ] : - 1 ;
4
+ $max = isset ($field [' max' ]) && ( int ) $field [ ' max ' ] > 0 ? $field [' max' ] : - 1 ;
5
+ $min = isset ($field [' min' ]) && ( int ) $field [ ' min ' ] > 0 ? $field [' min' ] : - 1 ;
6
6
$item_name = strtolower ( isset ($field [' entity_singular' ]) && ! empty ($field [' entity_singular' ]) ? $field [' entity_singular' ] : $field [' label' ]);
7
7
8
8
$items = old ($field [' name' ]) ? (old ($field [' name' ])) : (isset ($field [' value' ]) ? ($field [' value' ]) : (isset ($field [' default' ]) ? ($field [' default' ]) : ' ' ));
40
40
{{ $prop } }
41
41
</th >
42
42
@endforeach
43
- <th class =" text-center" > {{-- <i class="fa fa-sort"></i> --}} </th >
44
- <th class =" text-center" > {{-- <i class="fa fa-trash"></i> --}} </th >
43
+ <th class =" text-center" ng-if = " max == -1 || max > 1 " > {{-- <i class="fa fa-sort"></i> --}} </th >
44
+ <th class =" text-center" ng-if = " max == -1 || max > 1 " > {{-- <i class="fa fa-trash"></i> --}} </th >
45
45
</tr >
46
46
</thead >
47
47
54
54
<input class =" form-control input-sm" type =" text" ng-model =" item.{{ $prop } }" >
55
55
</td >
56
56
@endforeach
57
- <td >
57
+ <td ng-if = " max == -1 || max > 1 " >
58
58
<span class =" btn btn-sm btn-default sort-handle" ><span class =" sr-only" >sort item</span ><i class =" fa fa-sort" role =" presentation" aria-hidden =" true" ></i ></span >
59
59
</td >
60
- <td >
60
+ <td ng-if = " max == -1 || max > 1 " >
61
61
<button ng-hide =" min > -1 && $index < min" class =" btn btn-sm btn-default" type =" button" ng-click =" removeItem(item);" ><span class =" sr-only" >delete item</span ><i class =" fa fa-trash" role =" presentation" aria-hidden =" true" ></i ></button >
62
62
</td >
63
63
</tr >
67
67
</table >
68
68
69
69
<div class =" array-controls btn-group m-t-10" >
70
- <button class =" btn btn-sm btn-default" type =" button" ng-click =" addItem()" ><i class =" fa fa-plus" ></i > Add {{ $item_name } } </button >
70
+ <button ng-if = " max == -1 || items.length < max " class =" btn btn-sm btn-default" type =" button" ng-click =" addItem()" ><i class =" fa fa-plus" ></i > Add {{ $item_name } } </button >
71
71
</div >
72
72
73
73
</div >
You can’t perform that action at this time.
0 commit comments