From d8ed1fa618f0470a9e5b7773c95bd849e46505b9 Mon Sep 17 00:00:00 2001 From: panabonic Date: Tue, 14 Nov 2023 16:02:09 +0300 Subject: [PATCH 1/2] navigation update --- .../sections/item/page-section.component.html | 5 +- .../pages/sections/page-sections.module.ts | 48 ++++++++++--------- .../basic/cards/cards-section.component.html | 1 + .../basic/cards/cards-section.component.scss | 0 .../basic/cards/cards-section.component.ts | 32 +++++++++++++ src/environments/environment.ts | 6 +-- 6 files changed, 64 insertions(+), 28 deletions(-) create mode 100644 src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html create mode 100644 src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss create mode 100644 src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts diff --git a/src/app/_modules/pages/sections/item/page-section.component.html b/src/app/_modules/pages/sections/item/page-section.component.html index 3fe3261..f1968c3 100644 --- a/src/app/_modules/pages/sections/item/page-section.component.html +++ b/src/app/_modules/pages/sections/item/page-section.component.html @@ -14,9 +14,10 @@ - + +

section {{type?.name}} is undefined

diff --git a/src/app/_modules/pages/sections/page-sections.module.ts b/src/app/_modules/pages/sections/page-sections.module.ts index 37a5a0a..b6caa7c 100644 --- a/src/app/_modules/pages/sections/page-sections.module.ts +++ b/src/app/_modules/pages/sections/page-sections.module.ts @@ -27,6 +27,7 @@ import {PageMenuComponent} from "@app/_modules/pages/sections/menu/page-menu.com import {ImageGroupSectionComponent} from "@app/_modules/pages/sections/types/basic/image-group/image-group-section.component"; import {MemberSectionItemComponent} from "@app/_modules/pages/sections/types/basic/member/item/member-section-item.component"; import {MemberSectionListComponent} from "@app/_modules/pages/sections/types/basic/member/list/member-section-list.component"; +import {CardsSectionComponent} from "@app/_modules/pages/sections/types/basic/cards/cards-section.component"; @NgModule({ @@ -38,29 +39,30 @@ import {MemberSectionListComponent} from "@app/_modules/pages/sections/types/bas SwiperModule, VigetModule ], - declarations: [ - PageMenuComponent, - PageSectionsComponent, - PageSectionComponent, - HeaderSectionComponent, - TextSectionComponent, - AddSectionComponent, - ImagesSectionComponent, - DocumentsSectionComponent, - ListSectionComponent, - HtmlSectionComponent, - VideoSectionComponent, - ButtonSectionComponent, - IframeSectionComponent, - FeedbackSectionComponent, - ContactSectionComponent, - MapsSectionComponent, - MemberSectionComponent, - ImageGroupSectionComponent, - DocumentSectionComponent, - MemberSectionItemComponent, - MemberSectionListComponent, - ], + declarations: [ + PageMenuComponent, + PageSectionsComponent, + PageSectionComponent, + HeaderSectionComponent, + TextSectionComponent, + AddSectionComponent, + ImagesSectionComponent, + DocumentsSectionComponent, + ListSectionComponent, + HtmlSectionComponent, + VideoSectionComponent, + ButtonSectionComponent, + IframeSectionComponent, + FeedbackSectionComponent, + ContactSectionComponent, + MapsSectionComponent, + MemberSectionComponent, + ImageGroupSectionComponent, + DocumentSectionComponent, + MemberSectionItemComponent, + MemberSectionListComponent, + CardsSectionComponent, + ], exports: [ PageSectionsComponent, ImagesSectionComponent diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html new file mode 100644 index 0000000..12e03d6 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html @@ -0,0 +1 @@ +

cards section {{type?.name}}

diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts new file mode 100644 index 0000000..1a56bc8 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts @@ -0,0 +1,32 @@ +import {Component, Input} from '@angular/core'; +import {ObjectsService} from "@app/_services"; + +@Component({ + selector: 'cards-section', + templateUrl: 'cards-section.component.html', + styleUrls: ['cards-section.component.scss'] +}) +export class CardsSectionComponent { + @Input() section: any; + + constructor(private objectsService: ObjectsService) { + } + + + + get type() { + return this.objectsService.getValue(this.section, 'cards-section-type'); + } + /* + get title() { + return this.objectsService.getValue(this.section, 'button-title'); + } + get targetSelf() { + return this.objectsService.getValue(this.section, 'target-self'); + } + */ + + ngOnInit() { + } +} + diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 97f5634..28d9f5f 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,9 +4,9 @@ export const environment = { production: false, - apiUrl: 'http://api.vniigazv2.lc', - clientId: 4, - clientSecret: 'QC09jOPEU7mpfFerpLyAJRshFUW1T28GfhsYzJHc', + apiUrl: 'http://api.nircms.lc', + clientId: 2, + clientSecret: 'Q0p5wSWfodfhFdQ2xHpzFOBuQEJy090ho10Deh4O', project: null }; From 8a85a024a40d6ef043d83bbcbf89eed046096b98 Mon Sep 17 00:00:00 2001 From: panabonic Date: Wed, 15 Nov 2023 15:12:59 +0300 Subject: [PATCH 2/2] cards section added --- .../layout/footer/footer.component.scss | 6 +-- src/app/_modules/pages/page/page.component.ts | 2 +- .../pages/sections/page-sections.module.ts | 53 +++++++++---------- .../basic/cards/cards-section.component.html | 5 +- .../basic/cards/cards-section.component.scss | 3 ++ .../basic/cards/cards-section.component.ts | 22 ++++---- .../types/basic/cards/cards-section.module.ts | 26 +++++++++ .../items/cards-section-items.component.html | 3 ++ .../items/cards-section-items.component.scss | 11 ++++ .../items/cards-section-items.component.ts | 20 +++++++ .../item/cards-section-item.component.html | 5 ++ .../item/cards-section-item.component.scss | 5 ++ .../item/cards-section-item.component.ts | 24 +++++++++ .../cards-item-partners.component.html | 3 ++ .../cards-item-partners.component.scss | 5 ++ .../partners/cards-item-partners.component.ts | 26 +++++++++ .../persons/cards-item-persons.component.html | 8 +++ .../persons/cards-item-persons.component.scss | 5 ++ .../persons/cards-item-persons.component.ts | 34 ++++++++++++ 19 files changed, 223 insertions(+), 43 deletions(-) create mode 100644 src/app/_modules/pages/sections/types/basic/cards/cards-section.module.ts create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.html create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.scss create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.ts create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.html create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.scss create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.ts create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.html create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.scss create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.ts create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.html create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.scss create mode 100644 src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts diff --git a/src/app/_modules/layout/footer/footer.component.scss b/src/app/_modules/layout/footer/footer.component.scss index b67f381..e489912 100644 --- a/src/app/_modules/layout/footer/footer.component.scss +++ b/src/app/_modules/layout/footer/footer.component.scss @@ -1,7 +1,7 @@ .footer { - width: 100%; - padding: 40px 100px; + padding: 40px 100px; + margin-top: 48px; background-color: var(--prime-act); color: white; display: flex; @@ -16,7 +16,7 @@ } display: flex; flex-wrap: wrap; - grid-gap: 20px; + grid-gap: 20px; &>div{ padding-bottom: 40px; } diff --git a/src/app/_modules/pages/page/page.component.ts b/src/app/_modules/pages/page/page.component.ts index 29ee498..e1828f6 100644 --- a/src/app/_modules/pages/page/page.component.ts +++ b/src/app/_modules/pages/page/page.component.ts @@ -67,7 +67,7 @@ export class PageComponent { 'children', 'sections.type', 'sections.groups.fields.value', - 'sections.objectables.groups.fields.value', + 'sections.objects.groups.fields.value', 'sidebars.groups.fields.value', 'sidebars.type', 'permissions' diff --git a/src/app/_modules/pages/sections/page-sections.module.ts b/src/app/_modules/pages/sections/page-sections.module.ts index e5c1f37..a702ae1 100644 --- a/src/app/_modules/pages/sections/page-sections.module.ts +++ b/src/app/_modules/pages/sections/page-sections.module.ts @@ -27,8 +27,7 @@ import {PageMenuComponent} from "@app/_modules/pages/sections/menu/page-menu.com import {ImageGroupSectionComponent} from "@app/_modules/pages/sections/types/basic/image-group/image-group-section.component"; import {MemberSectionItemComponent} from "@app/_modules/pages/sections/types/basic/member/item/member-section-item.component"; import {MemberSectionListComponent} from "@app/_modules/pages/sections/types/basic/member/list/member-section-list.component"; -import {CardsSectionComponent} from "@app/_modules/pages/sections/types/basic/cards/cards-section.component"; - +import {CardsSectionModule} from "@app/_modules/pages/sections/types/basic/cards/cards-section.module"; @NgModule({ imports: [ @@ -37,32 +36,32 @@ import {CardsSectionComponent} from "@app/_modules/pages/sections/types/basic/ca ReactiveFormsModule, ObjectsModule, SwiperModule, - WidjetModule + WidjetModule, + CardsSectionModule + ], + declarations: [ + PageMenuComponent, + PageSectionsComponent, + PageSectionComponent, + HeaderSectionComponent, + TextSectionComponent, + AddSectionComponent, + ImagesSectionComponent, + DocumentsSectionComponent, + ListSectionComponent, + HtmlSectionComponent, + VideoSectionComponent, + ButtonSectionComponent, + IframeSectionComponent, + FeedbackSectionComponent, + ContactSectionComponent, + MapsSectionComponent, + MemberSectionComponent, + ImageGroupSectionComponent, + DocumentSectionComponent, + MemberSectionItemComponent, + MemberSectionListComponent ], - declarations: [ - PageMenuComponent, - PageSectionsComponent, - PageSectionComponent, - HeaderSectionComponent, - TextSectionComponent, - AddSectionComponent, - ImagesSectionComponent, - DocumentsSectionComponent, - ListSectionComponent, - HtmlSectionComponent, - VideoSectionComponent, - ButtonSectionComponent, - IframeSectionComponent, - FeedbackSectionComponent, - ContactSectionComponent, - MapsSectionComponent, - MemberSectionComponent, - ImageGroupSectionComponent, - DocumentSectionComponent, - MemberSectionItemComponent, - MemberSectionListComponent, - CardsSectionComponent, - ], exports: [ PageSectionsComponent, ImagesSectionComponent diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html index 12e03d6..5522854 100644 --- a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.html @@ -1 +1,4 @@ -

cards section {{type?.name}}

+
+ +
+ diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss index e69de29..469bf09 100644 --- a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.scss @@ -0,0 +1,3 @@ +.add { + margin-bottom: 24px; +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts index 1a56bc8..45dcdf9 100644 --- a/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.component.ts @@ -1,5 +1,5 @@ import {Component, Input} from '@angular/core'; -import {ObjectsService} from "@app/_services"; +import {FormsService, ObjectsService} from "@app/_services"; @Component({ selector: 'cards-section', @@ -9,24 +9,24 @@ import {ObjectsService} from "@app/_services"; export class CardsSectionComponent { @Input() section: any; - constructor(private objectsService: ObjectsService) { + constructor(private objectsService: ObjectsService, private formsService: FormsService) { } - - get type() { return this.objectsService.getValue(this.section, 'cards-section-type'); } - /* - get title() { - return this.objectsService.getValue(this.section, 'button-title'); + get cards() { + return this.section?.objects?.data; } - get targetSelf() { - return this.objectsService.getValue(this.section, 'target-self'); - } - */ ngOnInit() { } + + + add() { + let attach = {modelType: 'object', group: 'sections', modelId: this.section.id}; + this.formsService.createObject(this.type.name, {extraProps: {attach: attach}}); + } + } diff --git a/src/app/_modules/pages/sections/types/basic/cards/cards-section.module.ts b/src/app/_modules/pages/sections/types/basic/cards/cards-section.module.ts new file mode 100644 index 0000000..9ec40eb --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/cards-section.module.ts @@ -0,0 +1,26 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {CardsSectionComponent} from "@app/_modules/pages/sections/types/basic/cards/cards-section.component"; +import {CardsSectionItemsComponent} from "@app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component"; +import {CardsSectionItemComponent} from "@app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component"; +import {CardsItemPersonsComponent} from "@app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component"; +import {CardsItemPartnersComponent} from "@app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component"; + + +@NgModule({ + imports: [ + CommonModule + ], + declarations: [ + CardsSectionComponent, + CardsSectionItemsComponent, + CardsSectionItemComponent, + CardsItemPersonsComponent, + CardsItemPartnersComponent + ], + exports: [ + CardsSectionComponent + ] +}) +export class CardsSectionModule { +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.html b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.html new file mode 100644 index 0000000..87c8d2b --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.scss b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.scss new file mode 100644 index 0000000..8337d56 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.scss @@ -0,0 +1,11 @@ +.items { + display: flex; + flex-direction: row; + align-items: stretch; + gap: 24px; + flex-wrap: wrap; + + cards-section-item { + width: 25%; + } +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.ts b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.ts new file mode 100644 index 0000000..41d4f43 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/cards-section-items.component.ts @@ -0,0 +1,20 @@ +import {Component, Input} from '@angular/core'; +import {ObjectsService} from "@app/_services"; + +@Component({ + selector: 'cards-section-items', + templateUrl: 'cards-section-items.component.html', + styleUrls: ['cards-section-items.component.scss'] +}) +export class CardsSectionItemsComponent { + @Input() cards = []; + @Input() type: any; + + constructor() { + } + + + ngOnInit() { + } +} + diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.html b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.html new file mode 100644 index 0000000..626c66f --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.html @@ -0,0 +1,5 @@ +
+ + +

{{type?.name}} is undefined

+
diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.scss b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.scss new file mode 100644 index 0000000..23b2875 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.scss @@ -0,0 +1,5 @@ +.card { + height: 100%; + padding: 12px; + border: #dedede solid 1px; +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.ts b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.ts new file mode 100644 index 0000000..53340b4 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/cards-section-item.component.ts @@ -0,0 +1,24 @@ +import {Component, Input} from '@angular/core'; +import {FormsService, ObjectsService} from "@app/_services"; + +@Component({ + selector: 'cards-section-item', + templateUrl: 'cards-section-item.component.html', + styleUrls: ['cards-section-item.component.scss'] +}) +export class CardsSectionItemComponent { + @Input() card: any; + @Input() type: any; + + constructor(private objectsService: ObjectsService, private formsService: FormsService) { + } + + + ngOnInit() { + } + + edit() { + this.formsService.editObject(this.card.id); + } +} + diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.html b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.html new file mode 100644 index 0000000..9e183ab --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.scss b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.scss new file mode 100644 index 0000000..e0d978b --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.scss @@ -0,0 +1,5 @@ +.image { + img { + width: 100%; + } +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.ts b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.ts new file mode 100644 index 0000000..723ae2c --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/partners/cards-item-partners.component.ts @@ -0,0 +1,26 @@ +import {Component, Input} from '@angular/core'; +import {ObjectsService} from "@app/_services"; + +@Component({ + selector: 'cards-item-partners', + templateUrl: 'cards-item-partners.component.html', + styleUrls: ['cards-item-partners.component.scss'] +}) +export class CardsItemPartnersComponent { + @Input() card: any; + + constructor(private objectsService: ObjectsService) { + } + + get image() { + return this.objectsService.getValue(this.card, 'image-required'); + } + get link() { + return this.objectsService.getValue(this.card, 'link-required'); + } + + + ngOnInit() { + } +} + diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.html b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.html new file mode 100644 index 0000000..434577e --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.html @@ -0,0 +1,8 @@ +
+ +
+
{{name}}
+
{{position}}
+
{{phone}}
+ + diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.scss b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.scss new file mode 100644 index 0000000..e0d978b --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.scss @@ -0,0 +1,5 @@ +.image { + img { + width: 100%; + } +} diff --git a/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts new file mode 100644 index 0000000..d282462 --- /dev/null +++ b/src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts @@ -0,0 +1,34 @@ +import {Component, Input} from '@angular/core'; +import {ObjectsService} from "@app/_services"; + +@Component({ + selector: 'cards-item-persons', + templateUrl: 'cards-item-persons.component.html', + styleUrls: ['cards-item-persons.component.scss'] +}) +export class CardsItemPersonsComponent { + @Input() card: any; + + constructor(private objectsService: ObjectsService) { + } + + get image() { + return this.objectsService.getValue(this.card, 'image'); + } + get name() { + return this.objectsService.getValue(this.card, 'person-name'); + } + get position() { + return this.objectsService.getValue(this.card, 'person-position'); + } + get phone() { + return this.objectsService.getValue(this.card, 'contact-phone'); + } + get email() { + return this.objectsService.getValue(this.card, 'contact-email'); + } + + ngOnInit() { + } +} +