Ещё правки

This commit is contained in:
DyCTaTOR 2023-12-08 12:23:57 +04:00
parent bdec591988
commit a4ff178c5e
7 changed files with 29 additions and 19 deletions

View File

@ -13,7 +13,7 @@
<nav class = "headStyleNavBar navbar-text navbar-dark w-100">
<div class = "text-center">
<img src = "./images/logo2.png" alt = "logo2" width="70">
<img src = "./images/logo2.png" alt = "logo2">
<span class = "headStyle">
<b>Ульяновский Государственный Политехнический Университет</b>
</span>

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,6 @@
<div class = "container col text-center">
<span class = "mainSt">Новости</span>
<div class="text-center d-flex justify-content-end">
</div>
</div>
</header>
@ -48,6 +47,8 @@
<div class="btn-group text-center" role="group">
<button id="items-add" class="btn btn-info">
Добавить новость</button>
<button class="btn btn-primary w-auto" type="button" onclick ="location.href='admin.html';">
Панель админа</button>
</div>
</div>
</main>

View File

@ -55,8 +55,6 @@ function createTableAnchor(icon, callback) {
}
export function createAnchor(icon, callback) {
const i = document.createElement("i");
console.info("icon", icon);
console.info("callback", callback);
i.classList.add("fa-solid", icon);
const a = document.createElement("a");

View File

@ -64,7 +64,10 @@ async function addLine(itemName, description, image) {
console.info(data);
// загрузка и заполнение table
drawLinesTable();
console.info(window.location.pathname);
if (window.location.pathname === "/index.html") {
UpdateNews();
}
}
async function editLine(id, itemName, description, image) {
@ -75,7 +78,10 @@ async function editLine(id, itemName, description, image) {
console.info(data);
// загрузка и заполнение table
drawLinesTable();
console.info(window.location.pathname);
if (window.location.pathname.toLowerCase() === "/index.html") {
UpdateNews();
}
}
async function removeLine(id) {
@ -89,7 +95,10 @@ async function removeLine(id) {
console.info(data);
// загрузка и заполнение table
drawLinesTable();
console.info(window.location.pathname);
if (window.location.pathname === "/index.html") {
UpdateNews();
}
}
// функция для получения содержимого файла в виде base64 строки
@ -262,7 +271,7 @@ function clearNews() {
}
async function UpdateNew(div1, item) {
const div2 = document.createElement("div");
div2.setAttribute("class", "col mt-4");
div2.setAttribute("class", "col mb-4");
const div3 = document.createElement("div");
div3.setAttribute("class", "rectNews d-flex flex-column");
const image = document.createElement("img");
@ -285,16 +294,15 @@ async function UpdateNew(div1, item) {
}
export async function UpdateNews() {
clearNews();
console.info("linesForm");
console.info("UpdateNews");
const data = await getAllLines();
const div1 = document.createElement("div");
div1.setAttribute("class", "mainDiv row");
data.forEach((item, index) => {
console.info(index);
data.forEach((item) => {
cntrls.form.addEventListener("submit", async (event) => {
console.info("Form on Submit231");
// console.info("Form on Submit231");
event.preventDefault();
event.stopPropagation();
});

View File

@ -10,3 +10,6 @@
width: 52px;
height: 36px;
}
.headStyleNavBar{
background-color: #454545;
}