Update source into github
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("add package module"))
|
||||
<div class="card card-outline card-primary">
|
||||
<form action="{{ route('package.group.store') }}" method="post">
|
||||
@csrf
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{--Name--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="name" class="col-md-3 text-right">Group Name</label>
|
||||
<div class="col-md-9 p-1 bg-customer">
|
||||
<input type="text" id="name" name="name" placeholder="" value="" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{--Thumbnail--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="thumbnail" class="col-md-3 text-right">Thumbnail</label>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-8 bg-customer">
|
||||
<input type="text" data-choise="upload-images" name="thumbnail"
|
||||
value="{{ old('thumbnail') }}" class="form-control" placeholder="Chọn File">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-outline-secondary btn-open-thumb">
|
||||
<i class="fas fa-folder-open"></i> Chọn hình ảnh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-module.v-center :model="null" />
|
||||
<x-module.datacenter :model="null" />
|
||||
<x-module.host :model="null" />
|
||||
{{--Status--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="status" class="col-md-3 text-right">Status</label>
|
||||
<div class="col-md-9 bg-customer">
|
||||
<select class="custom-select" id="status" name="status">
|
||||
<option value="1" @selected(old('status') === 1)>Active</option>
|
||||
<option value="0" @selected(old('status') === 0)>No Active</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{{ route('package.group.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module Package
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$('.btn-open-thumb').click(function () {
|
||||
CKFinder.popup({
|
||||
chooseFiles: true,
|
||||
onInit: function (finder) {
|
||||
finder.on('files:choose', function (evt) {
|
||||
let img = $('input[name="thumbnail"]');
|
||||
if (img.length) {
|
||||
img.val(evt.data.files.first().getUrl())
|
||||
img.trigger('input')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,82 @@
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("add package module"))
|
||||
<div class="card card-outline card-primary">
|
||||
<form action="{{ route('package.group.update',['id' => $group->id]) }}" method="post">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{--Name--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="name" class="col-md-3 text-right">Group Name</label>
|
||||
<div class="col-md-9 p-1 bg-customer">
|
||||
<input type="text" id="name" name="name" placeholder="" value="{{$group->name}}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
{{--Thumbnail--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="thumbnail" class="col-md-3 text-right">Thumbnail</label>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-8 bg-customer">
|
||||
<input type="text" data-choise="upload-images" name="thumbnail"
|
||||
value="{{$group->thumbnail ?? old('thumbnail')}}" class="form-control" placeholder="Chọn File">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-outline-secondary btn-open-thumb">
|
||||
<i class="fas fa-folder-open"></i> Chọn hình ảnh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-module.v-center :model="$group->host->datacenter" />
|
||||
<x-module.datacenter :model="$group->host" />
|
||||
<x-module.host :model="$group" />
|
||||
{{--Status--}}
|
||||
<div class="row form-group align-items-center mb-0">
|
||||
<label for="status" class="col-md-3 text-right">Status</label>
|
||||
<div class="col-md-9 bg-customer">
|
||||
<select class="custom-select" id="status" name="status">
|
||||
<option value="1" @selected($group->status === 1)>Active</option>
|
||||
<option value="0" @selected($group->status === 0)>No Active</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="{{ route('package.group.index') }}" class="btn btn-outline-secondary">Trở về</a>
|
||||
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module Package
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$('.btn-open-thumb').click(function () {
|
||||
CKFinder.popup({
|
||||
chooseFiles: true,
|
||||
onInit: function (finder) {
|
||||
finder.on('files:choose', function (evt) {
|
||||
let img = $('input[name="thumbnail"]');
|
||||
if (img.length) {
|
||||
img.val(evt.data.files.first().getUrl())
|
||||
img.trigger('input')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,85 @@
|
||||
@php use App\Http\Helpers\Helper; @endphp
|
||||
@extends('admin.main')
|
||||
@section('content')
|
||||
@if(auth()->guard('admins')->user()->can("manager package module"))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
@include("admin.block.Group")
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-invoice table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<label>
|
||||
<input type="checkbox" name="check" class="check-all">
|
||||
</label>
|
||||
</th>
|
||||
<th>Group Name</th>
|
||||
<th>Thumbnail</th>
|
||||
<th>Host Name</th>
|
||||
<th>Status</th>
|
||||
<th style="width: 40px"></th>
|
||||
<th style="width: 40px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($group->count())
|
||||
@foreach($group->all() as $item)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<label for=""></label><input type="checkbox" name="id[]" value="{{ $item->id }}"
|
||||
id="">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ $item->name }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<img
|
||||
style="height: 60px"
|
||||
src="{{ $item->thumbnail ?? "" }}"
|
||||
alt="{{ $item->name }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@isset( $item->host->name)
|
||||
{{$item->host->name}}
|
||||
@endisset
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{!! $item->getStatus() !!}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-warning btn-sm"
|
||||
href="{{ route('package.group.edit',['id' => $item->id]) }}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<form method="post"
|
||||
class="d-inline"
|
||||
action="{{ route('package.group.destroy',['id' => $item->id]) }}">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
||||
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ $group->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module Package
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in New Issue
Block a user