mirror of
https://github.com/sergeyyarkov/digital-store.git
synced 2026-10-11 18:29:11 +03:00
added page Items
This commit is contained in:
parent
2c80e7ba67
commit
90131de759
@ -165,7 +165,29 @@ function controlPanelRoute(req, res) {
|
|||||||
res.render('admin/control-panel', {
|
res.render('admin/control-panel', {
|
||||||
name: req.user.name,
|
name: req.user.name,
|
||||||
email: req.user.email,
|
email: req.user.email,
|
||||||
title: 'Digital-Store | Панель управления сайтом'
|
title: 'Digital-Store | Панель управления сайтом',
|
||||||
|
host: req.headers.host,
|
||||||
|
pageName: ['Главная', 'main'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function controlPanelItemsRoute(req, res) {
|
||||||
|
res.render('admin/items', {
|
||||||
|
name: req.user.name,
|
||||||
|
email: req.user.email,
|
||||||
|
title: 'Digital-Store | Товары',
|
||||||
|
host: req.headers.host,
|
||||||
|
pageName: ['Товары', 'items'],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function controlPanelCategoriesRoute(req, res) {
|
||||||
|
res.render('admin/categories', {
|
||||||
|
name: req.user.name,
|
||||||
|
email: req.user.email,
|
||||||
|
title: 'Digital-Store | Категории',
|
||||||
|
host: req.headers.host,
|
||||||
|
pageName: ['Категории', 'categories'],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,4 +200,6 @@ module.exports = function (server, db) {
|
|||||||
server.get('/my-orders', (req, res) => myOrdersRoute(req, res, db));
|
server.get('/my-orders', (req, res) => myOrdersRoute(req, res, db));
|
||||||
server.get('/product/:id', (req, res) => onePageItemRoute(req, res, db));
|
server.get('/product/:id', (req, res) => onePageItemRoute(req, res, db));
|
||||||
server.get('/control-panel', checkAuthenticated, (req, res) => controlPanelRoute(req, res));
|
server.get('/control-panel', checkAuthenticated, (req, res) => controlPanelRoute(req, res));
|
||||||
|
server.get('/control-panel/items', checkAuthenticated, (req, res) => controlPanelItemsRoute(req, res));
|
||||||
|
server.get('/control-panel/categories', checkAuthenticated, (req, res) => controlPanelCategoriesRoute(req, res));
|
||||||
}
|
}
|
||||||
|
|||||||
19
dist/public/css/style.css
vendored
19
dist/public/css/style.css
vendored
@ -347,7 +347,7 @@ footer.main-footer .container {
|
|||||||
.purchase,
|
.purchase,
|
||||||
.main-section .background {
|
.main-section .background {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 4px;
|
border-radius: 0 0 2px 2px;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ footer.main-footer {
|
|||||||
.card .card-content h3 {
|
.card .card-content h3 {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
.buyers {
|
.table-buyers, .table-items {
|
||||||
max-height: 365px;
|
max-height: 365px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
@ -734,3 +734,18 @@ footer.admin-footer{
|
|||||||
.modal .modal-content h4 {
|
.modal .modal-content h4 {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
div.table-items td, div.table-items th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
div.table-items > table > tbody > tr > td:nth-child(1) > img{
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
div.table-items > table > tbody > tr > td:nth-child(7) > button.btn.orange {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
.sidenav .collapsible-body>ul:not(.collapsible)>li.active, .sidenav.sidenav-fixed .collapsible-body>ul:not(.collapsible)>li.active {
|
||||||
|
background-color: #e6e6e6;
|
||||||
|
}
|
||||||
|
.sidenav .collapsible-body>ul:not(.collapsible)>li.active a, .sidenav.sidenav-fixed .collapsible-body>ul:not(.collapsible)>li.active a {
|
||||||
|
color: rgba(0,0,0,0.87);
|
||||||
|
}
|
||||||
10
dist/views/admin/assets/scripts.pug
vendored
10
dist/views/admin/assets/scripts.pug
vendored
@ -6,4 +6,14 @@ script.
|
|||||||
M.Sidenav.init(document.querySelectorAll('.sidenav'));
|
M.Sidenav.init(document.querySelectorAll('.sidenav'));
|
||||||
M.Collapsible.init(document.querySelectorAll('.collapsible'));
|
M.Collapsible.init(document.querySelectorAll('.collapsible'));
|
||||||
M.Modal.init(document.querySelectorAll('.modal'));
|
M.Modal.init(document.querySelectorAll('.modal'));
|
||||||
|
//- active временно!!!!!
|
||||||
|
const currentPage = document.querySelector('#editCollapse .collapsible-body ul').dataset.current;
|
||||||
|
const pages = document.querySelectorAll('#editCollapse .collapsible-body ul li');
|
||||||
|
pages.forEach(page => {
|
||||||
|
if (currentPage === page.dataset.page) {
|
||||||
|
page.classList.add('active');
|
||||||
|
const list = M.Collapsible.getInstance(document.querySelector('#editCollapse'));
|
||||||
|
list.open();
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
28
dist/views/admin/assets/templates/header.pug
vendored
28
dist/views/admin/assets/templates/header.pug
vendored
@ -5,15 +5,15 @@ header.admin-header
|
|||||||
.nav-wrapper
|
.nav-wrapper
|
||||||
a(href="#" data-target="slide-out" class="sidenav-trigger" style="color: #000;")
|
a(href="#" data-target="slide-out" class="sidenav-trigger" style="color: #000;")
|
||||||
i.material-icons menu
|
i.material-icons menu
|
||||||
a(href="#" class="brand-logo grey-text text-darken-4") Главная
|
a(href="#" class="brand-logo grey-text text-darken-4") #{pageName[0]}
|
||||||
ul#slide-out.sidenav.sidenav-fixed.control-panel
|
ul#slide-out.sidenav.sidenav-fixed.control-panel
|
||||||
li
|
li
|
||||||
.user-view
|
.user-view
|
||||||
.background
|
.background
|
||||||
img(src="./img/admin/background-user.jpg", alt="#")
|
img(src="../img/admin/background-user.jpg", alt="#")
|
||||||
span(style="padding-top: 5px;padding-bottom:10px;display:block;").white-text Control Panel v1.0.0
|
span(style="padding-top: 5px;padding-bottom:10px;display:block;").white-text Control Panel v1.0.0
|
||||||
a(href="#")
|
a(href="#")
|
||||||
img(class="circle" src="./img/admin/avatar-user.jpg", alt="alt")
|
img(class="circle" src="../img/admin/avatar-user.jpg", alt="alt")
|
||||||
a(href="#")
|
a(href="#")
|
||||||
span.white-text.name #{name}
|
span.white-text.name #{name}
|
||||||
a(href="#")
|
a(href="#")
|
||||||
@ -28,26 +28,30 @@ header.admin-header
|
|||||||
li
|
li
|
||||||
a(href="#" class="subheader") Управление сайтом
|
a(href="#" class="subheader") Управление сайтом
|
||||||
li.no-padding
|
li.no-padding
|
||||||
ul.collapsible
|
li
|
||||||
|
a(href="/control-panel" class="collapsible-header waves-effect")
|
||||||
|
i.material-icons dashboard
|
||||||
|
| Статистика
|
||||||
|
ul#editCollapse.collapsible
|
||||||
li
|
li
|
||||||
a(href="#" class="collapsible-header waves-effect")
|
a(href="#" class="collapsible-header waves-effect")
|
||||||
i.material-icons edit
|
i.material-icons edit
|
||||||
| Редактирование
|
| Редактирование
|
||||||
.collapsible-body
|
.collapsible-body
|
||||||
ul
|
ul(data-current=pageName[1])
|
||||||
li
|
li(data-page="items")
|
||||||
a(href="#items")
|
a(href='http://'+host+'/control-panel/items')
|
||||||
i.material-icons list
|
i.material-icons list
|
||||||
| Товары
|
| Товары
|
||||||
li
|
li(data-page="categories")
|
||||||
a(href="#categories")
|
a(href='http://'+host+'/control-panel/categories')
|
||||||
i.material-icons category
|
i.material-icons category
|
||||||
| Категории
|
| Категории
|
||||||
li
|
li(data-page="content")
|
||||||
a(href="#categories")
|
a(href="#content")
|
||||||
i.material-icons visibility
|
i.material-icons visibility
|
||||||
| Контент на сайте
|
| Контент на сайте
|
||||||
li
|
li(data-page="administrators")
|
||||||
a(href="#administrators")
|
a(href="#administrators")
|
||||||
i.material-icons supervisor_account
|
i.material-icons supervisor_account
|
||||||
| Администраторы
|
| Администраторы
|
||||||
|
|||||||
11
dist/views/admin/categories.pug
vendored
Normal file
11
dist/views/admin/categories.pug
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
include ../assets/head.pug
|
||||||
|
body.has-fixed-sidenav
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
main.admin-main
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
h2 Редактирование категорий
|
||||||
|
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
|
include ./assets/scripts.pug
|
||||||
11
dist/views/admin/control-panel.pug
vendored
11
dist/views/admin/control-panel.pug
vendored
@ -28,8 +28,15 @@ body.has-fixed-sidenav
|
|||||||
.card
|
.card
|
||||||
.card-content
|
.card-content
|
||||||
span.card-title Список покупателей
|
span.card-title Список покупателей
|
||||||
.buyers
|
.search-field
|
||||||
table.striped
|
.nav-wrapper
|
||||||
|
.input-field
|
||||||
|
input#search(type="search" required placeholder="Введите почту покупателя")
|
||||||
|
label.label-icon(for="search")
|
||||||
|
i.material-icons search
|
||||||
|
i.material-icons close
|
||||||
|
.table-buyers
|
||||||
|
table.highlight
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th Почта
|
th Почта
|
||||||
|
|||||||
105
dist/views/admin/items.pug
vendored
Normal file
105
dist/views/admin/items.pug
vendored
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
include ../assets/head.pug
|
||||||
|
body.has-fixed-sidenav
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
main.admin-main
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
h2 Редактирование товаров
|
||||||
|
.col.s12
|
||||||
|
.card
|
||||||
|
.card-content
|
||||||
|
span.card-title Список товаров
|
||||||
|
.search-field
|
||||||
|
.nav-wrapper
|
||||||
|
.input-field
|
||||||
|
input#search(type="search" required placeholder="Введите название товара")
|
||||||
|
label.label-icon(for="search")
|
||||||
|
i.material-icons search
|
||||||
|
i.material-icons close
|
||||||
|
.table-items
|
||||||
|
table.highlight
|
||||||
|
thead
|
||||||
|
tr
|
||||||
|
th Иконка
|
||||||
|
th Наименование
|
||||||
|
th Категория
|
||||||
|
th Дата добавления
|
||||||
|
th Количество
|
||||||
|
th Цена
|
||||||
|
th Редактирование
|
||||||
|
|
||||||
|
.divider
|
||||||
|
tbody
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
tr
|
||||||
|
td
|
||||||
|
img(src="../img/service-icons/origin.svg", alt="alt")
|
||||||
|
td Тестовый товар №6
|
||||||
|
td Origin
|
||||||
|
td 2019-12-05
|
||||||
|
td 18
|
||||||
|
td 145 ₽
|
||||||
|
td
|
||||||
|
button.btn.red Удалить
|
||||||
|
button.btn.orange Изменить
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
|
include ./assets/scripts.pug
|
||||||
Loading…
x
Reference in New Issue
Block a user