tk023 cards-item-persons

master
Boris Voropaev 2024-02-09 11:49:08 +03:00
parent 0f00949df7
commit 4f49779279
5 changed files with 95 additions and 12 deletions

View File

@ -508,6 +508,10 @@
{
"replace": "src/app/_modules/registries/registry/entries/entry/properties/entry-properties.component.ts",
"with": "src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts"
},
{
"replace": "src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts",
"with": "src/tk023/component/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts"
}
],
"inlineStyleLanguage": "scss",
@ -583,6 +587,10 @@
{
"replace": "src/app/_modules/registries/registry/entries/entry/properties/entry-properties.component.ts",
"with": "src/tk023/component/registries/registry/entries/entry/properties/entry-properties.component.ts"
},
{
"replace": "src/app/_modules/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts",
"with": "src/tk023/component/pages/sections/types/basic/cards/items/item/types/persons/cards-item-persons.component.ts"
}
],
"inlineStyleLanguage": "scss",

View File

@ -0,0 +1,22 @@
<!-- <div class="image">
<img *ngIf="image?.links?.thumb" [src]="image?.links?.thumb" />
</div> -->
<div class="position" *ngIf="position">{{position}}</div>
<div class="name" *ngIf="name">{{name}}</div>
<div class="additional" *ngIf="additional">{{additional}}</div>
<div class="phone" *ngIf="phone">{{phone}}</div>
<div class="email" *ngIf="email">{{email}}</div>
<div class="html" [innerHtml]="html"></div>
<!-- <div class="details" *ngIf="textOnly" (click)="showModal=true">
<a>{{about}}<ico ico="chevron_right_24"></ico></a>
</div> -->
<!-- <modal *ngIf="showModal" (close)="showModal=false">
<h4 header>{{name}}</h4>
<img *ngIf="image?.links?.thumb" [src]="image?.links?.thumb" />
<div class="subtitle" *ngIf="position">{{position}}</div>
<div class="phone" *ngIf="phone">{{phone}}</div>
<div class="email" *ngIf="email">{{email}}</div>
<div [innerHtml]="html"></div>
</modal> -->

View File

@ -0,0 +1,5 @@
.image {
img {
width: 100%;
}
}

View File

@ -0,0 +1,53 @@
import {Component, Input} from '@angular/core';
import {ObjectsService} from "@app/_services";
import {PagesService} from "@app/_services/pages.service";
@Component({
selector: 'cards-item-persons',
templateUrl: 'cards-item-persons.component.html',
styleUrls: ['cards-item-persons.component.scss']
})
export class CardsItemPersonsComponent {
@Input() card: any;
public showModal = false;
constructor(
private objectsService: ObjectsService,
public pagesService: PagesService
) {
}
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 additional() {
return this.objectsService.getValue(this.card, 'person-additional-position');
}
get phone() {
return this.objectsService.getValue(this.card, 'contact-phone');
}
get email() {
return this.objectsService.getValue(this.card, 'contact-email');
}
get html() {
return this.objectsService.getValue(this.card, 'html');
}
get textOnly(){
return this.html?.replace(/<[^>]*>?/gm, '').replace(/\s/g, "").replace(/\&nbsp;/gm,'');
}
get about(){
return this.pagesService.rootPage.slug ===""?"Подробнее":"About"
}
ngOnInit() {
}
}

View File

@ -199,25 +199,20 @@ cards-section-items{
cards-section-item {
width: 252px;
width: 100%;
cards-item-persons{
display: flex;
flex-direction: column;
gap: 16px;
gap: 0;
.image{
display: none;
}
.title{
font-family: PT Sans Narrow;
font-size: 24px;
font-style: normal;
font-weight: 700;
line-height: 32px;
letter-spacing: 0.24px;
color: var(--second);
.name{
font-weight: 500;
}
.subtitle{
color: var(--dark);
.position{
font-weight: 500;
color: var(--second);
}
.subtitle{
color: var(--dark);