Type Ratings | New Feature (#1360)
* Type Ratings Adding "Type Rating" definition and assignment possibility to v7 core. * Update ProfileController.php * StyleFix 1 * Update settings.yml Change description text as requested
This commit is contained in:
@@ -9,6 +9,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<div class="header">
|
||||
<h3>Type Ratings</h3>
|
||||
</div>
|
||||
@include('admin.users.type_ratings')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<div class="header">
|
||||
@@ -34,3 +43,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.users.script')
|
||||
|
||||
25
resources/views/admin/users/script.blade.php
Normal file
25
resources/views/admin/users/script.blade.php
Normal file
@@ -0,0 +1,25 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
function setEditable() {
|
||||
|
||||
const token = $('meta[name="csrf-token"]').attr('content');
|
||||
const api_key = $('meta[name="api-key"]').attr('content');
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
setEditable();
|
||||
|
||||
$(document).on('submit', 'form.modify_typerating', function (event) {
|
||||
event.preventDefault();
|
||||
console.log(event);
|
||||
$.pjax.submit(event, '#user_typeratings_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
initPlugins();
|
||||
setEditable();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
38
resources/views/admin/users/type_ratings.blade.php
Normal file
38
resources/views/admin/users/type_ratings.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<div id="user_typeratings_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<table id="user_typeratings" class="table table-hover">
|
||||
@if(count($user->typeratings))
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@endif
|
||||
<tbody>
|
||||
@foreach($user->typeratings as $tr)
|
||||
<tr>
|
||||
<td class="sorting_1">{{ $tr->type }}</td>
|
||||
<td>{{ $tr->name }}</td>
|
||||
<td style="text-align: right; width:3%;">
|
||||
{{ Form::open(['url' => '/admin/users/'.$user->id.'/typeratings', 'method' => 'delete', 'class' => 'modify_typerating']) }}
|
||||
{{ Form::hidden('typerating_id', $tr->id) }}
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon']) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="text-right">
|
||||
{{ Form::open(['url' => '/admin/users/'.$user->id.'/typeratings', 'method' => 'post', 'class' => 'modify_typerating form-inline']) }}
|
||||
{{ Form::select('typerating_id', $avail_ratings, null, ['placeholder' => 'Select Type Rating', 'class' => 'ac-fare-dropdown form-control input-lg select2']) }}
|
||||
{{ Form::button('<i class="glyphicon glyphicon-plus"></i> add', ['type' => 'submit', 'class' => 'btn btn-success btn-s']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user