Lab3new
This commit is contained in:
parent
20003cf6a2
commit
5650c55a67
@ -49,7 +49,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
File diff suppressed because one or more lines are too long
BIN
3 proba/dist/assets/3j-2565bbd7.png
vendored
Normal file
BIN
3 proba/dist/assets/3j-2565bbd7.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
BIN
3 proba/dist/assets/4j-333e118f.png
vendored
Normal file
BIN
3 proba/dist/assets/4j-333e118f.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 87 KiB |
BIN
3 proba/dist/assets/kafka-27996d7c.jpg
vendored
Normal file
BIN
3 proba/dist/assets/kafka-27996d7c.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
BIN
3 proba/dist/assets/leot-9d1bdf96.jpg
vendored
Normal file
BIN
3 proba/dist/assets/leot-9d1bdf96.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 KiB |
1
3 proba/dist/assets/main-bdf679db.js.map
vendored
Normal file
1
3 proba/dist/assets/main-bdf679db.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"main-bdf679db.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
1
3 proba/dist/assets/page2-bdf679db.js.map
vendored
Normal file
1
3 proba/dist/assets/page2-bdf679db.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"page2-bdf679db.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
1
3 proba/dist/assets/page3-bdf679db.js.map
vendored
Normal file
1
3 proba/dist/assets/page3-bdf679db.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"page3-bdf679db.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
6
3 proba/dist/assets/page4-6eebaf84.js
vendored
Normal file
6
3 proba/dist/assets/page4-6eebaf84.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
3 proba/dist/assets/page4-6eebaf84.js.map
vendored
Normal file
1
3 proba/dist/assets/page4-6eebaf84.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
3 proba/dist/assets/pandp-234f6c85.jpg
vendored
Normal file
BIN
3 proba/dist/assets/pandp-234f6c85.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
BIN
3 proba/dist/assets/stranger-6b72d0d2.jpg
vendored
Normal file
BIN
3 proba/dist/assets/stranger-6b72d0d2.jpg
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 113 KiB |
9
3 proba/dist/assets/style-9f101eee.css
vendored
Normal file
9
3 proba/dist/assets/style-9f101eee.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
3 proba/dist/assets/style-d523d2ea.js.map
vendored
Normal file
1
3 proba/dist/assets/style-d523d2ea.js.map
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"style-d523d2ea.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
3
3 proba/dist/index.html
vendored
3
3 proba/dist/index.html
vendored
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/assets/style-b3fdb84c.css">
|
<link rel="stylesheet" href="/assets/style-9f101eee.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="index">
|
<body class="index">
|
||||||
<header>
|
<header>
|
||||||
@ -27,7 +27,6 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./page4.html">Таблица</a>
|
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
|
69
3 proba/dist/page2.html
vendored
Normal file
69
3 proba/dist/page2.html
vendored
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Elitist</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<script src="./node_modules/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/style-9f101eee.css">
|
||||||
|
</head>
|
||||||
|
<body class="page2">
|
||||||
|
<header>
|
||||||
|
<nav class="navbar navbar-expand-md navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="./index.html">
|
||||||
|
<i class="fa-solid fa-microchip"></i>
|
||||||
|
Elitist
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||||||
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
|
||||||
|
<div class="navbar-nav">
|
||||||
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
|
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
||||||
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<article class="container-fluid py-5" style="padding-left: 0;">
|
||||||
|
<div class="row justify-content-center align-items-center">
|
||||||
|
<div class="col-md-6 text-center">
|
||||||
|
<h2 style="margin-top: 20px;">ЖАНРЫ</h2>
|
||||||
|
<ul style="list-style-type: none; padding: 0;">
|
||||||
|
<li><a href="./magicheskiy-realizm.html"><h1 style="margin-top: 20px;">I Магический реализм</h1></a></li>
|
||||||
|
<li><a href="./filosofskaya-proza.html"><h1 style="margin-top: 20px;">II Философская проза</h1></a></li>
|
||||||
|
<li><a href="./metafizicheskaya-poeziya.html"><h1 style="margin-top: 20px;">III Метафизическая поэзия</h1></a></li>
|
||||||
|
<li><a href="./psihologicheskiy-roman.html"><h1 style="margin-top: 20px;">IV Психологический роман</h1></a></li>
|
||||||
|
<li><a href="./filosofskiy-roman.html"><h1 style="margin-top: 20px;">V Философский роман</h1></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 text-center">
|
||||||
|
<ul style="list-style-type: none; padding: 0;">
|
||||||
|
<li><a href="./epicheskaya-poesy.html"><h1 style="margin-top: 20px;">VI Эпическая поэзия</h1></a></li>
|
||||||
|
<li><a href="./socz-real.html"><h1 style="margin-top: 20px;">VII Социальный реализм</h1></a></li>
|
||||||
|
<li><a href="./fant-roman.html"><h1 style="margin-top: 20px;">VIII Фантастический роман</h1></a></li>
|
||||||
|
<li><a href="./avt-dram.html"><h1 style="margin-top: 20px;">IX Авторская драматургия</h1></a></li>
|
||||||
|
<li><a href="./Eksp-proza.html"><h1 style="margin-top: 20px;">X Авторская драматургия</h1></a></li>
|
||||||
|
</ul>
|
||||||
|
<img src="/assets/3j-2565bbd7.png" alt="3j" class="img-fluid" style="width: 150px;">
|
||||||
|
<img src="/assets/4j-333e118f.png" alt="4j" class="img-fluid" style="width: 150px;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center fixed-bottom">
|
||||||
|
Жирнова Алена ПИбд-21
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
63
3 proba/dist/page3.html
vendored
Normal file
63
3 proba/dist/page3.html
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Elitist</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<script src="./node_modules/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="/assets/style-9f101eee.css">
|
||||||
|
</head>
|
||||||
|
<body class="page3">
|
||||||
|
<header>
|
||||||
|
<nav class="navbar navbar-expand-md navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="./index.html">
|
||||||
|
<i class="fa-solid fa-microchip"></i>
|
||||||
|
Elitist
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||||||
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
|
||||||
|
<div class="navbar-nav">
|
||||||
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
|
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
||||||
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<article class="container py-5">
|
||||||
|
<h2 class="col-md-3 mb-4 text-center mx-auto">Бестселлеры</h2>
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-3 mb-4 text-center">
|
||||||
|
<img src="/assets/kafka-27996d7c.jpg" alt="" class="img-fluid" style="max-width: 260px; max-height: 372px;">
|
||||||
|
<h3 class="h7 mt-3">Ф.Кафка “Превращение”</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-4 text-center">
|
||||||
|
<img src="/assets/pandp-234f6c85.jpg" alt="" class="img-fluid" style="max-width: 260px; max-height: 372px;">
|
||||||
|
<h3 class="h7 mt-3">Д.Остен “Гордость и предубеждение”</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-4 text-center">
|
||||||
|
<img src="/assets/leot-9d1bdf96.jpg" alt="" class="img-fluid" style="max-width: 260px; max-height: 372px;">
|
||||||
|
<h3 class="h7 mt-3">Л.Толстой “Смерть Ивана Ильича”</h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 mb-4 text-center">
|
||||||
|
<img src="/assets/stranger-6b72d0d2.jpg" alt="" class="img-fluid" style="max-width: 260px; max-height: 372px;">
|
||||||
|
<h3 class="h7 mt-3">А.Камю “Посторонний”</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center fixed-bottom">
|
||||||
|
Жирнова Алена ПИбд-21
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
185
3 proba/dist/page4.html
vendored
Normal file
185
3 proba/dist/page4.html
vendored
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Elitist</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<script src="./node_modules/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script type="module" crossorigin src="/assets/page4-6eebaf84.js"></script>
|
||||||
|
<link rel="stylesheet" href="/assets/style-9f101eee.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="page4x">
|
||||||
|
<header>
|
||||||
|
<nav class="navbar navbar-expand-md navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="./index.html">
|
||||||
|
<i class="fa-solid fa-microchip"></i>
|
||||||
|
Elitist
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||||||
|
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="navbar-collapse collapse justify-content-end" id="navbarNav">
|
||||||
|
<div class="navbar-nav">
|
||||||
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
|
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
||||||
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<main class="container-fluid p-2">
|
||||||
|
<button id="items-add" type="submit" class="btn btn-success">
|
||||||
|
Добавить книгу (диалог)
|
||||||
|
</button>
|
||||||
|
<a class="btn btn-secondary" href="/page-edit.html"
|
||||||
|
>Добавить книгу (страница)</a
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<table id="items-table" class="table table-light table-striped">
|
||||||
|
<thead>
|
||||||
|
<th scope="col">№</th>
|
||||||
|
<th scope="col" class="w-25">Жанр</th>
|
||||||
|
<th scope="col" class="w-25">Автор</th>
|
||||||
|
<th scope="col" class="w-25">Название</th>
|
||||||
|
<th scope="col" class="w-25">Описание</th>
|
||||||
|
<th scope="col" class="w-25">Количество</th>
|
||||||
|
<th scope="col" class="w-25">Дата</th>
|
||||||
|
<th scope="col"></th>
|
||||||
|
<th scope="col"></th>
|
||||||
|
<th scope="col"></th>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer class="footer mt-auto d-flex flex-shrink-0 justify-content-center align-items-center fixed-bottom">
|
||||||
|
Жирнова Алена ПИбд-21
|
||||||
|
</footer>
|
||||||
|
<div
|
||||||
|
id="items-update"
|
||||||
|
class="modal fade"
|
||||||
|
tabindex="-1"
|
||||||
|
data-bs-backdrop="static"
|
||||||
|
data-bs-keyboard="false"
|
||||||
|
>
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<form id="items-form" class="needs-validation" novalidate>
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fs-5" id="items-update-title"></h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn-close"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="text-center">
|
||||||
|
<img
|
||||||
|
id="image-preview"
|
||||||
|
src="https://via.placeholder.com/200"
|
||||||
|
class="rounded rounded-circle"
|
||||||
|
alt="placeholder"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<input id="items-line-id" type="number" hidden />
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="item" class="form-label">Жанр</label>
|
||||||
|
<select
|
||||||
|
id="item"
|
||||||
|
class="form-select"
|
||||||
|
name="selected"
|
||||||
|
required
|
||||||
|
></select>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="author" class="form-label">Автор</label>
|
||||||
|
<select
|
||||||
|
id="author"
|
||||||
|
class="form-select"
|
||||||
|
name="selected"
|
||||||
|
required
|
||||||
|
></select>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="name" class="form-label">Название</label>
|
||||||
|
<input
|
||||||
|
id="name"
|
||||||
|
name="name"
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
maxlength="100"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="desc" class="form-label">Описание</label>
|
||||||
|
<input
|
||||||
|
id="desc"
|
||||||
|
name="desc"
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
maxlength="100"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="count" class="form-label">Количество книг</label>
|
||||||
|
<input
|
||||||
|
id="count"
|
||||||
|
name="count"
|
||||||
|
class="form-control"
|
||||||
|
type="number"
|
||||||
|
value="0"
|
||||||
|
min="1"
|
||||||
|
step="1"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="date" class="form-label">Дата</label>
|
||||||
|
<input
|
||||||
|
id="date"
|
||||||
|
name="date"
|
||||||
|
class="form-control"
|
||||||
|
type="date"
|
||||||
|
value="2022-01-01"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="image" class="form-label">Изображение</label>
|
||||||
|
<input
|
||||||
|
id="image"
|
||||||
|
type="file"
|
||||||
|
name="image"
|
||||||
|
class="form-control"
|
||||||
|
accept="image/*"
|
||||||
|
/>
|
||||||
|
</div></div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button
|
||||||
|
type="submit-grey"
|
||||||
|
class="btn btn-secondary"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
>
|
||||||
|
Закрыть
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-success">Сохранить</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -26,7 +26,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,7 +36,7 @@ export async function getAllItemAuthors() {
|
|||||||
|
|
||||||
// обращение к серверу для получения всех записей (get)
|
// обращение к серверу для получения всех записей (get)
|
||||||
export async function getAllLines() {
|
export async function getAllLines() {
|
||||||
const response = await fetch(`${serverUrl}/lines?_expand=authors`);
|
const response = await fetch(`${serverUrl}/lines?_expand=items&_expand=authors`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw response.statusText;
|
throw response.statusText;
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ export async function getAllLines() {
|
|||||||
// обращение к серверу для получения записи по первичному ключу (id) (get)
|
// обращение к серверу для получения записи по первичному ключу (id) (get)
|
||||||
// id передается в качестве части пути URL get-запроса
|
// id передается в качестве части пути URL get-запроса
|
||||||
export async function getLine(id) {
|
export async function getLine(id) {
|
||||||
const response = await fetch(`${serverUrl}/lines/${id}?_expand=authors`);
|
const response = await fetch(`${serverUrl}/lines/${id}?_expand=items&_expand=authors`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw response.statusText;
|
throw response.statusText;
|
||||||
}
|
}
|
||||||
|
@ -16,27 +16,27 @@ export const cntrls = {
|
|||||||
date: document.getElementById("date"),
|
date: document.getElementById("date"),
|
||||||
image: document.getElementById("image"),
|
image: document.getElementById("image"),
|
||||||
imagePreview: document.getElementById("image-preview"),
|
imagePreview: document.getElementById("image-preview"),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Дефолтное превью
|
// Дефолтное превью
|
||||||
export const imagePlaceholder = "https://via.placeholder.com/200";
|
export const imagePlaceholder = "https://via.placeholder.com/200";
|
||||||
|
|
||||||
// функция создает тег option для select
|
// функция создает тег option для select
|
||||||
// <option value="" selected>name</option>
|
// <option value="" selected>name</option>
|
||||||
export function createItemsOption(name, value = "", isSelected = false) {
|
export function createItemsOption(name, value = "", isSelected = false) {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.value = value || "";
|
option.value = value || "";
|
||||||
option.selected = isSelected;
|
option.selected = isSelected;
|
||||||
option.text = name;
|
option.text = name;
|
||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
// функция создает ссылку (a) для таблицы
|
// функция создает ссылку (a) для таблицы
|
||||||
// содержимое тега a заполняется необходимой иконкой (icon)
|
// содержимое тега a заполняется необходимой иконкой (icon)
|
||||||
// при нажатии вызывается callback
|
// при нажатии вызывается callback
|
||||||
// ссылка "оборачивается" тегом td
|
// ссылка "оборачивается" тегом td
|
||||||
// <td><a href="#" onclick="callback()"><i class="fa-solid icon"></i></a></td>
|
// <td><a href="#" onclick="callback()"><i class="fa-solid icon"></i></a></td>
|
||||||
function createTableAnchor(icon, callback) {
|
function createTableAnchor(icon, callback) {
|
||||||
const i = document.createElement("i");
|
const i = document.createElement("i");
|
||||||
i.classList.add("fa-solid", icon);
|
i.classList.add("fa-solid", icon);
|
||||||
|
|
||||||
@ -53,34 +53,34 @@ export const cntrls = {
|
|||||||
const td = document.createElement("td");
|
const td = document.createElement("td");
|
||||||
td.appendChild(a);
|
td.appendChild(a);
|
||||||
return td;
|
return td;
|
||||||
}
|
}
|
||||||
|
|
||||||
// функция создает колонку таблицы с текстом value
|
// функция создает колонку таблицы с текстом value
|
||||||
// <td>value</td>
|
// <td>value</td>
|
||||||
function createTableColumn(value) {
|
function createTableColumn(value) {
|
||||||
const td = document.createElement("td");
|
const td = document.createElement("td");
|
||||||
td.textContent = value;
|
td.textContent = value;
|
||||||
return td;
|
return td;
|
||||||
}
|
}
|
||||||
|
|
||||||
// функция создает строку таблицы
|
// функция создает строку таблицы
|
||||||
// <tr>
|
// <tr>
|
||||||
// <th scope="row">index + 1</th>
|
// <th scope="row">index + 1</th>
|
||||||
// <td>item.items.name</td>
|
// <td>item.items.name</td>
|
||||||
// <td>parseFloat(item.price).toFixed(2))</td>
|
// <td>parseFloat(item.price).toFixed(2))</td>
|
||||||
// <td>item.count</td>
|
// <td>item.count</td>
|
||||||
// <td>parseFloat(item.sum).toFixed(2))</td>
|
// <td>parseFloat(item.sum).toFixed(2))</td>
|
||||||
// <td><a href="#" onclick="editCallback()"><i class="fa-solid fa-pencil"></i></a></td>
|
// <td><a href="#" onclick="editCallback()"><i class="fa-solid fa-pencil"></i></a></td>
|
||||||
// <td><a href="#" onclick="editPageCallback()"><i class="fa-solid fa-pen-to-square"></i></a></td>
|
// <td><a href="#" onclick="editPageCallback()"><i class="fa-solid fa-pen-to-square"></i></a></td>
|
||||||
// <td><a href="#" onclick="deleteCallback()"><i class="fa-solid fa-trash"></i></a></td>
|
// <td><a href="#" onclick="deleteCallback()"><i class="fa-solid fa-trash"></i></a></td>
|
||||||
// </tr>
|
// </tr>
|
||||||
export function createTableRow(
|
export function createTableRow(
|
||||||
item,
|
item,
|
||||||
index,
|
index,
|
||||||
editCallback,
|
editCallback,
|
||||||
editPageCallback,
|
editPageCallback,
|
||||||
deleteCallback,
|
deleteCallback,
|
||||||
) {
|
) {
|
||||||
const rowNumber = document.createElement("th");
|
const rowNumber = document.createElement("th");
|
||||||
rowNumber.scope = "row";
|
rowNumber.scope = "row";
|
||||||
rowNumber.textContent = index + 1;
|
rowNumber.textContent = index + 1;
|
||||||
@ -102,4 +102,4 @@ export const cntrls = {
|
|||||||
// удаление
|
// удаление
|
||||||
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
|
row.appendChild(createTableAnchor("fa-trash", deleteCallback));
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
6
3 proba/node_modules/.vite/deps/_metadata.json
generated
vendored
6
3 proba/node_modules/.vite/deps/_metadata.json
generated
vendored
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"hash": "0e02c341",
|
"hash": "2b23bead",
|
||||||
"browserHash": "7853d2a2",
|
"browserHash": "d63b02ce",
|
||||||
"optimized": {
|
"optimized": {
|
||||||
"bootstrap": {
|
"bootstrap": {
|
||||||
"src": "../../bootstrap/dist/js/bootstrap.esm.js",
|
"src": "../../bootstrap/dist/js/bootstrap.esm.js",
|
||||||
"file": "bootstrap.js",
|
"file": "bootstrap.js",
|
||||||
"fileHash": "0fd5ca45",
|
"fileHash": "c09afe4f",
|
||||||
"needsInterop": false
|
"needsInterop": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,15 +51,10 @@
|
|||||||
name="selected"
|
name="selected"
|
||||||
required
|
required
|
||||||
></select>
|
></select>
|
||||||
</div>
|
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="author" class="form-label">Автор</label>
|
<label for="author" class="form-label">Автор</label>
|
||||||
<select
|
<select id="author" class="form-select" name="selected" required>
|
||||||
id="author"
|
</select>
|
||||||
class="form-select"
|
|
||||||
name="selected"
|
|
||||||
required
|
|
||||||
></select>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="name" class="form-label">Название</label>
|
<label for="name" class="form-label">Название</label>
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<link rel="stylesheet" href="./css/style.css">
|
<link rel="stylesheet" href="./css/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="">
|
<body class="page4x">
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-md navbar-dark">
|
<nav class="navbar navbar-expand-md navbar-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -98,15 +98,14 @@
|
|||||||
name="selected"
|
name="selected"
|
||||||
required
|
required
|
||||||
></select>
|
></select>
|
||||||
</div>
|
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="author" class="form-label">Автор</label>
|
<label for="author" class="form-label">Автор</label>
|
||||||
<select
|
<select
|
||||||
id="author"
|
id="author"
|
||||||
class="form-select"
|
class="form-select"
|
||||||
name="selected"
|
name="selected"
|
||||||
required
|
required>
|
||||||
></select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="name" class="form-label">Название</label>
|
<label for="name" class="form-label">Название</label>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<a class="nav-link active" href="./index.html">Главная страница</a>
|
<a class="nav-link active" href="./index.html">Главная страница</a>
|
||||||
<a class="nav-link" href="./page2.html">Жанры</a>
|
<a class="nav-link" href="./page2.html">Жанры</a>
|
||||||
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
<a class="nav-link" href="./page3.html">Бестселлеры</a>
|
||||||
<a class="nav-link" href="./AboutUs.html">О нас</a>
|
<a class="nav-link" href="./page4.html">Админ</a>
|
||||||
<a class="nav-link" href="./page5.html">Войти</a>
|
<a class="nav-link" href="./page5.html">Войти</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user