Skip to content
Snippets Groups Projects
Commit 86621e0d authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: news layout + update news routing navigation

parent 827d13c4
No related branches found
No related tags found
2 merge requests!178release V1.10.0,!106Dev
import { Component } from '@angular/core';
import { ProfileService } from './profile/services/profile.service';
import { AuthService } from './services/auth.service';
import { RouterListenerService } from './services/routerListener.service';
import { PrintService } from './shared/service/print.service';
import { WindowScrollService } from './shared/service/windowScroll.service';
......@@ -16,7 +17,8 @@ export class AppComponent {
public printService: PrintService,
private authService: AuthService,
private profilService: ProfileService,
private windowScrollService: WindowScrollService
private windowScrollService: WindowScrollService,
private routerListener: RouterListenerService
) {
if (this.authService.isLoggedIn()) {
this.profilService.getProfile();
......@@ -25,6 +27,7 @@ export class AppComponent {
window.addEventListener('resize', () => {
this.setHeightApp();
});
this.routerListener.loadRouting();
}
private setHeightApp(): void {
......
......@@ -32,6 +32,7 @@ import { DeactivateGuard } from './guards/deactivate.guard';
import { FooterFormComponent } from './form/footer-form/footer-form.component';
import { TempUserResolver } from './resolvers/temp-user.resolver';
import { StructureJoinComponent } from './structure-join/structure-join.component';
import { RouterListenerService } from './services/routerListener.service';
@NgModule({
declarations: [
......@@ -63,6 +64,7 @@ import { StructureJoinComponent } from './structure-join/structure-join.componen
AdminGuard,
DeactivateGuard,
TempUserResolver,
RouterListenerService,
],
bootstrap: [AppComponent],
})
......
......@@ -9,7 +9,7 @@
<app-svg-icon (click)="openMenu()" [type]="'ico'" [icon]="'menu'" [iconClass]="'icon-32'"></app-svg-icon>
</div>
<div fxLayout="row" class="right-header" fxLayoutAlign="center center" fxLayoutGap="3vw">
<!-- <a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a> -->
<a routerLink="/news" [routerLinkActive]="'active'" i18n>Actualités</a>
<a routerLink="/home" [routerLinkActive]="'active'" i18n>Cartographie de acteurs</a>
<a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a>
<a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'">Administration</a>
......@@ -28,7 +28,7 @@
<div (click)="closeMenu()" class="ico-close-details"></div>
</div>
<div fxLayout="column" class="right-header" fxLayoutAlign="none baseline" fxLayoutGap="5vw">
<!-- <a routerLink="/news" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Actualités</a> -->
<a routerLink="/news" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Actualités</a>
<a routerLink="/home" [routerLinkActive]="'active'" (click)="closeMenu()" i18n>Cartographie de acteurs</a>
<a routerLink="/about" [routerLinkActive]="'active'" i18n>Qui sommes-nous ?</a>
<a *ngIf="isAdmin" routerLink="/admin" [routerLinkActive]="'active'" (click)="closeMenu()">Administration</a>
......
......@@ -25,6 +25,7 @@
(clickOutside)="closeModal()"
>
<button
*ngIf="tags.public && tags.public.length > 0"
type="button"
fxLayout="row"
[ngClass]="{
......@@ -44,6 +45,7 @@
<div class="arrow"></div>
</button>
<button
*ngIf="tags.commune && tags.commune.length > 0"
class="btn-filter-no-margin"
type="button"
fxLayout="row"
......
......@@ -121,6 +121,6 @@ h1 {
}
.overflow {
@media #{$tablet} {
overflow-y: scroll;
overflow-x: auto;
}
}
......@@ -30,7 +30,7 @@ h2 {
@media #{$tablet} {
width: 100%;
}
width: 80%;
width: 862px;
h2 {
@media #{$large-phone} {
@include cn-bold-22;
......
......@@ -7,7 +7,12 @@ import { filter, pairwise } from 'rxjs/operators';
})
export class RouterListenerService {
private previousUrl: string;
constructor(private router: Router) {
constructor(private router: Router) {}
/**
* Start recording navigation history
*/
public loadRouting(): void {
this.router.events
.pipe(
filter((evt: any) => evt instanceof RoutesRecognized),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment