first commit
This commit is contained in:
@@ -0,0 +1,356 @@
|
||||
@extends('theme::layouts.app')
|
||||
|
||||
@section('style')
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.10.0/css/bootstrap-datepicker.min.css" />
|
||||
<style type="text/css">
|
||||
|
||||
.dashboard-title{
|
||||
font-size: 32px;
|
||||
color: #364257;
|
||||
margin-right: 80px;
|
||||
}
|
||||
.dashboard-btn{
|
||||
margin-right: 20px;
|
||||
font-weight: bold;
|
||||
width: 250px;
|
||||
padding: 12px !important;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 30px;
|
||||
justify-content: center;
|
||||
border-radius: 3px;
|
||||
|
||||
}
|
||||
.back-btn {
|
||||
background-color: #9B0025;
|
||||
color: #FFF;
|
||||
padding: 20px 105px;
|
||||
width: 250px;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<button type="button" class="d-none reload-main-table"></button>
|
||||
|
||||
<div class="dashboard-title-flex">
|
||||
<h2 class="dashboard-title">{{ __("Document Library") }}</h2>
|
||||
<div class="dashboard-button-title">
|
||||
<a href="#" class="btn primary-button" data-bs-toggle="modal" data-bs-target="#uploadDocumentModal">{{ __("Upload Document") }}</a>
|
||||
<a href="{{ route('cms.bookkeepings') }}" class="btn btn-error">{{ __("Back") }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="search-bar flex mb-5" id="searchFilterFrm">
|
||||
<span class="search-bar__label">{{ __("Document/Record search") }}</span>
|
||||
<div class="search-bar__field">
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#searchFilterModal"><img src="{{ asset('themes/tailwind/images/setting-4.svg') }}"></button>
|
||||
<input type="text" name="main_search_file_name" class="w-100" style="box-shadow: none;">
|
||||
</div>
|
||||
<button type="submit" class="btn primary-button search-bar__button">{{ __("Search") }}</button>
|
||||
</form>
|
||||
|
||||
<div class="tabs-content">
|
||||
<div class="tabs-content-item white-bg no-padd no-box-shadow">
|
||||
<table id="documentLibrariesTable">
|
||||
<thead>
|
||||
<tr>
|
||||
{{-- <td style="width: fit-content;"><input type="checkbox"></td> --}}
|
||||
<td>{{ __("Document Name") }}</td>
|
||||
<td>{{ __("Company") }}</td>
|
||||
<td>{{ __("Document Category") }}</td>
|
||||
<td>{{ __("Upload User") }}</td>
|
||||
<td>{{ __("Document Size") }}</td>
|
||||
<td>{{ __("Date Uploaded") }}</td>
|
||||
<td>{{ __("Action") }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{-- <tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>
|
||||
<div class="flex justify-start">
|
||||
<img class="max-25" src="{{ asset('themes/tailwind/images/jpg.svg') }}">
|
||||
<span class="fix-text">202301Bank state...</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>ABC Consultant Ltd.</td>
|
||||
<td>Report</td>
|
||||
<td>Admin</td>
|
||||
<td class="primary-text">234KB</td>
|
||||
<td>20230515-14:43</td>
|
||||
<td>
|
||||
<a href="#" class="primary-text">View</a> |
|
||||
<a href="#" class="primary-text">Properties</a> |
|
||||
<a href="#" class="primary-text">Download</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>
|
||||
<div class="flex justify-start">
|
||||
<img class="max-25" src="{{ asset('themes/tailwind/images/jpg.svg') }}">
|
||||
<span class="fix-text">202301Bank state...</span>
|
||||
</div>
|
||||
</td>
|
||||
<td>ABC Consultant Ltd.</td>
|
||||
<td>Report</td>
|
||||
<td>Admin</td>
|
||||
<td class="primary-text">234KB</td>
|
||||
<td>20230515-14:43</td>
|
||||
<td>
|
||||
<a href="#" class="primary-text">View</a> |
|
||||
<a href="#" class="primary-text">Properties</a> |
|
||||
<a href="#" class="primary-text">Download</a>
|
||||
</td>
|
||||
</tr> --}}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<a href="{{ route('cms.bookkeepings.document-libraries.export') }}" class="btn primary-button w-fit-content mb-3" style="min-width: 300px;">{{ __("Download") }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Modals --}}
|
||||
{{-- Upload Document Modal --}}
|
||||
@include('theme::cms.bookkeepings.document-libraries.upload-document-modal')
|
||||
|
||||
<div class="modal fade custom-modal" id="searchFilterModal" tabindex="-1" aria-labelledby="searchFilterModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered">
|
||||
<div class="modal-content mx-auto">
|
||||
<div class="modal-body p-0">
|
||||
<p class="modal-title">{{ __("Search") }}</p>
|
||||
|
||||
<form action="#" class="theme-form" id="searchFilterModalFrm">
|
||||
<div class="row mb-5 align-items-center">
|
||||
<div class="col-4">
|
||||
<label class="col-form-label">{{ __("Document category") }}</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<select class="w-100" name="search_bookkeeping_document_category_id">
|
||||
@foreach ($categories as $category)
|
||||
<option value="{{ $category->id }}">{{ $category->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5 align-items-center">
|
||||
<div class="col-4">
|
||||
<label class="col-form-label">{{ __("Status") }}</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<select class="w-100" name="search_status">
|
||||
<option value="uploaded">{{ __("Uploaded") }}</option>
|
||||
<option value="in_progress">{{ __("In Progress") }}</option>
|
||||
<option value="ocr_complete">{{ __("OCR Complete") }}</option>
|
||||
<option value="failed">{{ __("Failed") }}</option>
|
||||
<option value="completed">{{ __("Completed") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-5 align-items-center">
|
||||
<div class="col-4">
|
||||
<label class="col-form-label">Keyword</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="text" class="form-control" value="" name="search_file_name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-4">
|
||||
<label class="col-form-label">Date uploaded</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<select class="w-100" name="search_date_uploaded">
|
||||
<option value="">Any time</option>
|
||||
<option value="today">{{ __("Today") }}</option>
|
||||
<option value="yesterday">{{ __("Yesterday") }}</option>
|
||||
<option value="last_7_days">{{ __("Last 7 days") }}</option>
|
||||
<option value="last_30_days">{{ __("Last 30 days") }}</option>
|
||||
<option value="last_90_days">{{ __("Last 90 days") }}</option>
|
||||
<option value="custom">{{ __("Custom") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="display:none;" id="customDateWrapper">
|
||||
<div class="col-md-12">
|
||||
<label class="col-form-label">Between</label>
|
||||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<input type="text" class="form-control" value="" name="search_date_from">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="text" class="form-control" value="" name="search_date_to">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button type="submit" class="btn green-btn mx-3">{{ __("Search") }}</button>
|
||||
<button type="button" class="btn red-btn mx-3" data-bs-dismiss="modal">{{ __("Cancel") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('script')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.10.0/js/bootstrap-datepicker.min.js"></script>
|
||||
<script type="text/javascript" src="{{ asset('themes/' . $theme->folder . '/js/cms/bookkeepings/document-libraries/upload-document-modal.js') }}"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var mainSearchBtnClicked = false;
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$('#searchFilterModalFrm [name="search_date_from"]').datepicker().on('changeDate', function (selected) {
|
||||
var minDate = new Date(selected.date.valueOf());
|
||||
$('#searchFilterModalFrm [name="search_date_to"]').datepicker('setStartDate', minDate);
|
||||
$('#searchFilterModalFrm [name="search_date_to"]').val('');
|
||||
});
|
||||
$('#searchFilterModalFrm [name="search_date_to"]').datepicker();
|
||||
|
||||
var documentLibrariesTable = $("#documentLibrariesTable").DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: '{{ route("cms.bookkeepings.document-libraries.table") }}',
|
||||
type: 'post',
|
||||
"data": function ( d ) {
|
||||
if (mainSearchBtnClicked == false && $('#searchFilterModal').is(':visible')) {
|
||||
return $.extend( {}, d, {
|
||||
"bookkeeping_document_category_id": $('#searchFilterModalFrm [name="search_bookkeeping_document_category_id"]').val(),
|
||||
"status": $('#searchFilterModalFrm [name="search_status"]').val(),
|
||||
"file_name": $('#searchFilterModalFrm [name="search_file_name"]').val(),
|
||||
"date_uploaded": $('#searchFilterModalFrm [name="search_date_uploaded"]').val(),
|
||||
"date_uploaded_from": $('#searchFilterModalFrm [name="search_date_from"]').val(),
|
||||
"date_uploaded_to": $('#searchFilterModalFrm [name="search_date_to"]').val(),
|
||||
} );
|
||||
}
|
||||
else if (mainSearchBtnClicked) {
|
||||
return $.extend( {}, d, {
|
||||
"file_name": $('#searchFilterFrm [name="main_search_file_name"]').val(),
|
||||
} );
|
||||
}
|
||||
else {
|
||||
return $.extend( {}, d, {} );
|
||||
}
|
||||
},
|
||||
"dataSrc": function ( json ) {
|
||||
for (var i = 0; i < json.data.length; i++) {
|
||||
$.each( json.data[i], function( key, value ) {
|
||||
json.data[i][key] = value ? value : '-';
|
||||
});
|
||||
}
|
||||
|
||||
return json.data;
|
||||
},
|
||||
complete: function (data) {
|
||||
if (mainSearchBtnClicked == false && $('#searchFilterModal').is(':visible')) {
|
||||
$('#searchFilterFrm')[0].reset();
|
||||
}
|
||||
else if (mainSearchBtnClicked) {
|
||||
$('#searchFilterModalFrm')[0].reset();
|
||||
}
|
||||
|
||||
$('#searchFilterModal').modal('hide');
|
||||
$('#searchFilterModalFrm button[type="submit"]').removeAttr('disabled');
|
||||
$('#searchFilterModalFrm button[type="submit"]').html('{{ __("Search") }}');
|
||||
|
||||
$('#searchFilterFrm button[type="submit"]').removeAttr('disabled');
|
||||
$('#searchFilterFrm button[type="submit"]').html('{{ __("Search") }}');
|
||||
|
||||
mainSearchBtnClicked = false;
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
// {data: 'checkbox', name: 'checkbox', searchable: false, sortable: false},
|
||||
{data: 'file_name', name: 'bookkeeping_documents.file_name'},
|
||||
('{{ strtolower(app()->getLocale()) }}' == 'zh_hk' ? {data: 'name_chinese', name: 'companies.name_chinese'} : {data: 'name_english', name: 'companies.name_english'}),
|
||||
{data: 'category_name', name: 'bookkeeping_document_categories.name'},
|
||||
{data: 'user_name', name: 'users.name'},
|
||||
{data: 'document_size', name: 'document_size', searchable: false, sortable: false},
|
||||
{data: 'created_at', name: 'bookkeeping_documents.created_at'},
|
||||
{data: 'actions', name: 'actions', searchable: false, sortable: false}
|
||||
],
|
||||
order: [[5, "desc"]],
|
||||
searchDelay: 500,
|
||||
"language": {
|
||||
"paginate": {
|
||||
"next": ">", // Text for the "Next" page button
|
||||
"previous": "<" // Text for the "Previous" page button
|
||||
},
|
||||
"emptyTable": '{{ __("No data available in table") }}'
|
||||
// Add more text customizations if needed
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', '#searchFilterModalFrm [name="search_date_uploaded"]', function (e) {
|
||||
if ($(this).val() == 'custom') {
|
||||
$('#searchFilterModalFrm #customDateWrapper').show();
|
||||
}
|
||||
else {
|
||||
$('#searchFilterModalFrm #customDateWrapper').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.reload-main-table', function (e) {
|
||||
documentLibrariesTable.ajax.reload();
|
||||
});
|
||||
|
||||
$(document).on('submit', '#searchFilterModalFrm', function (e) {
|
||||
e.preventDefault();
|
||||
var button = $(this).find('button[type="submit"]');
|
||||
var buttonHtml = button.html();
|
||||
|
||||
if (!button.is(':disabled')) {
|
||||
button.attr('disabled', 'disabled');
|
||||
button.html('<i class="fa fa-spinner fa-spin" style="font-size:24px"></i>');
|
||||
documentLibrariesTable.ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', '#searchFilterFrm', function (e) {
|
||||
e.preventDefault();
|
||||
var button = $(this).find('button[type="submit"]');
|
||||
var buttonHtml = button.html();
|
||||
|
||||
if (!button.is(':disabled')) {
|
||||
button.attr('disabled', 'disabled');
|
||||
button.html('<i class="fa fa-spinner fa-spin" style="font-size:24px"></i>');
|
||||
mainSearchBtnClicked = true;
|
||||
documentLibrariesTable.ajax.reload();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.download-file', function (e) {
|
||||
var id = $(this).attr('data-id');
|
||||
var url = '{{ route("cms.bookkeepings.document-libraries.download", ["document" => ":id"]) }}';
|
||||
|
||||
if (id) {
|
||||
$.ajax({
|
||||
url: url.replace(':id', id),
|
||||
type: "get",
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success:function(data) {
|
||||
},
|
||||
error: function(data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,176 @@
|
||||
|
||||
<style type="text/css">
|
||||
.pop-up-btn-confirm {
|
||||
background-image: linear-gradient(to right, #62C5BD , #C8E1A4) !important;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.pop-up-btn-deny {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
select {
|
||||
background-color: #EBEBE4;
|
||||
}
|
||||
|
||||
.select-width {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.fix-text{
|
||||
white-space: pre;
|
||||
text-overflow: ellipsis;
|
||||
width: 130px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.d-none{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.dragDropContainer{
|
||||
border: 2px dashed #000;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-upload{
|
||||
background-color: #58C2B1;
|
||||
padding: 10px 50px;
|
||||
color: #000;
|
||||
box-shadow: 0px 4px 8px #15785440;
|
||||
}
|
||||
|
||||
.uploadingContainer{
|
||||
background-color: #F4F7FA;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.group-input-cont{
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.group-input-label{
|
||||
float: left;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.group-input{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.group-input-span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
padding-right:10px;
|
||||
}
|
||||
|
||||
.uploaded-file-container {
|
||||
background-color: #F4F7FA;
|
||||
padding: 15px 10px;
|
||||
height: calc(100vh - 630px);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.uploaded-file-container .file-row {
|
||||
border-bottom: 1px solid;
|
||||
border-image-source: linear-gradient(90deg, rgba(87, 87, 87, 0.2) 0%, #010101 48.44%, rgba(74, 74, 74, 0.2) 100%);
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details .file-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
line-height: 25px;
|
||||
letter-spacing: 0em;
|
||||
color: #000000;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details .file-progress-wrapper {
|
||||
background-color: #EBEBE4;
|
||||
width: 250px;
|
||||
height: 39px;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details .file-progress-wrapper .file-progress {
|
||||
height: 100%;
|
||||
background-color: #2C21FE;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details .file-progress-wrapper .file-progress.green {
|
||||
background-color: #06AE25;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details .file-progress-remove {
|
||||
cursor: pointer;
|
||||
}
|
||||
.uploaded-file-container .file-row .file-details select {
|
||||
padding: 8px 12px;
|
||||
padding-right: 40px;
|
||||
}
|
||||
.uploaded-file-container .file-row-separator {
|
||||
background: linear-gradient(90deg, rgba(87, 87, 87, 0.2) 0%, #010101 48.44%, rgba(74, 74, 74, 0.2) 100%);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.uploaded-file-count {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
line-height: 27px;
|
||||
letter-spacing: 0em;
|
||||
color: #06AE25;
|
||||
margin-bottom: 30px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="modal fade custom-modal" id="uploadDocumentModal" tabindex="-1" aria-labelledby="uploadDocumentModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||
<div class="modal-content mx-auto">
|
||||
<div class="modal-body p-0">
|
||||
<p class="modal-title">{{ __("Upload Document") }}</p>
|
||||
|
||||
<form action="{{ route('cms.bookkeepings.document-libraries.store') }}" class="theme-form" id="uploadDocumentFrm">
|
||||
<div class="row mb-5 align-items-center">
|
||||
<div class="col-auto" required>
|
||||
<label class="col-form-label">{{ __("Company Name") }}</label>
|
||||
</div>
|
||||
<div class="col">
|
||||
<select class="w-100" name="company_id">
|
||||
<option value="" selected>{{ __("Select a company") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<input type="file" name="uploaded_files" id="updloadedFiles" class="d-none" accept="image/png, image/jpeg, application/pdf, application/msword" multiple>
|
||||
<div class="dragDropContainer flex justify-between mb-5">
|
||||
<div class="flex">
|
||||
<img src="/themes/tailwind/images/cloudUpload.png" alt="Cloud Upload" class="mr-5">
|
||||
<span style="color:#58C2B1;">
|
||||
{{ __("Drag and drop files here or choose file.") }}
|
||||
<br>
|
||||
{{ __("Accepted file types: Doc / PDF / JPG / PNG") }}
|
||||
</span>
|
||||
</div>
|
||||
<button type="button" class="btn-upload">{{ __("Choose File") }}</button>
|
||||
</div>
|
||||
<div class="uploaded-file-container" id="uploadedFileList"></div>
|
||||
<div class="uploaded-file-count" id="uploadedFileCount">
|
||||
<span id="totalDone">0</span> {{ __("of") }} <span id="totalFile">0</span> {{ __("files uploaded") }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button type="submit" class="btn green-btn mx-3">{{ __("Submit in queue") }}</button>
|
||||
<button type="button" class="btn red-btn mx-3" data-bs-dismiss="modal">{{ __("Cancel") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user