fix redirect back spatial plannings
This commit is contained in:
@@ -8,6 +8,7 @@ import GeneralTable from "../../table-generator.js";
|
||||
const tableElement = document.getElementById("spatial-planning-data-table");
|
||||
const canUpdate = tableElement.getAttribute("data-updater") === "1";
|
||||
const canDelete = tableElement.getAttribute("data-destroyer") === "1";
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
|
||||
const dataSpatialPlanningColumns = [
|
||||
"No",
|
||||
@@ -23,7 +24,7 @@ const dataSpatialPlanningColumns = [
|
||||
widht: "120px",
|
||||
formatter: function (cell, row) {
|
||||
const id = row.cells[8].data;
|
||||
const model = "data/spatial-plannings";
|
||||
const model = "data/web-spatial-plannings";
|
||||
|
||||
let actionButtons = '<div class="d-flex justify-items-end gap-10">';
|
||||
let hasPrivilege = false;
|
||||
@@ -34,7 +35,8 @@ const dataSpatialPlanningColumns = [
|
||||
actionButtons += `
|
||||
<button class="btn btn-warning me-2 btn-edit"
|
||||
data-id="${id}"
|
||||
data-model="${model}">
|
||||
data-model="${model}"
|
||||
data-menu="${menuId}">
|
||||
<i class='bx bx-edit'></i>
|
||||
</button>`;
|
||||
}
|
||||
@@ -49,10 +51,14 @@ const dataSpatialPlanningColumns = [
|
||||
</button>`;
|
||||
}
|
||||
|
||||
actionButtons += '</div>';
|
||||
actionButtons += "</div>";
|
||||
|
||||
// Jika tidak memiliki akses, tampilkan teks "No Privilege"
|
||||
return gridjs.html(hasPrivilege ? actionButtons : '<span class="text-muted">No Privilege</span>');
|
||||
return gridjs.html(
|
||||
hasPrivilege
|
||||
? actionButtons
|
||||
: '<span class="text-muted">No Privilege</span>'
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -5,6 +5,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
const modalButton = document.querySelector(".btn-modal");
|
||||
const form = document.querySelector("form#create-update-form");
|
||||
var authLogo = document.querySelector(".auth-logo");
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
|
||||
if (!saveButton || !form) return;
|
||||
|
||||
@@ -73,7 +74,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
}, 3000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.href = "/data/web-spatial-plannings";
|
||||
window.location.href = `/data/web-spatial-plannings?menu_id=${menuId}`;
|
||||
}, 3000);
|
||||
} else {
|
||||
if (authLogo) {
|
||||
|
||||
@@ -28,6 +28,7 @@ console.log(dropzonePreviewNode);
|
||||
.getAttribute("content")}`,
|
||||
},
|
||||
init: function () {
|
||||
let menuId = document.getElementById("menuId").value;
|
||||
// Listen for the success event
|
||||
this.on("success", function (file, response) {
|
||||
console.log("File successfully uploaded:", file);
|
||||
@@ -39,7 +40,7 @@ console.log(dropzonePreviewNode);
|
||||
"Upload Files";
|
||||
// Tunggu sebentar lalu reload halaman
|
||||
setTimeout(() => {
|
||||
window.location.href = "/data/web-spatial-plannings";
|
||||
window.location.href = `/data/web-spatial-plannings?menu_id=${menuId}`;
|
||||
}, 2000);
|
||||
});
|
||||
// Listen for the error event
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => 'Form', 'subtitle' => 'File Uploads'])
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
|
||||
@include('layouts.partials/page-title', ['title' => $title, 'subtitle' => $subtitle]) <!-- Menggunakan title dan subtitle dari controller -->
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="row d-flex justify-content-center">
|
||||
@if (session('error'))
|
||||
<div class="alert alert-danger">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
@include('layouts.partials/page-title', ['title' => 'Data', 'subtitle' => 'Rencana Tata Ruang'])
|
||||
|
||||
<input type="hidden" id="menuId" value="{{ $menuId ?? 0 }}">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Daftar Rencana Tata Ruang</h5>
|
||||
@@ -15,10 +15,10 @@
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-end gap-10 pb-3">
|
||||
@if ($creator)
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings">
|
||||
<button class="btn btn-success me-2 width-lg btn-create" data-model="data/spatial-plannings" data-menu="{{ $menuId }}">
|
||||
<i class='bx bxs-file-plus'></i>
|
||||
Create</button>
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings">
|
||||
<button class="btn btn-primary width-lg btn-bulk-create" data-model="data/spatial-plannings" data-menu="{{ $menuId }}">
|
||||
<i class='bx bx-upload' ></i>
|
||||
Bulk Create
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user