mirror of
https://github.com/sergeyyarkov/digital-store.git
synced 2026-10-11 10:19:15 +03:00
modals rename
This commit is contained in:
parent
22fe715426
commit
ddd261081f
1
dist/views/admin/items.pug
vendored
1
dist/views/admin/items.pug
vendored
@ -6,6 +6,7 @@ body.has-fixed-sidenav
|
||||
.row
|
||||
.col.s12
|
||||
h2 Редактирование товаров
|
||||
p Добавляйте новые товары или редактируйте старные.
|
||||
.col.s12
|
||||
#items.card
|
||||
.card-content
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import { MaterializeConfig } from "./config/materialize.config.js";
|
||||
import { CategoriesComponent } from "./components/categories.component.js";
|
||||
import { editCategoryModal } from "./modals/editCategory.modal.js";
|
||||
import { ItemsComponent } from "./components/items.component.js";
|
||||
import { LoaderComponent } from "./components/loader.component.js";
|
||||
import { PaginationComponent } from "./components/pagination.component.js";
|
||||
import { editItemModal } from "./modals/editItem.modal.js";
|
||||
import { deleteItemModal } from "./modals/deleteItem.modal.js";
|
||||
import { SearchComponent } from "./components/search.component.js";
|
||||
import { IconsComponent } from "./components/icons.component.js";
|
||||
import { ItemEditModal } from "./modals/item-edit.modal.js";
|
||||
import { ItemDeleteModal } from "./modals/item-delete.modal.js";
|
||||
import { CategoryEditModal } from "./modals/category-edit.modal";
|
||||
|
||||
// Components
|
||||
const loader = new LoaderComponent('loader');
|
||||
const pagination = new PaginationComponent('pagination', {loader});
|
||||
const search = new SearchComponent('search', {loader});
|
||||
@ -16,8 +17,10 @@ const categories = new CategoriesComponent('categories');
|
||||
const icons = new IconsComponent('icons');
|
||||
const items = new ItemsComponent('items', {pagination}, {search});
|
||||
|
||||
const editCategory = new editCategoryModal('editCategoryModal', 'editCategory_select', 'editCategoryClose');
|
||||
const editItem = new editItemModal('editItemModal', 'edit', 'editItemClose');
|
||||
const deleteItem = new deleteItemModal('deleteItemModal', 'edit', 'deleteItemClose');
|
||||
// Modals
|
||||
const itemEdit = new ItemEditModal('editItemModal', 'edit', 'editItemClose');
|
||||
const itemDelete = new ItemDeleteModal('deleteItemModal', 'edit', 'deleteItemClose');
|
||||
const categoryEdit = new CategoryEditModal('editCategoryModal', 'editCategory_select', 'editCategoryClose');
|
||||
|
||||
const materialize = new MaterializeConfig();
|
||||
console.log('Control-Panel v1.0.0');
|
||||
@ -2,7 +2,7 @@ import { Modal } from "../core/modal";
|
||||
import { apiService } from "../services/api.service";
|
||||
import { renderIcons } from "../templates/icons.template";
|
||||
|
||||
export class editCategoryModal extends Modal {
|
||||
export class CategoryEditModal extends Modal {
|
||||
constructor(id, open, close) {
|
||||
super(id, open, close);
|
||||
}
|
||||
@ -30,7 +30,7 @@ export class editCategoryModal extends Modal {
|
||||
const data = JSON.parse(e.target.value),
|
||||
icons = await apiService.getIcons();
|
||||
|
||||
this.$img.innerHTML = '';
|
||||
this.$img.innerHTML = '<option value="" disabled selected>Выберите иконку</option>';
|
||||
this.$id.value = data.id;
|
||||
this.$originalTitle.value = data.title[0].toUpperCase() + data.title.slice(1);
|
||||
this.$title.value = data.title[0].toUpperCase() + data.title.slice(1);
|
||||
@ -1,7 +1,7 @@
|
||||
import { Modal } from "../core/modal";
|
||||
import axios from "axios";
|
||||
|
||||
export class deleteItemModal extends Modal {
|
||||
export class ItemDeleteModal extends Modal {
|
||||
constructor(id, open, close) {
|
||||
super(id, open, close);
|
||||
}
|
||||
@ -2,7 +2,7 @@ import { Modal } from "../core/modal";
|
||||
import { apiService } from "../services/api.service";
|
||||
import { renderCategories } from "../templates/categories.template";
|
||||
|
||||
export class editItemModal extends Modal {
|
||||
export class ItemEditModal extends Modal {
|
||||
constructor(id, open, close) {
|
||||
super(id, open, close);
|
||||
}
|
||||
@ -10,7 +10,7 @@ import { PayModal } from "./modals/pay.modal.js";
|
||||
import { NotificationComponent } from "./components/notification.component.js";
|
||||
import { MaterializeConfig } from "./config/materialize.config.js";
|
||||
|
||||
|
||||
// Components
|
||||
const header = new HeaderComponent('header');
|
||||
const loader = new LoaderComponent('loader');
|
||||
const information = new InformationComponent('information');
|
||||
@ -19,7 +19,10 @@ const items = new ItemsComponent('items', {loader}, {notification});
|
||||
const filter = new FilterComponent('filter', {items});
|
||||
const category = new CategoryComponent('category', {items}, {filter});
|
||||
const breadcumb = new BreadcrumbComponent('breadcrumb');
|
||||
|
||||
// Modals
|
||||
const cart = new CartModal('cart', 'cartOpen', 'cartClose', {items});
|
||||
const pay = new PayModal('pay', 'pay-js', 'payClose');
|
||||
|
||||
const materialize = new MaterializeConfig();
|
||||
console.log('Main Page');
|
||||
Loading…
x
Reference in New Issue
Block a user