Skip to content
Snippets Groups Projects
Commit 03b9383c authored by Jérémie BRISON's avatar Jérémie BRISON Committed by Hugo SUBTIL
Browse files

feat: reduce url display for structure details, change phone display and small fixes

parent 80f0b99e
1 merge request!31Recette
<div fxLayout="column" fxLayoutAlign="center center" *ngIf="name"> <div fxLayout="column" fxLayoutAlign="center center" *ngIf="name">
<img [src]="'assets/logos/' + getLogoKey(name) + '.svg'" [alt]="'logo ' + name" /> <img [src]="'assets/logos/' + getLogoKey(name) + '.svg'" [alt]="'logo ' + name" />
<p>{{ name }}</p> <p>{{ getName(name) }}</p>
</div> </div>
...@@ -17,6 +17,15 @@ export class LogoCardComponent implements OnInit { ...@@ -17,6 +17,15 @@ export class LogoCardComponent implements OnInit {
ngOnInit(): void {} ngOnInit(): void {}
// Get the custom or default name from a demarche.
public getName(demarche: string): string {
switch (demarche) {
case Demarches.caf:
return 'Caf';
default:
return demarche;
}
}
public getLogoKey(demarche: string): string { public getLogoKey(demarche: string): string {
switch (demarche) { switch (demarche) {
case Demarches.caf: case Demarches.caf:
......
import { DayPipe } from './day.pipe'; import { DayPipe } from './day.pipe';
import { PhonePipe } from './phone.pipe';
import { UrlPipe } from './url.pipe';
export { DayPipe }; export { DayPipe, PhonePipe, UrlPipe };
// tslint:disable-next-line:variable-name // tslint:disable-next-line:variable-name
export const SharedPipes = [DayPipe]; export const SharedPipes = [DayPipe, PhonePipe, UrlPipe];
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'phone' })
export class PhonePipe implements PipeTransform {
transform(value: string): string {
//Remove dot and space from the phone string and add space in each 2 numbers
const regexArray = value.replace(/\s|\./g, '').match(/.{1,2}/g);
return regexArray.join(' ');
}
}
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'url' })
export class UrlPipe implements PipeTransform {
transform(value: string): string {
const valueSplitted = value.split('/');
if (value.includes('//')) {
value = valueSplitted[2];
} else {
value = valueSplitted[0];
}
return value;
}
}
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<h2 class="bold">{{ structure.nomDeVotreStructure }}</h2> <h2 class="bold">{{ structure.nomDeVotreStructure }}</h2>
<h3>{{ structure.typeDeStructure }}</h3> <h3>{{ structure.typeDeStructure }}</h3>
</div> </div>
<div fxLayout="column" fxLayoutAlign="end"> <div class="btnPrint" fxLayout="column" fxLayoutAlign="end">
<app-button <app-button
class="hide-on-print" class="hide-on-print"
[type]="'button'" [type]="'button'"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</div> </div>
</div> </div>
<div fxLayout="row"> <div fxLayout="row">
<div fxLayout="column" fxFlex="60%"> <div fxLayout="column" fxFlex="50%">
<div fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px"> <div fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px">
<app-structure-opening-status <app-structure-opening-status
class="hide-on-print" class="hide-on-print"
...@@ -36,21 +36,26 @@ ...@@ -36,21 +36,26 @@
</div> </div>
<div *ngIf="structure.siteWeb" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px"> <div *ngIf="structure.siteWeb" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px">
<app-svg-icon [type]="'ico'" [icon]="'web'"></app-svg-icon> <app-svg-icon [type]="'ico'" [icon]="'web'"></app-svg-icon>
<a target="_blank" rel="noopener noreferrer" [href]="structure.siteWeb">{{ structure.siteWeb }}</a> <a
target="_blank"
rel="noopener noreferrer"
[href]="structure.siteWeb.includes('http') ? structure.siteWeb : 'http://' + structure.siteWeb"
>{{ structure.siteWeb | url }}</a
>
</div> </div>
<div *ngIf="structure.telephone" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px"> <div *ngIf="structure.telephone" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px">
<app-svg-icon [type]="'ico'" [icon]="'tel'"></app-svg-icon> <app-svg-icon [type]="'ico'" [icon]="'tel'"></app-svg-icon>
<p>{{ structure.telephone }}</p> <p>{{ structure.telephone | phone }}</p>
</div> </div>
</div> </div>
<div fxLayout="column" fxFlex="40%"> <div fxLayout="column" fxFlex="50%">
<div *ngIf="structure.courriel" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px"> <div *ngIf="structure.courriel" fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px">
<app-svg-icon [type]="'ico'" [icon]="'email'"></app-svg-icon> <app-svg-icon [type]="'ico'" [icon]="'email'"></app-svg-icon>
<a [href]="'mailto:' + structure.courriel">{{ structure.courriel }}</a> <a [href]="'mailto:' + structure.courriel">{{ structure.courriel }}</a>
</div> </div>
<div fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px"> <div fxLayout="row" fxLayoutAlign="none flex-end" fxLayoutGap="13px">
<app-svg-icon [type]="'ico'" [icon]="'calendar'"></app-svg-icon> <app-svg-icon [type]="'ico'" [icon]="'calendar'"></app-svg-icon>
<p>Mise-à-jour le {{ structure.derniereModification | date: 'mediumDate' }}</p> <p>Mise à jour le {{ structure.derniereModification | date: 'mediumDate' }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -112,7 +117,7 @@ ...@@ -112,7 +117,7 @@
</div> </div>
<!-- Openning Hours --> <!-- Openning Hours -->
<div fxLayout="row" class="w-100"> <div fxLayout="row" class="w-100">
<div fxFlex="70%"> <div fxFlex="50%">
<h3 class="subtitle">Horaires d’ouverture au public :</h3> <h3 class="subtitle">Horaires d’ouverture au public :</h3>
<div fxLayout="column"> <div fxLayout="column">
<div *ngFor="let day of structure.hours | keyvalue: keepOriginalOrder"> <div *ngFor="let day of structure.hours | keyvalue: keepOriginalOrder">
...@@ -131,7 +136,7 @@ ...@@ -131,7 +136,7 @@
</div> </div>
</div> </div>
<!-- modalitesDacces --> <!-- modalitesDacces -->
<div fxFlex="30%"> <div fxFlex="50%">
<h3 class="subtitle">Accès</h3> <h3 class="subtitle">Accès</h3>
<div <div
*ngFor="let acces of structure.modalitesDacces" *ngFor="let acces of structure.modalitesDacces"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
@import '../../../../assets/scss/layout'; @import '../../../../assets/scss/layout';
.structrue-details-container { .structrue-details-container {
border-right: solid 1px $grey-4;
background-color: $white; background-color: $white;
z-index: $structure-details-z-index; z-index: $structure-details-z-index;
position: absolute; position: absolute;
...@@ -15,10 +16,13 @@ ...@@ -15,10 +16,13 @@
height: calc(100vh - #{$header-height} - #{$footer-height}); height: calc(100vh - #{$header-height} - #{$footer-height});
padding: 10px 24px; padding: 10px 24px;
overflow: auto; overflow: auto;
.btnPrint {
margin-right: 75px;
}
} }
.structrue-details-container > .structure-details-block { .structrue-details-container > .structure-details-block {
padding: 0px 68px 24px 0; padding: 0px 0px 24px 0;
border-bottom: 1px dashed $grey-2; border-bottom: 1px dashed $grey-2;
.subtitle { .subtitle {
text-transform: uppercase; text-transform: uppercase;
...@@ -27,7 +31,7 @@ ...@@ -27,7 +31,7 @@
} }
.structrue-details-container > .structure-details-block ~ .structure-details-block { .structrue-details-container > .structure-details-block ~ .structure-details-block {
padding: 24px 68px 24px 0; padding: 24px 0;
} }
.structure-details-block:last-child { .structure-details-block:last-child {
......
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