master
Boris Voropaev 2023-12-26 16:01:21 +03:00
parent c1f52ea6bf
commit 97bee86342
19 changed files with 169 additions and 59 deletions

View File

@ -2,6 +2,7 @@ import {Component} from '@angular/core';
import {PagesService} from "@app/_services/pages.service";
import { FormsService } from '@app/_services';
import {LicenceService} from "@app/_services/licence.service";
import { DialogService } from '@app/_services/dialog.service';
@Component({
selector: 'administrate-site-pages',
@ -9,7 +10,7 @@ import {LicenceService} from "@app/_services/licence.service";
styleUrls: ['administrate-site-pages.component.scss']
})
export class AdministrateSitePagesComponent {
constructor(private pagesService: PagesService, private formsService: FormsService, public licenceService: LicenceService) {
constructor(private pagesService: PagesService, private formsService: FormsService, public licenceService: LicenceService, private dialog: DialogService) {
}
get isLicenceActive() {
@ -33,7 +34,7 @@ export class AdministrateSitePagesComponent {
addLocale() {
if (this.isMultilang) this.formsService.createModel('localePage', null, 'pages-tree-root');
else alert('Отсутствует необходимая опция');
else this.dialog.alert('Данная опция не входит в Вашу лицензию. Для включения опции обратитесь в службу поддержки НИР (+7 499 490 04 65, help@nirgroup.ru)');
}
toggle() {

View File

@ -18,7 +18,7 @@
</div>
</div>
<div class="bottom">
<button [disabled]="loading" (click)="signup()" class="prime outline">Регистрация</button>
<!-- <button [disabled]="loading" (click)="signup()" class="prime outline">Регистрация</button> -->
<button [disabled]="loading" type="submit" class="prime">Войти</button>
</div>
</form>

View File

@ -49,7 +49,7 @@ export class PageComponent {
ngOnDestroy() {
this.routeSubscription?.unsubscribe();
this.listSubscription.unsubscribe()
this.listSubscription?.unsubscribe()
}
onNavigationEnd(event: NavigationEnd) {
@ -65,6 +65,7 @@ export class PageComponent {
this.loading = true;
let include = [
'parents.children',
'parents.picture',
'children',
'sections.type',
'sections.groups.fields.value',

View File

@ -2,9 +2,15 @@
<div class="name">
<h3>{{page.name}}</h3>
</div>
<div class="intro" *ngIf="!page.isBlank">
<gellery [images]="posters" *ngIf="posters"></gellery>
</div>
<div class="content" *ngIf="page.content" [innerHTML]="page.content"></div>
<page-sections [page]="page" [editMode]="editMode" [modelType]="'publication'"></page-sections>
<a (click)="back()" class="publication-page-back">
<ico ico="chevron_left_24"></ico>
Назад
</a>

View File

@ -1,4 +1,5 @@
import {Component, Input} from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'publication-page',
@ -9,13 +10,19 @@ export class PublicationPageComponent {
@Input() page: any;
@Input() editMode: boolean;
constructor() {
constructor(
private router: Router
) {
}
get posters() {
return this.page.posters?.data;
}
back(): void {
window.history.back();
}
ngOnInit() {
}
}

View File

@ -6,7 +6,7 @@
<div class="dropdown" (click)="close()" #langMenu>
<div class="menu">
<div class="type" *ngFor="let locale of locales" [routerLink]="locale.link" >
<div class="type" *ngFor="let locale of locales" (click)="select(locale)" >
<div class="row">
<img [src]="flag(locale.slug)">
{{locale.name}}

View File

@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import {PagesService} from "@app/_services/pages.service";
import { environment } from '@environments/environment';
import {Subscription} from "rxjs";
@ -15,7 +16,8 @@ export class LocaleComponent {
private rootSubscription: Subscription
constructor(
public pagesService: PagesService
public pagesService: PagesService,
private router: Router
){}
ngOnInit() {
@ -49,4 +51,10 @@ export class LocaleComponent {
}, 10);
}
select(locale){
let link = locale.link
this.router.navigate([{outlets: {slider: null}}]).then(() => {
this.router.navigate([link])});
}
}

View File

@ -59,8 +59,8 @@ export class LicenceService {
public checkEditAvailability(page?: any) {
if (!this.isActive) return this.error('Licence not active');
if ((page?.type?.name === 'registry') && !this.hasOption('registries')) return this.error('Registries option required');
if ((page?.type?.name === 'publications') && !this.hasOption('publications')) return this.error('Publications option required');
if ((page?.type?.name === 'registry') && !this.hasOption('registries')) return this.error('Срок действия лицензии истек. Режим редактирования не доступен. Продлите лицензию или обратитесь в службу поддержки НИР (+7 499 490 04 65, help@nirgroup.ru)');
if ((page?.type?.name === 'publications') && !this.hasOption('publications')) return this.error('Данная опция не входит в Вашу лицензию. Для включения опции обратитесь в службу поддержки НИР (+7 499 490 04 65, help@nirgroup.ru)');
return null;
}

View File

@ -3,6 +3,7 @@ import {HttpClient} from '@angular/common/http';
import {environment} from '@environments/environment';
import {Observable, BehaviorSubject} from "rxjs";
import {LicenceService} from "@app/_services/licence.service";
import { DialogService } from '@app/_services/dialog.service';
@Injectable({providedIn: 'root'})
@ -16,7 +17,7 @@ export class PagesService {
public rootPage = {link:'', slug:environment.defaultLocale};
constructor(private http: HttpClient, private licenceService: LicenceService) {
constructor(private http: HttpClient, private licenceService: LicenceService, private dialog: DialogService) {
//this.find('/').subscribe(res => {this.rootPages = res.data});
}
@ -42,7 +43,7 @@ export class PagesService {
if (value) {
let error = this.licenceService.checkEditAvailability(this.currentPage);
if (error) {
alert(error);
this.dialog.alert(error);
return;
}
}

View File

@ -2,7 +2,7 @@
<div class="block">
<div class="logo">
<img src="assets/images/logo_vniigaz_wt_280x110.svg" alt="">
<div *ngIf="!isLoggedIn">
<div *ngIf="!isLoggedIn" class="footer-login">
<a (click)="login()">Вход в личный кабинет</a>
</div>
</div>
@ -14,7 +14,7 @@
<a href="mailto:info@vniigaz-cert.ru">info@vniigaz-cert.ru</a>
</div>
<div>
142717, Российская Федерация, Московская область,<br>г. Видное, посёлок Развилка, ВНИИГАЗ
142717, Российская&nbsp;Федерация, Московская&nbsp;область, г.&nbsp;Видное, посёлок&nbsp;Развилка, ВНИИГАЗ
</div>
<div class="icons">
<a href="https://vk.com/vniigazcert" target="_blank">
@ -35,8 +35,8 @@
<div>
© 1998{{year}} ЧУ СЦ ВНИИГАЗ-Сертификат
</div>
<div class="op-63">
Работает на платформе НИР
<div class="nir">
<a href="https://nirgroup.ru">Работает на платформе НИР</a>
</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
<ico *ngIf="isRootPage" ico="burger_white_40dp" [size]="36"></ico>
</a>
<a [routerLink]="rootPage?.link" class="logo">
<img *ngIf="!isRootPage" src="assets/images/logo_vniigaz_1163x816.svg" alt="ВНИИГАЗ">
<img *ngIf="!isRootPage" src="assets/images/logo_vniigaz.svg" alt="ВНИИГАЗ">
<img *ngIf="isRootPage" src="assets/images/logo_vniigaz_wt_280x110.svg" alt="ВНИИГАЗ">
</a>

View File

@ -2,11 +2,11 @@
<div class="jumbotron-content layout-corral">
<header-user-bar></header-user-bar>
<div class="jumbotron-content-center">
<h1 *ngIf="!isRootPage" [ngStyle]="h1Style">{{name}}</h1>
<h1 *ngIf="isRootPage" [ngStyle]="h1Style">
<h1 [ngStyle]="h1Style">{{name}}</h1>
<!-- <h1 *ngIf="isRootPage" [ngStyle]="h1Style">
Сертификация<br>
продукции, работ и услуг</h1>
<h4 *ngIf="isRootPage">
продукции, работ и услуг</h1> -->
<h4 *ngIf="since">
<a href="https://vniigaz.gazprom.ru/" target="_blank">Учреждено в 1998</a>
</h4>
</div>
@ -20,4 +20,4 @@
<switch [val]="editMode"></switch>
</div>
</div>
</div>
</div>

View File

@ -11,7 +11,9 @@ import { AuthenticationService } from '@app/_services';
export class JumbotronComponent {
private subscription:Subscription
public currentPage:any;
public contentPage:any;
public pagePicture:any;
constructor(
private pagesService: PagesService,
@ -22,21 +24,16 @@ export class JumbotronComponent {
this.subscription = this.pagesService.currentPageSubject.subscribe(
resp=> {
this.currentPage = resp;
console.log(this.currentPage)
if (this.currentPage) {
if(this.currentPage.picture){
this.contentPage = this.currentPage
this.pagePicture = this.currentPage.picture.data.links.open
}else{
let include = [
'parents.picture',
];
let url = this.currentPage.link;
if (url) this.pagesService.find(url, {include: include.join(',')}).subscribe(res => {
this.contentPage = res.data.parents.data.findLast(page=>page.picture)
}, error => {
console.log(error)
});
let parents = this.currentPage.parents.data
let content = parents.map(page=>page.picture).filter(page=>page)
this.pagePicture = content.pop()?.data.links.open
}
}else{this.contentPage = null;}
}else{this.pagePicture = null;}
}
)
}
@ -47,7 +44,7 @@ export class JumbotronComponent {
get name(){
let name:string
if(this.currentPage){
name = this.currentPage?.h1 || this.currentPage?.name
name = this.currentPage?.h1 || this.currentPage?.name;
let parents = this.currentPage?.parents?.data
if(parents){
if (parents[1]?.type.name=='nav-page'){
@ -63,9 +60,9 @@ export class JumbotronComponent {
get bgStyle(){
let height = 70;
let pictURL:string;
if (this.contentPage){
if (this.pagePicture){
height = 150;
pictURL = this.contentPage?.picture?.data.links.open;
pictURL = this.pagePicture;
}
return {
@ -76,7 +73,7 @@ export class JumbotronComponent {
get h1Style(){
return {
color: this.contentPage?.picture?'var(--white)':'var(--second-act)',
color: this.pagePicture?'var(--white)':'var(--second-act)',
'align-self': this.mainPage?'center':'flex-start',
'text-align': this.mainPage?'center':'left',
'width': this.mainPage?'900px':null,
@ -104,4 +101,8 @@ export class JumbotronComponent {
return !this.pagesService.currentPage?.parents.data.length && this.pagesService.currentPage
}
get since(){
return this.currentPage?.link === '/'
}
}

View File

@ -8,6 +8,9 @@
Личный кабинет (АИС СЦ)
</a>
</div>
<div>
<locale></locale>
</div>
</div>
</div>
</slider>

View File

@ -311,27 +311,9 @@ header{
width:27px;
object-fit: cover;
border: 1px solid lightgray;
}
}
}
footer{
.locale{
position: relative;
.locale-btn{
display: inline-flex;
}
.dropdown{
top: auto;
left: -96px;
bottom: 27px;
}
img{
height:18px;
width:27px;
object-fit: cover;
border: 1px solid lightgray;
&:hover{
border-color: var(--prime-act);
}
}
}
}

View File

@ -59,6 +59,8 @@ jumbotron{
.jumbotron-content-center{
align-self: center;
align-items: center;
max-width: 100%;
width: 768px;
h1{
font-size: 80px;
@ -192,6 +194,8 @@ footer{
&>div{
padding-bottom: 40px;
max-width: fit-content;
flex-basis: 400px;
}
>div{
display: block;
@ -222,6 +226,12 @@ footer{
font-style: normal;
font-weight: 400;
margin: 40px 0;
.nir a{
color: #6C6C6C;
&:hover{
color: #7c7c7c;
}
}
}
}
}
@ -256,6 +266,9 @@ pages-menu-item{
@media screen and (max-width: 1330px){
.footer{
padding: 40px 24px;
.footer-login{
display: none;
}
}
.space{
.layout-corral{

View File

@ -163,7 +163,9 @@ slider[side="left"]{
}
.btn-menu{
display: block;
display: flex;
flex-direction: column;
gap:40px;
padding: 20px 0 0 ;
border-top: 1px solid var(--prime);
a{
@ -174,6 +176,18 @@ slider[side="left"]{
letter-spacing: 0.24px;
color: #FFF;
}
locale{
img{
width: 27px;
}
.dropdown{
left: 48px;
top:-24px;
img{
border: 1px solid var(--second-dis);
}
}
}
}
}

View File

@ -443,6 +443,13 @@ publication-page {
flex-direction: column;
gap: $p;
};
.publication-page-back {
display: inline-flex;
align-items: center;
gap: 8px;
margin-top: 24px;
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 62 KiB