|
|
@@ -149,7 +149,7 @@
|
|
|
</td>
|
|
|
<td><input type="text" class="form-control" placeholder="{{trans('admin.scaffold.default')}}" name="fields[{{$index}}][default]" value="{{$field['default']}}"/></td>
|
|
|
<td><input type="text" class="form-control" placeholder="{{trans('admin.scaffold.comment')}}" name="fields[{{$index}}][comment]" value="{{$field['comment']}}" /></td>
|
|
|
- <td><button class="btn btn-sm btn-danger table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
+ <td><button class="btn btn-sm btn-white table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
</tr>
|
|
|
@endforeach
|
|
|
@else
|
|
|
@@ -186,7 +186,7 @@
|
|
|
</td>
|
|
|
<td><input type="text" class="form-control" placeholder="{{trans('admin.scaffold.default')}}" name="fields[0][default]"></td>
|
|
|
<td><input type="text" class="form-control" placeholder="{{trans('admin.scaffold.comment')}}" name="fields[0][comment]"></td>
|
|
|
- <td><button class="btn btn-sm btn-danger table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
+ <td><button class="btn btn-sm btn-white table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
</tr>
|
|
|
@endif
|
|
|
</tbody>
|
|
|
@@ -197,7 +197,7 @@
|
|
|
<div class='form-inline d-flex justify-content-between' style="width: 100%; padding: 0 20px 12px;">
|
|
|
|
|
|
<div class='form-group'>
|
|
|
- <button type="button" class="btn btn-sm btn-success text-capitalize" id="add-table-field"><i class="feather icon-plus"></i> {{(trans('admin.scaffold.add_field'))}}</button>
|
|
|
+ <button type="button" class="btn btn-sm btn-primary btn-outline text-capitalize" id="add-table-field"><i class="feather icon-plus"></i> {{(trans('admin.scaffold.add_field'))}}</button>
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
@@ -261,7 +261,7 @@
|
|
|
</td>
|
|
|
<td><input value="{default}" type="text" class="form-control" placeholder="{{trans('admin.scaffold.default')}}" name="fields[__index__][default]"></td>
|
|
|
<td><input value="{comment}" type="text" class="form-control" placeholder="{{trans('admin.scaffold.comment')}}" name="fields[__index__][comment]"></td>
|
|
|
- <td><button class="btn btn-sm btn-danger table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
+ <td><button class="btn btn-sm btn-white table-field-remove"><i class="feather icon-trash"></i></button></td>
|
|
|
</tr>
|
|
|
</template>
|
|
|
|
|
|
@@ -329,44 +329,48 @@
|
|
|
|
|
|
withSingularName(tb);
|
|
|
|
|
|
- $.post('{{ admin_url('helpers/scaffold/table') }}', {db: db, tb: tb}, function (res) {
|
|
|
- Dcat.loading(false);
|
|
|
-
|
|
|
- if (!res.list) return;
|
|
|
- var i, list = res.list, $id = $('#inputPrimaryKey'), updated, created, soft;
|
|
|
-
|
|
|
- getTR().remove();
|
|
|
- for (i in list) {
|
|
|
- if (list[i].id) {
|
|
|
- $id.val(i);
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (i == 'updated_at') {
|
|
|
- updated = list[i];
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (i == 'created_at') {
|
|
|
- created = list[i];
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (i == 'deleted_at') {
|
|
|
- soft = list[i];
|
|
|
- continue;
|
|
|
+ $.post({
|
|
|
+ url: '{{ admin_url('helpers/scaffold/table') }}',
|
|
|
+ data: {db: db, tb: tb},
|
|
|
+ success: function (res) {
|
|
|
+ Dcat.loading(false);
|
|
|
+
|
|
|
+ if (!res.list) return;
|
|
|
+ var i, list = res.list, $id = $('#inputPrimaryKey'), updated, created, soft;
|
|
|
+
|
|
|
+ getTR().remove();
|
|
|
+ for (i in list) {
|
|
|
+ if (list[i].id) {
|
|
|
+ $id.val(i);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (i == 'updated_at') {
|
|
|
+ updated = list[i];
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (i == 'created_at') {
|
|
|
+ created = list[i];
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (i == 'deleted_at') {
|
|
|
+ soft = list[i];
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ var c = helpers.replace(list[i].comment, '"', '');
|
|
|
+ addField({
|
|
|
+ name: i,
|
|
|
+ lang: c,
|
|
|
+ type: list[i].type,
|
|
|
+ default: helpers.replace(list[i].default, '"', ''),
|
|
|
+ comment: c,
|
|
|
+ nullable: list[i].nullable != 'NO',
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- var c = helpers.replace(list[i].comment, '"', '');
|
|
|
- addField({
|
|
|
- name: i,
|
|
|
- lang: c,
|
|
|
- type: list[i].type,
|
|
|
- default: helpers.replace(list[i].default, '"', ''),
|
|
|
- comment: c,
|
|
|
- nullable: list[i].nullable != 'NO',
|
|
|
- });
|
|
|
+ addTimestamps(updated, created);
|
|
|
+ addSoftdelete(soft);
|
|
|
}
|
|
|
-
|
|
|
- addTimestamps(updated, created);
|
|
|
- addSoftdelete(soft);
|
|
|
});
|
|
|
|
|
|
});
|