initial commit
This commit is contained in:
90
static/scripts/different-payments-table.js
Normal file
90
static/scripts/different-payments-table.js
Normal file
@@ -0,0 +1,90 @@
|
||||
$(document).ready(function () {
|
||||
const createPaidTable = () => {
|
||||
const table = document.getElementById("paidTable");
|
||||
const tbody = table.querySelector("tbody");
|
||||
// Очищаем таблицу
|
||||
tbody.innerHTML = "";
|
||||
|
||||
paidPayments.forEach((payment) => {
|
||||
const row = document.createElement("tr");
|
||||
if (payment.path) {
|
||||
row.setAttribute(
|
||||
"onclick",
|
||||
`window.open('` + API_SERVER + `/` + payment.path + `', '_blank')`
|
||||
);
|
||||
}
|
||||
|
||||
const data = document.createElement("td");
|
||||
|
||||
const rowContainer = document.createElement("div");
|
||||
rowContainer.setAttribute("class", "row-container");
|
||||
|
||||
const rowContent = document.createElement("div");
|
||||
rowContent.setAttribute("class", "row-content");
|
||||
|
||||
const paymentAmount = document.createElement("h1");
|
||||
paymentAmount.textContent =
|
||||
payment.amount.toLocaleString("ru-RU") + " рублей";
|
||||
rowContent.appendChild(paymentAmount);
|
||||
|
||||
const paymentDate = document.createElement("h2");
|
||||
paymentDate.textContent = payment.date;
|
||||
rowContent.appendChild(paymentDate);
|
||||
|
||||
const paymentDescription = document.createElement("span");
|
||||
paymentDescription.textContent = payment.name;
|
||||
rowContent.appendChild(paymentDescription);
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
data.appendChild(rowContainer);
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
const createNotPaidTable = () => {
|
||||
const table = document.getElementById("notPaidTable");
|
||||
const tbody = table.querySelector("tbody");
|
||||
// Очищаем таблицу
|
||||
tbody.innerHTML = "";
|
||||
|
||||
notPaidPayments.forEach((payment) => {
|
||||
const row = document.createElement("tr");
|
||||
if (payment.path) {
|
||||
row.setAttribute(
|
||||
"onclick",
|
||||
`window.open('` + API_SERVER + `/` + payment.path + `', '_blank')`
|
||||
);
|
||||
}
|
||||
|
||||
const data = document.createElement("td");
|
||||
|
||||
const rowContainer = document.createElement("div");
|
||||
rowContainer.setAttribute("class", "row-container");
|
||||
|
||||
const rowContent = document.createElement("div");
|
||||
rowContent.setAttribute("class", "row-content");
|
||||
|
||||
const paymentAmount = document.createElement("h1");
|
||||
paymentAmount.textContent =
|
||||
payment.amount.toLocaleString("ru-RU") + " рублей";
|
||||
rowContent.appendChild(paymentAmount);
|
||||
|
||||
const paymentDate = document.createElement("h2");
|
||||
paymentDate.textContent = payment.date;
|
||||
rowContent.appendChild(paymentDate);
|
||||
|
||||
const paymentDescription = document.createElement("span");
|
||||
paymentDescription.textContent = payment.name;
|
||||
rowContent.appendChild(paymentDescription);
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
data.appendChild(rowContainer);
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
createPaidTable();
|
||||
createNotPaidTable();
|
||||
});
|
||||
83
static/scripts/documents-table.js
Normal file
83
static/scripts/documents-table.js
Normal file
@@ -0,0 +1,83 @@
|
||||
$(document).ready(function () {
|
||||
const createTable = () => {
|
||||
const table = document.getElementById("documentsTable");
|
||||
const tbody = table.querySelector("tbody");
|
||||
// Очищаем таблицу
|
||||
tbody.innerHTML = "";
|
||||
|
||||
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");
|
||||
|
||||
const rowIcon = document.createElement("div");
|
||||
rowIcon.setAttribute("class", "row-icon");
|
||||
|
||||
let svgContent;
|
||||
if (doc.type === "pdf") {
|
||||
svgContent = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="22" viewBox="0 0 17 22" fill="none">
|
||||
<g clip-path="url(#clip0_209_356)">
|
||||
<path d="M3.13331 22H13.8656C15.9588 22 16.9989 20.922 16.9989 18.788V9.471H9.68256C8.38844 9.471 7.77219 8.8451 7.77219 7.5317V0H3.13438C1.05081 0 0 1.0879 0 3.223V18.788C0 20.933 1.04125 22 3.13331 22ZM8.53081 14.7103C8.8655 14.7103 9.13963 14.773 9.35319 14.8984C9.56781 15.0238 9.72506 15.2042 9.82812 15.4374C9.93119 15.6706 9.98325 15.95 9.98325 16.2734C9.98325 16.6012 9.93013 16.8839 9.826 17.1215C9.72762 17.3531 9.56003 17.5459 9.34788 17.6715C9.13431 17.7991 8.86125 17.8629 8.53081 17.8629H7.27069V14.7103H8.53081ZM12.6267 14.7103V15.3197H11.2604V16.082H12.5035V16.6727H11.2604V17.8629H10.4869V14.7103H12.6267ZM5.70244 14.7103C5.95 14.7103 6.15719 14.7598 6.32294 14.8599C6.48975 14.9589 6.61513 15.0909 6.70013 15.2559C6.78513 15.422 6.82763 15.6046 6.82763 15.8037C6.82763 16.0039 6.78406 16.1865 6.698 16.3493C6.61061 16.515 6.47842 16.6507 6.31763 16.7398C6.12503 16.8423 5.91037 16.8923 5.69394 16.885H5.11912V17.8629H4.34563V14.7103H5.70244ZM8.40756 15.312H8.04419V17.2601H8.40756C8.54569 17.2601 8.66256 17.2403 8.76138 17.2007C8.85628 17.1636 8.9399 17.1009 9.00362 17.0192C9.07059 16.9298 9.11841 16.8267 9.14387 16.7167C9.17362 16.5957 9.1885 16.4538 9.1885 16.2921C9.1885 16.0765 9.16194 15.8961 9.10775 15.7498C9.06155 15.6139 8.97247 15.498 8.85487 15.4209C8.71883 15.3422 8.56434 15.3041 8.40863 15.3109L8.40756 15.312ZM5.525 15.2933H5.117V16.3141H5.525C5.6204 16.3168 5.71506 16.296 5.80125 16.2536C5.8771 16.216 5.9401 16.1554 5.98188 16.0798C6.02508 15.9948 6.04631 15.8997 6.0435 15.8037C6.0435 15.6387 5.99781 15.5111 5.90538 15.4242C5.79946 15.3316 5.6634 15.2855 5.525 15.2933ZM9.15875 0.1133C9.58269 0.1848 9.99706 0.4818 10.472 0.9746L16.0406 6.7309C16.5261 7.2336 16.8194 7.6439 16.8799 8.0652H9.71125C9.33831 8.0652 9.15556 7.8804 9.15556 7.5108L9.15875 0.1133Z" fill="#FF3B30"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_209_356">
|
||||
<rect width="17" height="22" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
`;
|
||||
} else if (doc.type === "doc" || doc.type === "docx") {
|
||||
svgContent = `
|
||||
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" aria-label="Office Open XML word processing document" data-testid="word-icon"><path d="M16.795 0c1.115 0 1.519.116 1.926.334.407.218.727.538.945.945.218.407.334.811.334 1.926v13.59c0 1.115-.116 1.519-.334 1.926a2.272 2.272 0 01-.945.945c-.407.218-.811.334-1.926.334H3.205c-1.115 0-1.519-.116-1.926-.334a2.272 2.272 0 01-.945-.945C.116 18.314 0 17.91 0 16.795V3.205C0 2.09.116 1.686.334 1.279.552.872.872.552 1.279.334 1.686.116 2.09 0 3.205 0h13.59zM5.177 4.931H3.264L6.098 15.5h1.734L10 7.867h.105l2.179 7.633h1.727l2.834-10.569h-1.904l-1.83 7.99h-.105l-2.132-7.99H9.231l-2.11 7.99h-.106l-1.838-7.99z" fill="#205BC5" fill-rule="evenodd"></path></svg>
|
||||
`;
|
||||
} else {
|
||||
svgContent = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="22" viewBox="0 0 17 22" fill="none">
|
||||
<g clip-path="url(#clip0_209_356)">
|
||||
<path d="M3.13331 22H13.8656C15.9588 22 16.9989 20.922 16.9989 18.788V9.471H9.68256C8.38844 9.471 7.77219 8.8451 7.77219 7.5317V0H3.13438C1.05081 0 0 1.0879 0 3.223V18.788C0 20.933 1.04125 22 3.13331 22ZM8.53081 14.7103C8.8655 14.7103 9.13963 14.773 9.35319 14.8984C9.56781 15.0238 9.72506 15.2042 9.82812 15.4374C9.93119 15.6706 9.98325 15.95 9.98325 16.2734C9.98325 16.6012 9.93013 16.8839 9.826 17.1215C9.72762 17.3531 9.56003 17.5459 9.34788 17.6715C9.13431 17.7991 8.86125 17.8629 8.53081 17.8629H7.27069V14.7103H8.53081ZM12.6267 14.7103V15.3197H11.2604V16.082H12.5035V16.6727H11.2604V17.8629H10.4869V14.7103H12.6267ZM5.70244 14.7103C5.95 14.7103 6.15719 14.7598 6.32294 14.8599C6.48975 14.9589 6.61513 15.0909 6.70013 15.2559C6.78513 15.422 6.82763 15.6046 6.82763 15.8037C6.82763 16.0039 6.78406 16.1865 6.698 16.3493C6.61061 16.515 6.47842 16.6507 6.31763 16.7398C6.12503 16.8423 5.91037 16.8923 5.69394 16.885H5.11912V17.8629H4.34563V14.7103H5.70244ZM8.40756 15.312H8.04419V17.2601H8.40756C8.54569 17.2601 8.66256 17.2403 8.76138 17.2007C8.85628 17.1636 8.9399 17.1009 9.00362 17.0192C9.07059 16.9298 9.11841 16.8267 9.14387 16.7167C9.17362 16.5957 9.1885 16.4538 9.1885 16.2921C9.1885 16.0765 9.16194 15.8961 9.10775 15.7498C9.06155 15.6139 8.97247 15.498 8.85487 15.4209C8.71883 15.3422 8.56434 15.3041 8.40863 15.3109L8.40756 15.312ZM5.525 15.2933H5.117V16.3141H5.525C5.6204 16.3168 5.71506 16.296 5.80125 16.2536C5.8771 16.216 5.9401 16.1554 5.98188 16.0798C6.02508 15.9948 6.04631 15.8997 6.0435 15.8037C6.0435 15.6387 5.99781 15.5111 5.90538 15.4242C5.79946 15.3316 5.6634 15.2855 5.525 15.2933ZM9.15875 0.1133C9.58269 0.1848 9.99706 0.4818 10.472 0.9746L16.0406 6.7309C16.5261 7.2336 16.8194 7.6439 16.8799 8.0652H9.71125C9.33831 8.0652 9.15556 7.8804 9.15556 7.5108L9.15875 0.1133Z" fill="#FF3B30"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_209_356">
|
||||
<rect width="17" height="22" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
`;
|
||||
}
|
||||
|
||||
rowIcon.innerHTML = svgContent;
|
||||
|
||||
rowContainer.appendChild(rowIcon);
|
||||
|
||||
const rowContent = document.createElement("div");
|
||||
rowContent.setAttribute("class", "row-content");
|
||||
|
||||
const documentName = document.createElement("h1");
|
||||
documentName.textContent = doc.name;
|
||||
rowContent.appendChild(documentName);
|
||||
|
||||
const documentType = document.createElement("h2");
|
||||
documentType.textContent = doc.type;
|
||||
rowContent.appendChild(documentType);
|
||||
|
||||
const date = document.createElement("span");
|
||||
date.textContent = doc.date;
|
||||
rowContent.appendChild(date);
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
data.appendChild(rowContainer);
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
createTable();
|
||||
});
|
||||
7
static/scripts/jquery.daterangepicker.min.js
vendored
Normal file
7
static/scripts/jquery.daterangepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10965
static/scripts/jquery.min.js
vendored
Normal file
10965
static/scripts/jquery.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
static/scripts/moment.min.js
vendored
Normal file
2
static/scripts/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
46
static/scripts/payments-table.js
Normal file
46
static/scripts/payments-table.js
Normal file
@@ -0,0 +1,46 @@
|
||||
$(document).ready(function () {
|
||||
const createTable = () => {
|
||||
const table = document.getElementById("paymentsTable");
|
||||
const tbody = table.querySelector("tbody");
|
||||
// Очищаем таблицу
|
||||
tbody.innerHTML = "";
|
||||
|
||||
payments.forEach((payment) => {
|
||||
const row = document.createElement("tr");
|
||||
if (payment.path) {
|
||||
row.setAttribute(
|
||||
"onclick",
|
||||
`window.open('` + API_SERVER + `/` + payment.path + `', '_blank')`
|
||||
);
|
||||
}
|
||||
|
||||
const data = document.createElement("td");
|
||||
|
||||
const rowContainer = document.createElement("div");
|
||||
rowContainer.setAttribute("class", "row-container");
|
||||
|
||||
const rowContent = document.createElement("div");
|
||||
rowContent.setAttribute("class", "row-content");
|
||||
|
||||
const paymentAmount = document.createElement("h1");
|
||||
paymentAmount.textContent =
|
||||
payment.amount.toLocaleString("ru-RU") + " рублей";
|
||||
rowContent.appendChild(paymentAmount);
|
||||
|
||||
const paymentDate = document.createElement("h2");
|
||||
paymentDate.textContent = payment.date;
|
||||
rowContent.appendChild(paymentDate);
|
||||
|
||||
const paymentDescription = document.createElement("span");
|
||||
paymentDescription.textContent = payment.name;
|
||||
rowContent.appendChild(paymentDescription);
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
data.appendChild(rowContainer);
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
createTable();
|
||||
});
|
||||
67
static/scripts/projects.js
Normal file
67
static/scripts/projects.js
Normal file
@@ -0,0 +1,67 @@
|
||||
function toggleAccount() {
|
||||
if ($("#dropdownAccount").hasClass("is-visible")) {
|
||||
event.preventDefault();
|
||||
$("#dropdownAccount").removeClass("is-visible");
|
||||
$("#dropdownAccount").css("display", "none");
|
||||
} else {
|
||||
event.preventDefault();
|
||||
$("#dropdownAccount").css("display", "inline-flex");
|
||||
setTimeout(function () {
|
||||
$("#dropdownAccount").addClass("is-visible");
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on("click", function (event) {
|
||||
if ($(event.target).closest("#userIcon").length) {
|
||||
return;
|
||||
} else {
|
||||
if (!$(event.target).closest(".dropdown-account").length) {
|
||||
$("#dropdownAccount").removeClass("is-visible");
|
||||
setTimeout(function () {
|
||||
$("#dropdownAccount").css("display", "none");
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).keydown(function (e) {
|
||||
if (e.key === "Escape" || e.key === "Esc") {
|
||||
$("#dropdownAccount").removeClass("is-visible");
|
||||
setTimeout(function () {
|
||||
$("#dropdownAccount").css("display", "none");
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function setTheme(theme) {
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
|
||||
const themeButtons = document.querySelectorAll(".theme-btn");
|
||||
themeButtons.forEach((button) => button.classList.remove("active"));
|
||||
|
||||
const selectedButton = document.getElementById(`${theme}-theme-btn`);
|
||||
selectedButton.classList.add("active");
|
||||
|
||||
localStorage.setItem("theme", theme);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const savedTheme = localStorage.getItem("theme");
|
||||
if (savedTheme) {
|
||||
setTheme(savedTheme);
|
||||
}
|
||||
});
|
||||
|
||||
function getCookie(name) {
|
||||
var cookies = document.cookie.split(";");
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = cookies[i].trim();
|
||||
if (cookie.startsWith(name + "=")) {
|
||||
return cookie.substring(name.length + 1);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
119
static/scripts/update-calendar.js
Normal file
119
static/scripts/update-calendar.js
Normal file
@@ -0,0 +1,119 @@
|
||||
$(document).ready(function () {
|
||||
$("#date-range").dateRangePicker({
|
||||
autoClose: true,
|
||||
format: "DD/MM/YYYY",
|
||||
separator: " - ",
|
||||
language: "ru",
|
||||
startOfWeek: "monday",
|
||||
getValue: function () {
|
||||
return this.innerHTML;
|
||||
},
|
||||
setValue: function (s) {
|
||||
this.innerHTML =
|
||||
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="16" viewBox="0 0 18 16" fill="none">
|
||||
<g clip-path="url(#clip0_89_144)">
|
||||
<path d="M2.72599 16H14.5849C16.3994 16 17.3022 15.0971 17.3022 13.3087V2.7086C17.3022 0.92021 16.3994 0.017334 14.5849 0.017334H2.72599C0.911559 0.017334 0 0.91153 0 2.7086V13.3087C0 15.1058 0.911559 16 2.72599 16ZM2.59577 14.6023C1.82311 14.6023 1.39772 14.1942 1.39772 13.3869V5.20018C1.39772 4.40148 1.82311 3.9848 2.59577 3.9848H14.6978C15.4704 3.9848 15.9045 4.40148 15.9045 5.20018V13.3869C15.9045 14.1942 15.4704 14.6023 14.6978 14.6023H2.59577ZM6.96257 7.10144H7.47477C7.77862 7.10144 7.87414 7.01464 7.87414 6.71078V6.19855C7.87414 5.89469 7.77862 5.79922 7.47477 5.79922H6.96257C6.65872 5.79922 6.55453 5.89469 6.55453 6.19855V6.71078C6.55453 7.01464 6.65872 7.10144 6.96257 7.10144ZM9.84481 7.10144H10.357C10.6609 7.10144 10.765 7.01464 10.765 6.71078V6.19855C10.765 5.89469 10.6609 5.79922 10.357 5.79922H9.84481C9.54099 5.79922 9.4368 5.89469 9.4368 6.19855V6.71078C9.4368 7.01464 9.54099 7.10144 9.84481 7.10144ZM12.7271 7.10144H13.2393C13.5431 7.10144 13.6473 7.01464 13.6473 6.71078V6.19855C13.6473 5.89469 13.5431 5.79922 13.2393 5.79922H12.7271C12.4232 5.79922 12.3277 5.89469 12.3277 6.19855V6.71078C12.3277 7.01464 12.4232 7.10144 12.7271 7.10144ZM4.0803 9.94029H4.58382C4.89636 9.94029 4.99187 9.85349 4.99187 9.54963V9.0374C4.99187 8.73354 4.89636 8.64674 4.58382 8.64674H4.0803C3.76777 8.64674 3.67226 8.73354 3.67226 9.0374V9.54963C3.67226 9.85349 3.76777 9.94029 4.0803 9.94029ZM6.96257 9.94029H7.47477C7.77862 9.94029 7.87414 9.85349 7.87414 9.54963V9.0374C7.87414 8.73354 7.77862 8.64674 7.47477 8.64674H6.96257C6.65872 8.64674 6.55453 8.73354 6.55453 9.0374V9.54963C6.55453 9.85349 6.65872 9.94029 6.96257 9.94029ZM9.84481 9.94029H10.357C10.6609 9.94029 10.765 9.85349 10.765 9.54963V9.0374C10.765 8.73354 10.6609 8.64674 10.357 8.64674H9.84481C9.54099 8.64674 9.4368 8.73354 9.4368 9.0374V9.54963C9.4368 9.85349 9.54099 9.94029 9.84481 9.94029ZM12.7271 9.94029H13.2393C13.5431 9.94029 13.6473 9.85349 13.6473 9.54963V9.0374C13.6473 8.73354 13.5431 8.64674 13.2393 8.64674H12.7271C12.4232 8.64674 12.3277 8.73354 12.3277 9.0374V9.54963C12.3277 9.85349 12.4232 9.94029 12.7271 9.94029ZM4.0803 12.7878H4.58382C4.89636 12.7878 4.99187 12.6923 4.99187 12.3885V11.8763C4.99187 11.5724 4.89636 11.4856 4.58382 11.4856H4.0803C3.76777 11.4856 3.67226 11.5724 3.67226 11.8763V12.3885C3.67226 12.6923 3.76777 12.7878 4.0803 12.7878ZM6.96257 12.7878H7.47477C7.77862 12.7878 7.87414 12.6923 7.87414 12.3885V11.8763C7.87414 11.5724 7.77862 11.4856 7.47477 11.4856H6.96257C6.65872 11.4856 6.55453 11.5724 6.55453 11.8763V12.3885C6.55453 12.6923 6.65872 12.7878 6.96257 12.7878ZM9.84481 12.7878H10.357C10.6609 12.7878 10.765 12.6923 10.765 12.3885V11.8763C10.765 11.5724 10.6609 11.4856 10.357 11.4856H9.84481C9.54099 11.4856 9.4368 11.5724 9.4368 11.8763V12.3885C9.4368 12.6923 9.54099 12.7878 9.84481 12.7878Z" fill="black"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_89_144">
|
||||
<rect width="17.3022" height="16" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>` + s;
|
||||
},
|
||||
startDate: false,
|
||||
endDate: false,
|
||||
time: {
|
||||
enabled: false,
|
||||
},
|
||||
minDays: 0,
|
||||
maxDays: 0,
|
||||
showShortcuts: false,
|
||||
shortcuts: {
|
||||
//'prev-days': [1,3,5,7],
|
||||
//'next-days': [3,5,7],
|
||||
//'prev' : ['week','month','year'],
|
||||
//'next' : ['week','month','year']
|
||||
},
|
||||
customShortcuts: [],
|
||||
inline: false,
|
||||
container: "body",
|
||||
alwaysOpen: false,
|
||||
singleDate: false,
|
||||
lookBehind: false,
|
||||
batchMode: false,
|
||||
duration: 200,
|
||||
stickyMonths: false,
|
||||
dayDivAttrs: [],
|
||||
dayTdAttrs: [],
|
||||
applyBtnClass: "",
|
||||
singleMonth: "true",
|
||||
hoveringTooltip: function (days, startTime, hoveringTime) {
|
||||
return days > 1 ? days + " " + lang("days") : "";
|
||||
},
|
||||
showTopbar: false,
|
||||
swapTime: false,
|
||||
selectForward: false,
|
||||
selectBackward: false,
|
||||
showWeekNumbers: false,
|
||||
getWeekNumber: function (date) {
|
||||
return moment(date).format("w");
|
||||
},
|
||||
monthSelect: false,
|
||||
yearSelect: false,
|
||||
});
|
||||
|
||||
const createTable = () => {
|
||||
const table = document.getElementById("modules-table");
|
||||
const tbody = table.querySelector("tbody");
|
||||
// Очищаем таблицу
|
||||
tbody.innerHTML = "";
|
||||
|
||||
modules.forEach((modul) => {
|
||||
const row = document.createElement("tr");
|
||||
|
||||
const data = document.createElement("td");
|
||||
|
||||
const rowContainer = document.createElement("div");
|
||||
rowContainer.setAttribute("class", "row-container");
|
||||
|
||||
const rowContent = document.createElement("div");
|
||||
rowContent.setAttribute("class", "row-content");
|
||||
|
||||
const moduleName = document.createElement("h1");
|
||||
moduleName.textContent = modul.name;
|
||||
rowContent.appendChild(moduleName);
|
||||
|
||||
const moduleStatus = document.createElement("h2");
|
||||
moduleStatus.textContent = modul.status + "%";
|
||||
rowContent.appendChild(moduleStatus);
|
||||
|
||||
const status = document.createElement("div");
|
||||
status.setAttribute("class", "status");
|
||||
status.style.backgroundColor = "rgba(0, 0, 0, 0.05)";
|
||||
|
||||
const fill = document.createElement("div");
|
||||
if (modul.status === 100) {
|
||||
fill.style.width = `${modul.status}%`;
|
||||
fill.style.height = "100%";
|
||||
fill.style.backgroundColor = "#32D74B";
|
||||
fill.style.borderRadius = "5px";
|
||||
} else {
|
||||
fill.style.width = `${modul.status}%`;
|
||||
fill.style.height = "100%";
|
||||
fill.style.backgroundColor = "#FFB74B";
|
||||
fill.style.borderRadius = "5px 0px 0px 5px";
|
||||
}
|
||||
|
||||
status.appendChild(fill);
|
||||
rowContent.appendChild(status);
|
||||
|
||||
rowContainer.appendChild(rowContent);
|
||||
data.appendChild(rowContainer);
|
||||
row.appendChild(data);
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
};
|
||||
|
||||
createTable();
|
||||
});
|
||||
Reference in New Issue
Block a user