hasmanytable.blade.php
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<style>
td .form-group {
margin-bottom: 0 !important;
}
</style>
<div class="{{$viewClass['form-group']}} clear-both row">
<label class="{{$viewClass['label']}} col-form-label">{{$label}}</label>
<div class="{{$viewClass['field']}}">
<div id="has-many-{{$column}}" style="margin-top: 15px;">
<table class="table table-has-many has-many-{{$column}}">
<thead>
<tr>
@foreach($headers as $header)
<th>{{ $header }}</th>
@endforeach
<th class="hidden"></th>
@if($options['allowDelete'])
<th></th>
@endif
</tr>
</thead>
<tbody class="has-many-{{$column}}-forms">
@foreach($forms as $pk => $form)
<tr class="has-many-{{$column}}-form fields-group">
<?php $hidden = ''; ?>
@foreach($form->fields() as $field)
@if (is_a($field, \Encore\Admin\Form\Field\Hidden::class))
<?php $hidden .= $field->render(); ?>
@continue
@endif
<td>{!! $field->setLabelClass(['hidden'])->setWidth(12, 0)->render() !!}</td>
@endforeach
<td class="hidden">{!! $hidden !!}</td>
@if($options['allowDelete'])
<td class="form-group">
<div>
<div class="remove btn btn-warning btn-sm pull-right"><i class="fa fa-trash"> </i>{{ trans('admin.remove') }}</div>
</div>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
<template class="{{$column}}-tpl">
<tr class="has-many-{{$column}}-form fields-group">
{!! $template !!}
<td class="form-group">
<div>
<div class="remove btn btn-warning btn-sm pull-right"><i class="fa fa-trash"> </i>{{ trans('admin.remove') }}</div>
</div>
</td>
</tr>
</template>
@if($options['allowCreate'])
<div class="form-group">
<div class="{{$viewClass['field']}}">
<div class="add btn btn-success btn-sm"><i class="fa fa-save"></i> {{ trans('admin.new') }}</div>
</div>
</div>
@endif
</div>
</div>
</div>
<hr style="margin-top: 0px;">