first upload all files
This commit is contained in:
33
Modules/Review/Resources/views/admin/products/edit.blade.php
Normal file
33
Modules/Review/Resources/views/admin/products/edit.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.edit', ['resource' => trans('review::reviews.review')]))
|
||||
|
||||
<li><a href="{{ route('admin.products.index') }}">{{ trans('product::products.products') }}</a></li>
|
||||
<li><a href="{{ route('admin.products.edit', $productId) }}">{{ trans('admin::resource.edit', ['resource' => trans('product::products.product')]) }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.edit', ['resource' => trans('review::reviews.review')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.products.reviews.update', [$productId, $review]) }}" class="form-horizontal" id="review-edit-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('put') }}
|
||||
|
||||
{!! $tabs->render(compact('review')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('shortcuts')
|
||||
<dl class="dl-horizontal">
|
||||
<dt><code>b</code></dt>
|
||||
<dd>{{ trans('review::reviews.shortcuts.back_to_product_edit_page') }}</dd>
|
||||
</dl>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
keypressAction([
|
||||
{ key: 'b', route: "{{ route('admin.products.edit', $productId) }}" },
|
||||
]);
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,39 @@
|
||||
@component('admin::components.table', ['id' => 'product-reviews-table'])
|
||||
@slot('thead')
|
||||
<tr>
|
||||
@include('admin::partials.table.select_all')
|
||||
|
||||
<th>{{ trans('review::reviews.table.reviewer_name') }}</th>
|
||||
<th>{{ trans('review::reviews.table.rating') }}</th>
|
||||
<th>{{ trans('review::reviews.table.approved') }}</th>
|
||||
<th data-sort>{{ trans('admin::admin.table.date') }}</th>
|
||||
</tr>
|
||||
@endslot
|
||||
@endcomponent
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
Mousetrap.bind('del', function () {
|
||||
$('#product-reviews-table_wrapper .btn-delete').trigger('click');
|
||||
});
|
||||
|
||||
DataTable.setRoutes('#product-reviews-table', {
|
||||
index: {
|
||||
name: 'admin.reviews.index',
|
||||
params: { productId: '{{ $product->id }}' }
|
||||
},
|
||||
edit: { name: 'admin.reviews.edit' },
|
||||
destroy: { name: 'admin.reviews.destroy' },
|
||||
});
|
||||
|
||||
new DataTable('#product-reviews-table', {
|
||||
columns: [
|
||||
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },
|
||||
{ data: 'reviewer_name' },
|
||||
{ data: 'rating' },
|
||||
{ data: 'status', name: 'is_approved', searchable: false },
|
||||
{ data: 'created', name: 'created_at' },
|
||||
],
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
32
Modules/Review/Resources/views/admin/reviews/edit.blade.php
Normal file
32
Modules/Review/Resources/views/admin/reviews/edit.blade.php
Normal file
@@ -0,0 +1,32 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.edit', ['resource' => trans('review::reviews.review')]))
|
||||
|
||||
<li><a href="{{ route('admin.reviews.index') }}">{{ trans('review::reviews.reviews') }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.edit', ['resource' => trans('review::reviews.review')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.reviews.update', $review) }}" class="form-horizontal" id="review-edit-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('put') }}
|
||||
|
||||
{!! $tabs->render(compact('review')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('shortcuts')
|
||||
<dl class="dl-horizontal">
|
||||
<dt><code>b</code></dt>
|
||||
<dd>{{ trans('admin::admin.shortcuts.back_to_index', ['name' => trans('review::reviews.review')]) }}</dd>
|
||||
</dl>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
keypressAction([
|
||||
{ key: 'b', route: "{{ route('admin.reviews.index') }}" },
|
||||
]);
|
||||
</script>
|
||||
@endpush
|
||||
41
Modules/Review/Resources/views/admin/reviews/index.blade.php
Normal file
41
Modules/Review/Resources/views/admin/reviews/index.blade.php
Normal file
@@ -0,0 +1,41 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('review::reviews.reviews'))
|
||||
|
||||
<li class="active">{{ trans('review::reviews.reviews') }}</li>
|
||||
@endcomponent
|
||||
|
||||
@component('admin::components.page.index_table')
|
||||
@slot('resource', 'reviews')
|
||||
@slot('name', trans('review::reviews.review'))
|
||||
|
||||
@slot('thead')
|
||||
<tr>
|
||||
@include('admin::partials.table.select_all')
|
||||
|
||||
<th>{{ trans('admin::admin.table.id') }}</th>
|
||||
<th>{{ trans('review::reviews.table.product') }}</th>
|
||||
<th>{{ trans('review::reviews.table.reviewer_name') }}</th>
|
||||
<th>{{ trans('review::reviews.table.rating') }}</th>
|
||||
<th>{{ trans('review::reviews.table.approved') }}</th>
|
||||
<th data-sort>{{ trans('admin::admin.table.date') }}</th>
|
||||
</tr>
|
||||
@endslot
|
||||
@endcomponent
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
new DataTable('#reviews-table .table', {
|
||||
columns: [
|
||||
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },
|
||||
{ data: 'id', width: '5%' },
|
||||
{ data: 'product', name: 'product.price', orderable: false, searchable: false, defaultContent: '' },
|
||||
{ data: 'reviewer_name' },
|
||||
{ data: 'rating' },
|
||||
{ data: 'status', name: 'is_approved', searchable: false },
|
||||
{ data: 'created', name: 'created_at' },
|
||||
],
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::select('rating', trans('review::attributes.rating'), $errors, array_combine(range(1, 5), range(1, 5)), $review, ['required' => true]) }}
|
||||
{{ Form::text('reviewer_name', trans('review::attributes.reviewer_name'), $errors, $review, ['required' => true]) }}
|
||||
{{ Form::textarea('comment', trans('review::attributes.comment'), $errors, $review, ['required' => true]) }}
|
||||
{{ Form::checkbox('is_approved', trans('review::attributes.is_approved'), trans('review::reviews.form.approve_this_review'), $errors, $review) }}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user