pull/1882/head
tidusjar 7 years ago
parent 498c019f5d
commit 6e79574aba

@ -1,8 +1,9 @@
<div *ngIf="form && customizationSettings"> <div *ngIf="form && customizationSettings">
<div class="bg" [style.background-image]="background"></div>
<div class="container" id="login"> <div class="container" id="login">
<div class="card card-container"> <div class="card card-container">
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> --> <!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> -->
<div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="/images/ms-icon-150x150.png" /></div> <div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/logo.png" /></div>
<div *ngIf="customizationSettings.logo"><img id="profile-img" class="center" [src]="customizationSettings.logo" /></div> <div *ngIf="customizationSettings.logo"><img id="profile-img" class="center" [src]="customizationSettings.logo" /></div>
<p id="profile-name" class="profile-name-card"></p> <p id="profile-name" class="profile-name-card"></p>

@ -1,11 +1,13 @@
import { Component, OnInit } from "@angular/core"; import { PlatformLocation } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { DomSanitizer } from "@angular/platform-browser";
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { ActivatedRoute, Params } from "@angular/router"; import { ActivatedRoute, Params } from "@angular/router";
import { ICustomizationSettings } from "../interfaces"; import { ICustomizationSettings } from "../interfaces";
import { IResetPasswordToken } from "../interfaces"; import { IResetPasswordToken } from "../interfaces";
import { IdentityService } from "../services"; import { IdentityService, ImageService } from "../services";
import { NotificationService } from "../services"; import { NotificationService } from "../services";
import { SettingsService } from "../services"; import { SettingsService } from "../services";
@ -17,9 +19,12 @@ export class TokenResetPasswordComponent implements OnInit {
public form: FormGroup; public form: FormGroup;
public customizationSettings: ICustomizationSettings; public customizationSettings: ICustomizationSettings;
public background: any;
public baseUrl: string;
constructor(private identityService: IdentityService, private router: Router, private route: ActivatedRoute, private notify: NotificationService, constructor(private identityService: IdentityService, private router: Router, private route: ActivatedRoute, private notify: NotificationService,
private fb: FormBuilder, private settingsService: SettingsService) { private fb: FormBuilder, private settingsService: SettingsService, private location: PlatformLocation,
private images: ImageService, private sanitizer: DomSanitizer) {
this.route.queryParams this.route.queryParams
.subscribe((params: Params) => { .subscribe((params: Params) => {
@ -33,6 +38,13 @@ export class TokenResetPasswordComponent implements OnInit {
} }
public ngOnInit() { public ngOnInit() {
this.images.getRandomBackground().subscribe(x => {
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")");
});
const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) {
this.baseUrl = base;
}
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x); this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
} }

Loading…
Cancel
Save