diff --git a/src/app/_modules/auth/auth-modal/auth-modal.component.html b/src/app/_modules/auth/auth-modal/auth-modal.component.html new file mode 100644 index 0000000..1507c29 --- /dev/null +++ b/src/app/_modules/auth/auth-modal/auth-modal.component.html @@ -0,0 +1,21 @@ + +
+

Вход в систему

+

Регистрация

+

Восстановление пароля

+

Сброс пароля

+
+
+ +
+
+ + + + +

{{url}} is undefined

+
+
+
+
+ diff --git a/src/app/_modules/widget/modal/modal.component.scss b/src/app/_modules/auth/auth-modal/auth-modal.component.scss similarity index 100% rename from src/app/_modules/widget/modal/modal.component.scss rename to src/app/_modules/auth/auth-modal/auth-modal.component.scss diff --git a/src/app/_modules/auth/auth-modal/auth-modal.component.ts b/src/app/_modules/auth/auth-modal/auth-modal.component.ts new file mode 100644 index 0000000..da9c4e1 --- /dev/null +++ b/src/app/_modules/auth/auth-modal/auth-modal.component.ts @@ -0,0 +1,24 @@ +import { Component } from '@angular/core'; +import {Router} from "@angular/router"; + +@Component({ + selector: 'auth-modal', + templateUrl: './auth-modal.component.html', + styleUrls: ['./auth-modal.component.scss'] +}) +export class AuthModalComponent { + constructor(private router: Router) { + } + + get url() { + let str = this.router.url + return str.substring( + str.indexOf(':') + 1, + str.lastIndexOf(')') + ); + } + + close() { + this.router.navigate([{outlets: {auth: null}}]).then(); + } +} diff --git a/src/app/_modules/auth/auth.module.ts b/src/app/_modules/auth/auth.module.ts index ed5eab6..fa7bf50 100644 --- a/src/app/_modules/auth/auth.module.ts +++ b/src/app/_modules/auth/auth.module.ts @@ -9,12 +9,18 @@ import {AuthFormPasswordResetComponent} from "@app/_modules/auth/forms/reset/aut import {AuthFormSignupComponent} from "@app/_modules/auth/forms/signup/auth-form-signup.component"; import {AuthPageComponent} from "@app/_modules/auth/page/auth-page.component"; import {NotAuthGuard} from "@app/_helpers/not-auth.guard"; +import { AuthModalComponent } from './auth-modal/auth-modal.component'; +import { WidjetModule } from '../widjet/widjet.module'; const routes = [ {path: 'login', component: AuthPageComponent, canActivate: [NotAuthGuard]}, + {path: 'login', component: AuthModalComponent, canActivate: [NotAuthGuard], outlet: 'auth'}, {path: 'signup', component: AuthPageComponent, canActivate: [NotAuthGuard]}, + {path: 'signup', component: AuthModalComponent, canActivate: [NotAuthGuard], outlet: 'auth'}, {path: 'password/forget', component: AuthPageComponent, canActivate: [NotAuthGuard]}, - {path: 'password/reset/:token/:email', component: AuthPageComponent, canActivate: [NotAuthGuard]} + {path: 'password/forget', component: AuthModalComponent, canActivate: [NotAuthGuard], outlet: 'auth'}, + {path: 'password/reset/:token/:email', component: AuthPageComponent, canActivate: [NotAuthGuard]}, + {path: 'password/reset/:token/:email', component: AuthPageComponent, canActivate: [NotAuthGuard], outlet: 'auth'} ]; @NgModule({ @@ -23,17 +29,20 @@ const routes = [ FormsModule, ReactiveFormsModule, CommonModule, + WidjetModule, RouterModule.forRoot(routes) ], exports: [ ], declarations: [ + AuthModalComponent, AuthPageComponent, AuthFormLoginComponent, AuthFormSignupComponent, AuthFormPasswordForgetComponent, - AuthFormPasswordResetComponent + AuthFormPasswordResetComponent, + AuthModalComponent ], }) export class AuthModule {} diff --git a/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.html b/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.html index cac3db7..94a514d 100644 --- a/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.html +++ b/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.html @@ -1,4 +1,3 @@ -

Восстановление пароля

@@ -8,7 +7,7 @@
{{error}}
Если указанный адрес зарегистрирован, то на него будет выслан новый пароль
- +
diff --git a/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.ts b/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.ts index 0354137..e4d455e 100644 --- a/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.ts +++ b/src/app/_modules/auth/forms/forget/auth-form-password-forget.component.ts @@ -7,7 +7,7 @@ import {AuthenticationService} from '@app/_services'; @Component({ selector: 'auth-form-password-forget', templateUrl: 'auth-form-password-forget.component.html', - styleUrls: ['auth-form-password-forget.component.scss', '../forms.component.scss'] + styleUrls: ['auth-form-password-forget.component.scss'] }) export class AuthFormPasswordForgetComponent implements OnInit { form: FormGroup; @@ -47,4 +47,11 @@ export class AuthFormPasswordForgetComponent implements OnInit { let trans = {'The given data was invalid.': 'Указанный адрес почты не найден'}; this.error = trans[error] || error; } + + login(){ + this.router.navigate( + [ {outlets: {auth: 'login'}}], + {skipLocationChange: true} + ).then(); + } } diff --git a/src/app/_modules/auth/forms/forms.component.scss b/src/app/_modules/auth/forms/forms.component.scss deleted file mode 100644 index e679a30..0000000 --- a/src/app/_modules/auth/forms/forms.component.scss +++ /dev/null @@ -1,88 +0,0 @@ -h2 { - margin: 0 0 24px; - font-size: 24px; - font-weight: normal; -} - -.field { - margin: 0 0 16px; - - label { - font-size: 14px; - color: #666666; - line-height: 20px; - } - - .checkbox { - display: flex; - flex-direction: row; - gap: 12px; - margin: 0 0 12px; - &:last-child {margin: 0;} - label { - font-size: 0.875rem; - color: #86898E; - a { - color: #F9B417; - } - } - input { - flex-shrink: 0; - width: 20px; - height: 20px; - margin: 0; - padding: 0; - } - } -} - -.error { - margin: 0 0 16px; - font-size: 14px; - color: #D91519; - text-align: center; -} - -.bar { - display: flex; - flex-direction: row; - align-items: center; - width: 100%; - flex-wrap: wrap; - row-gap: 18px; - .remember { - display: flex; - flex-direction: row; - align-items: center; - input { - width: 16px; - height: 16px; - margin-right: 8px; - border-radius: 2px; - border: 1px solid #86898E; - } - } - .forget { - margin-left: auto; - cursor: pointer; - } -} - -.bottom { - display: flex; - flex-direction: row; - align-items: center; - justify-content: flex-end; - gap: 24px; - margin: 24px 0 0; -} - - -@media screen and (max-width: 600px) { - .bottom { - flex-direction: column-reverse; - button { - width: 100%; - } - } -} diff --git a/src/app/_modules/auth/forms/login/auth-form-login.component.html b/src/app/_modules/auth/forms/login/auth-form-login.component.html index c1ed254..b547a78 100644 --- a/src/app/_modules/auth/forms/login/auth-form-login.component.html +++ b/src/app/_modules/auth/forms/login/auth-form-login.component.html @@ -1,5 +1,4 @@ -
-

Вход в систему

+
@@ -14,7 +13,10 @@
- Забыли пароль? +
diff --git a/src/app/_modules/auth/forms/login/auth-form-login.component.ts b/src/app/_modules/auth/forms/login/auth-form-login.component.ts index 9fed5d6..329dfbf 100644 --- a/src/app/_modules/auth/forms/login/auth-form-login.component.ts +++ b/src/app/_modules/auth/forms/login/auth-form-login.component.ts @@ -6,7 +6,7 @@ import {AuthenticationService} from '@app/_services'; @Component({ selector: 'auth-form-login', templateUrl: 'auth-form-login.component.html', - styleUrls: ['auth-form-login.component.scss', '../forms.component.scss'] + styleUrls: ['auth-form-login.component.scss'] }) export class AuthFormLoginComponent implements OnInit { form: FormGroup; @@ -49,4 +49,18 @@ export class AuthFormLoginComponent implements OnInit { let trans = {'The user credentials were incorrect.': 'Имя пользователя или пароль указаны неверно.'}; this.error = trans[error] || error; } + + forget(){ + this.router.navigate( + [ {outlets: {auth: 'password/forget'}}], + {skipLocationChange: true} + ).then(); + } + + signup(){ + this.router.navigate( + [ {outlets: {auth: 'signup'}}], + {skipLocationChange: true} + ).then(); + } } diff --git a/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.html b/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.html index fa9df5d..cbc897f 100644 --- a/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.html +++ b/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.html @@ -1,5 +1,4 @@ -

Сброс пароля

diff --git a/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.ts b/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.ts index 8a1b15a..dd27d91 100644 --- a/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.ts +++ b/src/app/_modules/auth/forms/reset/auth-form-password-reset.component.ts @@ -7,7 +7,7 @@ import {AuthenticationService} from '@app/_services'; @Component({ selector: 'auth-form-password-reset', templateUrl: 'auth-form-password-reset.component.html', - styleUrls: ['auth-form-password-reset.component.scss', '../forms.component.scss'] + styleUrls: ['auth-form-password-reset.component.scss'] }) export class AuthFormPasswordResetComponent implements OnInit { form: FormGroup; diff --git a/src/app/_modules/auth/forms/signup/auth-form-signup.component.html b/src/app/_modules/auth/forms/signup/auth-form-signup.component.html index ae91070..987bb58 100644 --- a/src/app/_modules/auth/forms/signup/auth-form-signup.component.html +++ b/src/app/_modules/auth/forms/signup/auth-form-signup.component.html @@ -1,5 +1,4 @@ -

Регистрация

diff --git a/src/app/_modules/auth/forms/signup/auth-form-signup.component.ts b/src/app/_modules/auth/forms/signup/auth-form-signup.component.ts index 1dc3518..e75f668 100644 --- a/src/app/_modules/auth/forms/signup/auth-form-signup.component.ts +++ b/src/app/_modules/auth/forms/signup/auth-form-signup.component.ts @@ -8,7 +8,7 @@ import {Subscription} from "rxjs"; @Component({ selector: 'auth-form-signup', templateUrl: 'auth-form-signup.component.html', - styleUrls: ['auth-form-signup.component.scss', '../forms.component.scss'] + styleUrls: ['auth-form-signup.component.scss'] }) export class AuthFormSignupComponent implements OnInit { form: FormGroup; diff --git a/src/app/_modules/auth/page/auth-page.component.html b/src/app/_modules/auth/page/auth-page.component.html index 29fd514..075be0c 100644 --- a/src/app/_modules/auth/page/auth-page.component.html +++ b/src/app/_modules/auth/page/auth-page.component.html @@ -1,12 +1,12 @@
-
+
+

Вход в систему

+

Регистрация

+

Восстановление пароля

+

Сброс пароля

+
diff --git a/src/app/_modules/auth/page/auth-page.component.scss b/src/app/_modules/auth/page/auth-page.component.scss index c2f73c9..e69de29 100644 --- a/src/app/_modules/auth/page/auth-page.component.scss +++ b/src/app/_modules/auth/page/auth-page.component.scss @@ -1,46 +0,0 @@ -.authentication { - display: flex; - flex-direction: row; - width: 100%; - height: 100vh; - .logo { - display: flex; - width: 50%; - flex-shrink: 0; - height: 100%; - border-right: #E0E0E0 solid 1px; - text-align: center; - color: #0071BB; - } - - .form { - display: flex; - flex-grow: 1; - padding: 24px; - } - - .center { - width: 100%; - max-width: 416px; - margin: auto; - } -} - - -@media screen and (max-width: 959px) { - .authentication { - flex-direction: column; - justify-content: center; - .logo { - width: 100%; - height: auto; - border-right: none; - } - .form { - flex-grow: 0; - } - ::ng-deep h2 { - text-align: center; - } - } -} diff --git a/src/app/_modules/auth/page/auth-page.component.ts b/src/app/_modules/auth/page/auth-page.component.ts index 76ca9d4..c85456d 100644 --- a/src/app/_modules/auth/page/auth-page.component.ts +++ b/src/app/_modules/auth/page/auth-page.component.ts @@ -6,7 +6,7 @@ import {Router} from "@angular/router"; templateUrl: 'auth-page.component.html', styleUrls: ['auth-page.component.scss'] }) -export class AuthPageComponent implements OnInit { +export class AuthPageComponent { constructor(private router: Router) { } @@ -14,8 +14,5 @@ export class AuthPageComponent implements OnInit { return this.router.url.split('?')[0].split('(')[0].split('/').slice(1, 3).join('/'); } - ngOnInit() { - } - } diff --git a/src/app/_modules/layout/footer/footer.component.ts b/src/app/_modules/layout/footer/footer.component.ts index 61a6cad..2d5fadf 100644 --- a/src/app/_modules/layout/footer/footer.component.ts +++ b/src/app/_modules/layout/footer/footer.component.ts @@ -1,6 +1,5 @@ import {Component} from '@angular/core'; import {AuthenticationService} from "@app/_services"; -import {Subscription} from "rxjs"; @Component({ selector: 'footer', diff --git a/src/app/_modules/layout/header/user-bar/header-user-bar.component.ts b/src/app/_modules/layout/header/user-bar/header-user-bar.component.ts index 14a1c23..cd4188a 100644 --- a/src/app/_modules/layout/header/user-bar/header-user-bar.component.ts +++ b/src/app/_modules/layout/header/user-bar/header-user-bar.component.ts @@ -1,7 +1,6 @@ import {Component, Input} from '@angular/core'; import {AuthenticationService} from "@app/_services"; import {Router} from "@angular/router"; -import {Subscription} from "rxjs"; import { PagesService } from '@app/_services/pages.service'; @@ -13,7 +12,6 @@ import { PagesService } from '@app/_services/pages.service'; export class HeaderUserBarComponent { public menuItems = []; public ddHidden = true; - subscriptionUser: Subscription; constructor(public authService: AuthenticationService, private router: Router, private pagesService: PagesService) { } diff --git a/src/app/_modules/layout/jumbotron/jumbotron.component.ts b/src/app/_modules/layout/jumbotron/jumbotron.component.ts index 3eab2a1..65e8ba7 100644 --- a/src/app/_modules/layout/jumbotron/jumbotron.component.ts +++ b/src/app/_modules/layout/jumbotron/jumbotron.component.ts @@ -14,6 +14,7 @@ export class JumbotronComponent { ){} get currentPage(){ + return this.pagesService.currentPage } diff --git a/src/app/_modules/pages/tree/item/pages-tree-item.component.html b/src/app/_modules/pages/tree/item/pages-tree-item.component.html index 98f4a45..00cc173 100644 --- a/src/app/_modules/pages/tree/item/pages-tree-item.component.html +++ b/src/app/_modules/pages/tree/item/pages-tree-item.component.html @@ -1,32 +1,41 @@ -
+
-
+
- - - - - - - - - - - - - - - +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
diff --git a/src/app/_modules/pages/tree/item/pages-tree-item.component.ts b/src/app/_modules/pages/tree/item/pages-tree-item.component.ts index adab3d8..52c50ae 100644 --- a/src/app/_modules/pages/tree/item/pages-tree-item.component.ts +++ b/src/app/_modules/pages/tree/item/pages-tree-item.component.ts @@ -68,7 +68,7 @@ export class PagesTreeItemComponent { fetch() { - let include = ['children']; + let include = ['children','locale']; this.pagesService.show(this.page.id, {include: include.join(','), withTrashed: true}).subscribe(res => { this.page = res.data; }); diff --git a/src/app/_modules/widget/modal/modal.component.html b/src/app/_modules/widget/modal/modal.component.html deleted file mode 100644 index decdfe6..0000000 --- a/src/app/_modules/widget/modal/modal.component.html +++ /dev/null @@ -1 +0,0 @@ -

modal works!

diff --git a/src/app/_modules/widget/modal/modal.component.spec.ts b/src/app/_modules/widget/modal/modal.component.spec.ts deleted file mode 100644 index 1b71c6b..0000000 --- a/src/app/_modules/widget/modal/modal.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ModalComponent } from './modal.component'; - -describe('ModalComponent', () => { - let component: ModalComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ ModalComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/_modules/widget/modal/modal.component.ts b/src/app/_modules/widget/modal/modal.component.ts deleted file mode 100644 index cf6338f..0000000 --- a/src/app/_modules/widget/modal/modal.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-modal', - templateUrl: './modal.component.html', - styleUrls: ['./modal.component.scss'] -}) -export class ModalComponent { - -} diff --git a/src/app/_modules/widjet/switch/switch.component.scss b/src/app/_modules/widjet/switch/switch.component.scss index c8982e8..d24ac7d 100644 --- a/src/app/_modules/widjet/switch/switch.component.scss +++ b/src/app/_modules/widjet/switch/switch.component.scss @@ -1,7 +1,7 @@ - $bull: 18px; $offset: 2px; $track: 20px; + div{ border: 1px solid var(--second); display: inline-flex; diff --git a/src/app/_services/authentication.service.ts b/src/app/_services/authentication.service.ts index 878ce3e..f833428 100644 --- a/src/app/_services/authentication.service.ts +++ b/src/app/_services/authentication.service.ts @@ -90,7 +90,9 @@ export class AuthenticationService { popup(path: any) { - this.router.navigate([path]).then(); - //this.router.navigate([ {outlets: {auth: path}}], {skipLocationChange: true}).then(); + this.router.navigate( + [ {outlets: {auth: path}}], + {skipLocationChange: true} + ).then(); } } diff --git a/src/assets/css/_forms.scss b/src/assets/css/_forms.scss index 1478d4f..9d03d6e 100644 --- a/src/assets/css/_forms.scss +++ b/src/assets/css/_forms.scss @@ -233,4 +233,147 @@ form-field-document{ } } +} + + +auth-page{ + .authentication { + display: flex; + flex-direction: row; + .logo { + display: flex; + width: 50%; + flex-shrink: 0; + height: 100%; + border-right: #E0E0E0 solid 1px; + text-align: center; + color: #0071BB; + } + + .form { + display: flex; + flex-grow: 1; + padding: 24px; + } + + .center { + width: 100%; + max-width: 416px; + margin: auto; + } + } + + + @media screen and (max-width: 959px) { + .authentication { + flex-direction: column; + justify-content: center; + .logo { + width: 100%; + height: auto; + border-right: none; + } + .form { + flex-grow: 0; + } + ::ng-deep h2 { + text-align: center; + } + } + } + +} + +auth-page, auth-modal{ + h2 { + margin: 0 0 24px; + font-size: 24px; + font-weight: normal; + } + + .field { + margin: 0 0 16px; + + label { + font-size: 14px; + color: #666666; + line-height: 20px; + } + + .checkbox { + display: flex; + flex-direction: row; + gap: 12px; + margin: 0 0 12px; + &:last-child {margin: 0;} + label { + font-size: 0.875rem; + color: #86898E; + a { + color: #F9B417; + } + } + input { + flex-shrink: 0; + width: 20px; + height: 20px; + margin: 0; + padding: 0; + } + } + } + + .error { + margin: 0 0 16px; + font-size: 14px; + color: #D91519; + text-align: center; + } + + .bar { + display: flex; + flex-direction: row; + align-items: center; + width: 100%; + flex-wrap: wrap; + row-gap: 18px; + .remember { + display: flex; + flex-direction: row; + align-items: center; + input { + width: 16px; + height: 16px; + margin-right: 8px; + border-radius: 2px; + border: 1px solid #86898E; + } + } + .forget { + cursor: pointer; + display: flex; + justify-content: space-between; + flex-basis: 100%; + } + } + + .bottom { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-end; + gap: 24px; + margin: 24px 0 0; + } + + + @media screen and (max-width: 600px) { + .bottom { + flex-direction: column-reverse; + button { + width: 100%; + } + } + } + } \ No newline at end of file diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 8974e20..02a509c 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -6,7 +6,7 @@ export const environment = { production: false, apiUrl: 'http://api.nircms.lc', clientId: 2, - clientSecret: 'gVk3jjKq6rWWM52025xgXlw2XGW1UACowyMIyhRR', + clientSecret: 'E4BoAclC9X3gre4Wr4XXmU3Y7sXTEtFSk3iCSkIm', project: null, licence: 'POUFLO4YW7SU', defaultLocale: 'ru' diff --git a/src/environments/vniigaz-v2.env.dev.ts b/src/environments/vniigaz-v2.env.dev.ts index 4f6277e..24a6133 100644 --- a/src/environments/vniigaz-v2.env.dev.ts +++ b/src/environments/vniigaz-v2.env.dev.ts @@ -6,7 +6,7 @@ export const environment = { production: false, apiUrl: 'http://api.nircms.lc', clientId: 2, - clientSecret: 'v49Z7dwUb1cobcTIJ5JQVJBzOFcNyJMzMmiDspUm', + clientSecret: 'E4BoAclC9X3gre4Wr4XXmU3Y7sXTEtFSk3iCSkIm', project: 'vniigaz-v2', licence: 'POUFLO4YW7SU', defaultLocale: 'ru' diff --git a/src/vniigaz-v2/component/layout/footer/footer.component.html b/src/vniigaz-v2/component/layout/footer/footer.component.html index e3e04e2..2225070 100644 --- a/src/vniigaz-v2/component/layout/footer/footer.component.html +++ b/src/vniigaz-v2/component/layout/footer/footer.component.html @@ -2,7 +2,7 @@