deleting documents, bug fixes
This commit is contained in:
@@ -7,15 +7,16 @@ $(document).ready(function () {
|
||||
|
||||
documents.forEach((doc) => {
|
||||
const row = document.createElement("tr");
|
||||
row.setAttribute(
|
||||
"onclick",
|
||||
`window.open('` + API_SERVER + `/` + doc.path + `', '_blank')`
|
||||
);
|
||||
|
||||
const data = document.createElement("td");
|
||||
|
||||
const rowContainer = document.createElement("div");
|
||||
rowContainer.setAttribute("class", "row-container");
|
||||
rowContainer.setAttribute("class", "row-container with-button");
|
||||
|
||||
rowContainer.setAttribute(
|
||||
"onclick",
|
||||
`window.open('` + API_SERVER + `/` + doc.path + `', '_blank')`
|
||||
);
|
||||
|
||||
const rowIcon = document.createElement("div");
|
||||
rowIcon.setAttribute("class", "row-icon");
|
||||
@@ -62,6 +63,7 @@ $(document).ready(function () {
|
||||
|
||||
const documentName = document.createElement("h1");
|
||||
documentName.textContent = doc.name;
|
||||
documentName.setAttribute("id", `doc-name-${doc.id}`);
|
||||
rowContent.appendChild(documentName);
|
||||
|
||||
const documentType = document.createElement("h2");
|
||||
@@ -74,27 +76,31 @@ $(document).ready(function () {
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
|
||||
// const deleteIcon = document.createElement("div");
|
||||
// deleteIcon.setAttribute("class", "row-delete-icon");
|
||||
|
||||
// let deleteContent = `
|
||||
// <svg xmlns="http://www.w3.org/2000/svg" width="21" height="25" viewBox="0 0 21 25" fill="none">
|
||||
// <g clip-path="url(#clip0_369_11)">
|
||||
// <path d="M6.98543 19.8025C7.38047 19.8025 7.64032 19.553 7.62993 19.1892L7.3077 8.06653C7.29731 7.7027 7.03742 7.46362 6.6632 7.46362C6.2682 7.46362 6.00831 7.71309 6.0187 8.07692L6.33058 19.1892C6.34097 19.5634 6.60082 19.8025 6.98543 19.8025ZM10.0624 19.8025C10.4574 19.8025 10.738 19.553 10.738 19.1892V8.07692C10.738 7.71309 10.4574 7.46362 10.0624 7.46362C9.66737 7.46362 9.39709 7.71309 9.39709 8.07692V19.1892C9.39709 19.553 9.66737 19.8025 10.0624 19.8025ZM13.1497 19.8025C13.5239 19.8025 13.7838 19.5634 13.7942 19.1892L14.106 8.07692C14.1164 7.71309 13.8565 7.46362 13.4615 7.46362C13.0873 7.46362 12.8275 7.7027 12.817 8.07692L12.5052 19.1892C12.4948 19.553 12.7547 19.8025 13.1497 19.8025ZM5.49895 4.75051H7.15178V2.52599C7.15178 1.93347 7.56755 1.54886 8.19128 1.54886H11.9127C12.5364 1.54886 12.9522 1.93347 12.9522 2.52599V4.75051H14.605V2.42204C14.605 0.914762 13.6278 0 12.027 0H8.07692C6.47611 0 5.49895 0.914762 5.49895 2.42204V4.75051ZM0.779624 5.58214H19.3555C19.7817 5.58214 20.1247 5.21831 20.1247 4.79211C20.1247 4.3659 19.7817 4.01248 19.3555 4.01248H0.779624C0.363825 4.01248 0 4.3659 0 4.79211C0 5.2287 0.363825 5.58214 0.779624 5.58214ZM5.30147 23.1497H14.8337C16.3202 23.1497 17.3181 22.183 17.3908 20.6965L18.1185 5.38462H16.4449L15.7484 20.5198C15.7277 21.1435 15.2807 21.5801 14.6673 21.5801H5.447C4.85449 21.5801 4.4075 21.1331 4.37629 20.5198L3.63825 5.38462H2.00624L2.74428 20.7069C2.81705 22.1933 3.79418 23.1497 5.30147 23.1497Z" fill="#FF3B30" fill-opacity="0.85"/>
|
||||
// </g>
|
||||
// <defs>
|
||||
// <clipPath id="clip0_369_11">
|
||||
// <rect width="20.1247" height="25" fill="white"/>
|
||||
// </clipPath>
|
||||
// </defs>
|
||||
// </svg>
|
||||
// `;
|
||||
|
||||
// deleteIcon.innerHTML = deleteContent;
|
||||
|
||||
// rowContainer.appendChild(deleteIcon);
|
||||
|
||||
data.appendChild(rowContainer);
|
||||
|
||||
if (isAdmin && isFull) {
|
||||
const deleteContainer = document.createElement("div");
|
||||
deleteContainer.setAttribute("class", "row-delete-container");
|
||||
deleteContainer.setAttribute("onclick", `deleteDoc(${doc.id});`);
|
||||
|
||||
let deleteContent = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="25" viewBox="0 0 21 25" fill="none">
|
||||
<g clip-path="url(#clip0_369_11)">
|
||||
<path d="M6.98543 19.8025C7.38047 19.8025 7.64032 19.553 7.62993 19.1892L7.3077 8.06653C7.29731 7.7027 7.03742 7.46362 6.6632 7.46362C6.2682 7.46362 6.00831 7.71309 6.0187 8.07692L6.33058 19.1892C6.34097 19.5634 6.60082 19.8025 6.98543 19.8025ZM10.0624 19.8025C10.4574 19.8025 10.738 19.553 10.738 19.1892V8.07692C10.738 7.71309 10.4574 7.46362 10.0624 7.46362C9.66737 7.46362 9.39709 7.71309 9.39709 8.07692V19.1892C9.39709 19.553 9.66737 19.8025 10.0624 19.8025ZM13.1497 19.8025C13.5239 19.8025 13.7838 19.5634 13.7942 19.1892L14.106 8.07692C14.1164 7.71309 13.8565 7.46362 13.4615 7.46362C13.0873 7.46362 12.8275 7.7027 12.817 8.07692L12.5052 19.1892C12.4948 19.553 12.7547 19.8025 13.1497 19.8025ZM5.49895 4.75051H7.15178V2.52599C7.15178 1.93347 7.56755 1.54886 8.19128 1.54886H11.9127C12.5364 1.54886 12.9522 1.93347 12.9522 2.52599V4.75051H14.605V2.42204C14.605 0.914762 13.6278 0 12.027 0H8.07692C6.47611 0 5.49895 0.914762 5.49895 2.42204V4.75051ZM0.779624 5.58214H19.3555C19.7817 5.58214 20.1247 5.21831 20.1247 4.79211C20.1247 4.3659 19.7817 4.01248 19.3555 4.01248H0.779624C0.363825 4.01248 0 4.3659 0 4.79211C0 5.2287 0.363825 5.58214 0.779624 5.58214ZM5.30147 23.1497H14.8337C16.3202 23.1497 17.3181 22.183 17.3908 20.6965L18.1185 5.38462H16.4449L15.7484 20.5198C15.7277 21.1435 15.2807 21.5801 14.6673 21.5801H5.447C4.85449 21.5801 4.4075 21.1331 4.37629 20.5198L3.63825 5.38462H2.00624L2.74428 20.7069C2.81705 22.1933 3.79418 23.1497 5.30147 23.1497Z" fill="#FF3B30" fill-opacity="0.85"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_369_11">
|
||||
<rect width="20.1247" height="25" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
`;
|
||||
|
||||
deleteContainer.innerHTML = deleteContent;
|
||||
|
||||
data.appendChild(deleteContainer);
|
||||
}
|
||||
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user