Updated Google Avatar, Admin Features, All Pages with small changes, Filters in Publications Page
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
<!-- Column Selector -->
|
||||
<div class="flex justify-between col-md-12 mt-3 mb-4">
|
||||
<!-- Include the reusable download-proofs component -->
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'ActivitiesOrganised'" />
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'ExternalEngagement'" />
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
$labels = [
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<!-- Column Selector -->
|
||||
<div class="flex justify-between col-md-12 mt-3 mb-4">
|
||||
<!-- Include the reusable download-proofs component -->
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'ActivitiesOrganised'" />
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'OnlineCourse'" />
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
$labels = [
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<h3 class="page-title m-0">
|
||||
<i class="fas fa-book-open me-2 text-primary"></i>All Publications
|
||||
</h3>
|
||||
<!-- Include the reusable send-email component -->
|
||||
<x-send-email />
|
||||
@if(auth()->user()->role->name === 'Faculty')
|
||||
<input type="hidden" id="scholar-url" value="{{ $scholarUrl ?? '' }}">
|
||||
<button id="btn-fetch-scholar" class="btn btn-outline-primary">
|
||||
@@ -57,8 +59,6 @@
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- Include the reusable send-email component -->
|
||||
<x-send-email />
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@@ -88,14 +88,16 @@
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-light">Peer Reviewed</span>
|
||||
<select id="is_peer_reviewed-filter" class="form-select">
|
||||
<span class="input-group-text bg-light">Category</span>
|
||||
<select id="category-filter" class="form-select">
|
||||
<option value="">All</option>
|
||||
<option value="Yes">Yes</option>
|
||||
<option value="No">No</option>
|
||||
<option value="SCI">SCI</option>
|
||||
<option value="Scopus">Scopus</option>
|
||||
<option value="Peer Reviewed">Peer Reviewed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-light">Date Range</span>
|
||||
@@ -109,7 +111,7 @@
|
||||
<!-- Column Selector -->
|
||||
<div class="flex justify-between col-md-12 mt-3 mb-4">
|
||||
<!-- Include the reusable download-proofs component -->
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'ActivitiesOrganised'" />
|
||||
<x-download-proofs :route="route('admin.downloadProofs')" :model="'Publications'" />
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
$labels = [
|
||||
|
||||
@@ -31,41 +31,49 @@
|
||||
<select id="role-filter" class="form-select">
|
||||
<option value="">All Roles</option>
|
||||
<!-- Category options would be populated dynamically -->
|
||||
@foreach($roles as $role)
|
||||
<option value="{{ $role->id }}">{{ $role->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 d-flex justify-content-end">
|
||||
<!-- Column Selector -->
|
||||
<div id="columnsSelector" class="">
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
$labels = [
|
||||
'ID',
|
||||
'Name',
|
||||
'Email',
|
||||
'Department Name',
|
||||
'Orcid Id',
|
||||
'Scopus Id',
|
||||
'Mobile No',
|
||||
'Extension',
|
||||
'Role Name',
|
||||
'Actions',
|
||||
<div class="col-md-4 d-flex justify-content-end gap-2">
|
||||
<!-- Add User Button -->
|
||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#addUserModal">
|
||||
<i class="fas fa-plus me-1"></i> Add User
|
||||
</button>
|
||||
|
||||
<!-- Column Selector -->
|
||||
<div id="columnsSelector" class="">
|
||||
@php
|
||||
use Illuminate\Support\Str;
|
||||
$labels = [
|
||||
'ID',
|
||||
'Name',
|
||||
'Email',
|
||||
'Department Name',
|
||||
'Orcid Id',
|
||||
'Scopus Id',
|
||||
'Mobile No',
|
||||
'Extension',
|
||||
'Role Name',
|
||||
'Actions',
|
||||
];
|
||||
$columns = [];
|
||||
foreach ($labels as $i => $label) {
|
||||
$columns[] = [
|
||||
'label' => $label,
|
||||
'id' => 'column-' . Str::slug($label, '-'),
|
||||
'value' => $i, // 0-based index
|
||||
'checked' => true,
|
||||
];
|
||||
$columns = [];
|
||||
foreach ($labels as $i => $label) {
|
||||
$columns[] = [
|
||||
'label' => $label,
|
||||
'id' => 'column-' . Str::slug($label, '-'),
|
||||
'value' => $i, // 0-based index
|
||||
'checked' => true,
|
||||
];
|
||||
}
|
||||
@endphp
|
||||
<x-column-selector :columns="$columns" />
|
||||
</div>
|
||||
}
|
||||
@endphp
|
||||
<x-column-selector :columns="$columns" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Table -->
|
||||
@@ -95,6 +103,74 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add User Modal -->
|
||||
<div class="modal fade" id="addUserModal" tabindex="-1" aria-labelledby="addUserModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-danger text-white">
|
||||
<h5 class="modal-title" id="addUserModalLabel">Add New User</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<form id="addUserForm">
|
||||
<div class="modal-body">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label for="name" class="form-label">Name <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="email" class="form-label">Email <span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="password" class="form-label">Password <span class="text-danger">*</span></label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="role_id" class="form-label">Role <span class="text-danger">*</span></label>
|
||||
<select class="form-select" id="role_id" name="role_id" required>
|
||||
<option value="" selected disabled>Select Role</option>
|
||||
<option value="1">Admin</option>
|
||||
<option value="2">HOD</option>
|
||||
<option value="3">Faculty</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="department_id" class="form-label">Department</label>
|
||||
<select class="form-select" id="department_id" name="department_id">
|
||||
<option value="" selected disabled>Select Department</option>
|
||||
@foreach($departments as $department)
|
||||
<option value="{{ $department->id }}">{{ $department->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="mobile_no" class="form-label">Mobile No</label>
|
||||
<input type="text" class="form-control" id="mobile_no" name="mobile_no">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="extension" class="form-label">Extension</label>
|
||||
<input type="text" class="form-control" id="extension" name="extension">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="orcid_id" class="form-label">ORCID ID</label>
|
||||
<input type="text" class="form-control" id="orcid_id" name="orcid_id">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="scopus_id" class="form-label">Scopus ID</label>
|
||||
<input type="text" class="form-control" id="scopus_id" name="scopus_id">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-danger">Save User</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
@@ -358,6 +434,44 @@
|
||||
$('#department-filter').val(departmentId).trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
// Handle Add User Form Submission
|
||||
$('#addUserForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Clear previous errors
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
$('.invalid-feedback').remove();
|
||||
|
||||
const formData = new FormData(this);
|
||||
formData.append('_token', csrf_token);
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('users.store') }}",
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
$('#addUserModal').modal('hide');
|
||||
$('#addUserForm')[0].reset();
|
||||
table.ajax.reload();
|
||||
showToast('User added successfully', 'success');
|
||||
},
|
||||
error: function(xhr) {
|
||||
if (xhr.status === 422) {
|
||||
const errors = xhr.responseJSON.errors;
|
||||
Object.keys(errors).forEach(function(key) {
|
||||
const input = $(`#${key}`);
|
||||
input.addClass('is-invalid');
|
||||
input.after(`<div class="invalid-feedback">${errors[key][0]}</div>`);
|
||||
});
|
||||
} else {
|
||||
showToast('Error adding user', 'danger');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user