Skip to content

Commit c63ad22

Browse files
committed
Merge remote-tracking branch 'origin/master'
Conflicts: composer.json src/Public/quickadmin/js/main.js src/Views/admin/partials/header.blade.php src/Views/admin/partials/javascripts.blade.php src/Views/qa/cruds/create.blade.php src/Views/templates/crud_field_line.blade.php
2 parents 3f2fd7e + a4e2d96 commit c63ad22

File tree

8 files changed

+16
-167
lines changed

8 files changed

+16
-167
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"email": "[email protected]"
1212
}
1313
],
14-
"version": "0.2.0",
14+
"version": "0.1.3",
1515
"require": {
1616
"illuminate/html": "5.0.*@dev"
1717
},

src/Public/quickadmin/js/jquery-2.1.4.min.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/Public/quickadmin/js/main.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
11
$(document).ready(function () {
2-
$('.datatable').dataTable({
3-
"iDisplayLength": 100,
4-
"aaSorting": []
5-
});
6-
$('.datepicker').datepicker({
7-
autoclose: true
8-
});
9-
$('.ckeditor').each(function () {
10-
CKEDITOR.replace($(this));
11-
})
2+
$('.datatable').dataTable();
123
});

src/Views/admin/partials/header.blade.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
href="{{ url('quickadmin/css') }}/quickadmin-theme-default.css"/>
3030
<link rel="stylesheet"
3131
href="//cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css"/>
32-
<link rel="stylesheet"
33-
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.standalone.min.css"/>
3432
</head>
3533

3634
<body class="page-header-fixed">
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
22
<script src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
3-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.min.js"></script>
4-
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/locales/bootstrap-datepicker.en-GB.min.js"></script>
5-
<script src="//cdn.ckeditor.com/4.5.4/full/ckeditor.js"></script>
6-
<script src="{{ url('quickadmin/js') }}/main.js"></script>
7-
8-
<script>
9-
10-
$('.datepicker').datepicker({
11-
autoclose: true,
12-
format: "{{ config('quickadmin.date_format_jquery') }}"
13-
});
14-
</script>
3+
<script src="{{ url('quickadmin/js') }}/main.js"></script>

src/Views/qa/cruds/create.blade.php

Lines changed: 9 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,12 @@
5050
</div>
5151
</div>
5252

53-
<hr/>
53+
<hr />
5454

5555
<h3>Add fields</h3>
5656

5757
<table class="table">
5858
<tbody id="generator">
59-
<tr>
60-
<td>Show in list</td>
61-
<td></td>
62-
<td></td>
63-
<td></td>
64-
<td></td>
65-
<td></td>
66-
</tr>
6759
@if(old('f_type'))
6860
@foreach(old('f_type') as $index => $fieldName)
6961
@include('tpl::crud_field_line', ['index' => $index])
@@ -76,12 +68,11 @@
7668

7769
<div class="form-group">
7870
<div class="col-md-12">
79-
<button type="button" id="addField" class="btn btn-success"><i class="fa fa-plus"></i> Add one more field
80-
</button>
71+
<button type="button" id="addField" class="btn btn-success"><i class="fa fa-plus"></i> Add one more field</button>
8172
</div>
8273
</div>
8374

84-
<hr/>
75+
<hr />
8576

8677
<div class="form-group">
8778
<div class="col-md-12">
@@ -97,102 +88,32 @@
9788
@include('tpl::crud_field_line', ['index' => ''])
9889
</tbody>
9990
</table>
100-
101-
<!-- Select for relationship column-->
102-
@foreach($models as $key => $model)
103-
<select name="f_relationship_field[{{ $key }}]" class="form-control relationship-field rf-{{ $key }}">
104-
<option value="">Select display field</option>
105-
@foreach($model as $key2 => $option)
106-
<option value="{{ $option }}"
107-
@if($option == old('f_relationship_field.'.$key)) selected @endif>{{ $option }}</option>
108-
@endforeach
109-
</select>
110-
@endforeach
111-
<!-- /Select for relationship column-->
11291
</div>
11392

11493
@endsection
11594

11695
@section('javascript')
11796
<script>
118-
function typeChange(e) {
119-
var val = $(e).val();
120-
// Hide all possible outputs
121-
$(e).parent().parent().find('.value').hide();
122-
$(e).parent().parent().find('.default_c').hide();
123-
$(e).parent().parent().find('.relationship').hide();
124-
$(e).parent().parent().find('.title').show().val('');
125-
$(e).parent().parent().find('.texteditor').hide();
126-
$(e).parent().parent().find('.size').hide();
127-
128-
// Show a checbox which enables/disables showing in list
129-
$(e).parent().parent().parent().find('.show2').show();
130-
$(e).parent().parent().parent().find('.show_hid').val(1);
131-
switch (val) {
132-
case 'radio':
133-
$(e).parent().parent().find('.value').show();
134-
break;
135-
case 'checkbox':
136-
$(e).parent().parent().find('.default_c').show();
137-
break;
138-
case 'relationship':
139-
$(e).parent().parent().find('.relationship').show();
140-
$(e).parent().parent().find('.title').hide().val('-');
141-
break;
142-
case 'textarea':
143-
$(e).parent().parent().find('.show2').hide();
144-
$(e).parent().parent().find('.show_hid').val(0);
145-
$(e).parent().parent().find('.texteditor').show();
146-
break;
147-
case 'file':
148-
$(e).parent().parent().find('.size').show();
149-
break;
150-
}
151-
}
152-
153-
function relationshipChange(e) {
154-
var val = $(e).val();
155-
$(e).parent().parent().find('.relationship-field').remove();
156-
var select = $('.rf-' + val).clone();
157-
$(e).parent().parent().find('.relationship-holder').html(select);
158-
}
159-
16097
$(document).ready(function () {
161-
$('.type').each(function () {
162-
typeChange($(this))
163-
});
164-
$('.relationship').each(function () {
165-
relationshipChange($(this))
166-
});
167-
168-
$('.show2').change(function () {
169-
var checked = $(this).is(":checked");
170-
if (checked) {
171-
$(this).parent().find('.show_hid').val(1);
172-
} else {
173-
$(this).parent().find('.show_hid').val(0);
174-
}
175-
});
176-
17798
// Add new row to the table of fields
17899
$('#addField').click(function () {
179100
var line = $('#line').html();
180101
var table = $('#generator');
181102
table.append(line);
182103
});
183-
184104
// Remove row from the table of fields
185105
$(document).on('click', '.rem', function () {
186106
$(this).parent().parent().remove();
187107
});
188108
189109
$(document).on('change', '.type', function () {
190-
typeChange($(this))
191-
});
192-
$(document).on('change', '.relationship', function () {
193-
relationshipChange($(this))
110+
var val = $(this).val();
111+
if(val == 'radio' || val == 'checkbox') {
112+
$(this).parent().parent().find('.value').show();
113+
}else{
114+
$(this).parent().parent().find('.value').hide();
115+
}
194116
});
195117
});
196-
197118
</script>
198119
@stop

src/Views/templates/crud_field_line.blade.php

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
<tr>
2-
<td>
3-
<input type="hidden" name="f_show[]" value="1" class="show_hid">
4-
<input type="checkbox" value="1" checked class="show2">
5-
</td>
62
<td>
73
<select name="f_type[]" class="form-control type" required="required">
84
@foreach($fieldTypes as $key => $option)
@@ -11,56 +7,13 @@
117
@endforeach
128
</select>
139
<td>
14-
<input type="text" name="f_title[]" value="{{ old('f_title.'.$index) }}" class="form-control title"
10+
<input type="text" name="f_title[]" value="{{ old('f_title.'.$index) }}" class="form-control"
1511
required="required" placeholder="Field DB name">
16-
17-
<!-- File size limit -->
18-
<label class="size">File size limit (in MB):</label>
19-
<input type="text" name="f_size[]" value="{{ old('f_size.'.$index, '2') }}" class="form-control size"
20-
placeholder="File size limit (in MB)" style="display: none;">
21-
<!-- /File size limit -->
22-
23-
<!-- Value for radio button -->
2412
<input type="text" name="f_value[]" value="{{ old('f_value.'.$index) }}" class="form-control value"
2513
placeholder="Value" style="display: none;">
26-
<!-- /Value for radio button -->
27-
28-
<!-- Default value of a checkbox -->
29-
<select name="f_default[]" class="form-control default_c" style="display: none;">
30-
@foreach($defaultValuesCbox as $key => $option)
31-
<option value="{{ $key }}"
32-
@if($key == old('f_default.'.$index)) selected @endif>{{ $option }}</option>
33-
@endforeach
34-
</select>
35-
<!-- /Default value of a checkbox -->
36-
37-
<!-- Use ckeditor on textarea field -->
38-
<select name="f_texteditor[]" class="form-control texteditor" style="display: none;">
39-
<option>Use CKEDITOR</option>
40-
<option value="1"
41-
@if($key == old('f_texteditor.'.$index)) selected @endif>Yes
42-
</option>
43-
<option value="0"
44-
@if($key == old('f_texteditor.'.$index)) selected @endif>No
45-
</option>
46-
</select>
47-
<!-- /Use ckeditor on textarea field -->
48-
49-
<!-- Select for relationship -->
50-
<select name="f_relationship[]" class="form-control relationship" style="display: none;">
51-
<option value="">Select relationship</option>
52-
@foreach($crudsSelect as $key => $option)
53-
<option value="{{ $key }}"
54-
@if($key == old('f_relationship.'.$index)) selected @endif>{{ $option }}</option>
55-
@endforeach
56-
</select>
57-
<!-- /Select for relationship -->
58-
<div class="relationship-holder"></div>
59-
</td>
60-
<td>
61-
<input type="text" name="f_label[]" value="{{ old('f_label.'.$index) }}" class="form-control"
62-
required="required" placeholder="Field visual title">
6314
</td>
15+
<td><input type="text" name="f_label[]" value="{{ old('f_label.'.$index) }}" class="form-control"
16+
required="required" placeholder="Field visual title"></td>
6417
<td>
6518
<select name="f_validation[]" class="form-control" required="required">
6619
@foreach($fieldValidation as $key => $option)

0 commit comments

Comments
 (0)