Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Max_ES 5 years ago committed by Gitea
commit d55fbf82c0

@ -24,10 +24,10 @@
<!-- <div mat-card-avatar class="example-header-image"></div> --> <!-- <div mat-card-avatar class="example-header-image"></div> -->
<mat-card-title> <mat-card-title>
{{post.author.name}} {{post.author.name}}
<a mat-button class="handle" routerLink="/profile/{{post.author.id}}">@{{post.author.handle}}</a> <a mat-button routerLink="/profile/{{post.author.id}}">@{{post.author.handle}}</a>
<p class="mat-card-subtitle">{{post.date}}</p>
</mat-card-title> </mat-card-title>
<mat-card-subtitle> <mat-card-subtitle>
<p>{{post.date}}</p>
</mat-card-subtitle> </mat-card-subtitle>
</mat-card-header> </mat-card-header>
<!--<img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">--> <!--<img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">-->

@ -5,8 +5,9 @@
box-sizing: border-box box-sizing: border-box
width: 100% width: 100%
margin-top: 0.5em margin-top: 0.5em
::ng-deep .mat-card-header-text ::ng-deep .mat-card-header-text
margin: 0px margin: 0px
.mat-card-subtitle
display: contents

@ -34,7 +34,7 @@ export class LoginComponent implements OnInit {
console.log('try to login with mail adress:' + pEmail); console.log('try to login with mail adress:' + pEmail);
this.errorOccurred = false; this.errorOccurred = false;
this.errorMessage = " "; this.errorMessage = " ";
this.login.email = pEmail this.login.email = pEmail.trim()
this.login.passwordHash = sha512.sha512(pPasswordHash); this.login.passwordHash = sha512.sha512(pPasswordHash);
console.log(this.login.passwordHash); console.log(this.login.passwordHash);

@ -32,7 +32,7 @@
<span>Greenvironment</span> <span>Greenvironment</span>
<!--The following menu items will be hidden on both SM and XS screen sizes --> <!--The following menu items will be hidden on both SM and XS screen sizes -->
<nav mat-tab-nav-bar backgroundColor="primary" fxShow="true" fxHide.lt-md="true"> <nav mat-tab-nav-bar backgroundColor="primary" fxShow="true" fxHide.lt-md="true">
<div *ngIf="loggedIn"> <div [hidden]="!loggedIn">
<a mat-tab-link class="link" <a mat-tab-link class="link"
*ngFor="let link of navLinksLoggedIn" *ngFor="let link of navLinksLoggedIn"
[routerLink]="link.path" [routerLink]="link.path"
@ -42,9 +42,8 @@
[active]="activeLink == link"> [active]="activeLink == link">
{{link.label}} {{link.label}}
</a> </a>
<a mat-tab-link (click)="logout()" >log out</a>
</div> </div>
<div *ngIf="!loggedIn"> <div [hidden]="loggedIn">
<a mat-tab-link class="link" <a mat-tab-link class="link"
*ngFor="let link of navLinks" *ngFor="let link of navLinks"
[routerLink]="link.path" [routerLink]="link.path"
@ -54,6 +53,10 @@
[active]="rla.isActive"> [active]="rla.isActive">
{{link.label}} {{link.label}}
</a> </a>
<a mat-tab-link class="link" id="login-button" routerLink="/login" (click)="activeLink = link"
routerLinkActive #rla="routerLinkActive"
[routerLinkActiveOptions]="{exact:true}"
[active]="rla.isActive">Login</a>
</div> </div>
</nav> </nav>
<div id="menu-button-box"> <div id="menu-button-box">
@ -63,13 +66,19 @@
</div> </div>
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">
<button mat-menu-item (click)="$event.stopPropagation();"> <button mat-menu-item (click)="$event.stopPropagation();">
<mat-slide-toggle <mat-slide-toggle
color="primary" color="primary"
class="theme-button" class="theme-button"
(change)="toggleTheme()"><!--stays white when dragged--> (change)="toggleTheme()"><!--stays white when dragged-->
dark mode dark mode
</mat-slide-toggle> </mat-slide-toggle>
</button> </button>
<div [hidden]="!loggedIn">
<button mat-menu-item (click)="logout()" >
<mat-icon>exit_to_app</mat-icon>
<span>log out</span>
</button>
</div>
</mat-menu> </mat-menu>
</mat-toolbar> </mat-toolbar>
<router-outlet></router-outlet> <router-outlet></router-outlet>

@ -26,6 +26,7 @@
.mat-tab-link .mat-tab-link
height: 56px height: 56px
#link-box #link-box
padding: 0.5em padding: 0.5em
@ -36,6 +37,7 @@
/deep/ .mat-tab-link /deep/ .mat-tab-link
min-width: 5em!important min-width: 5em!important
#login-button
#menu-button-box #menu-button-box

@ -59,8 +59,6 @@ export class MainNavigationComponent implements OnInit {
{ path: '', label: 'Home' }, { path: '', label: 'Home' },
{ path: '/about', label: 'About' }, { path: '/about', label: 'About' },
{ path: '/imprint', label: 'Imprint' }, { path: '/imprint', label: 'Imprint' },
{ path: '/login', label: 'Login' },
{ path: '/register', label: 'Register' },
]; ];
toggleTheme() { toggleTheme() {

@ -32,8 +32,8 @@ export class RegisterComponent implements OnInit {
this.errorOccurred = false; this.errorOccurred = false;
this.errorMessage = " "; this.errorMessage = " ";
if(this.passwordSame(pPasswordHash,pPasswordHashRepeat)){ if(this.passwordSame(pPasswordHash,pPasswordHashRepeat)){
this.registration.username = pUsername this.registration.username = pUsername.trim()
this.registration.email = pEmail this.registration.email = pEmail.trim()
this.registration.passwordHash = sha512.sha512(pPasswordHash); this.registration.passwordHash = sha512.sha512(pPasswordHash);
this.registerService.register(this.registration, error => this.registerError(error.json())); this.registerService.register(this.registration, error => this.registerError(error.json()));
} }

Loading…
Cancel
Save