Skip to content
Snippets Groups Projects
Commit cfb968e3 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

feat(structure): Add structure members in details

parent a48f0114
No related branches found
No related tags found
4 merge requests!418V2.1.0,!400V2.0,!273feat: add structure members in details,!230V2.0
......@@ -88,12 +88,9 @@
<div fxLayout="column">
<h2>Informations</h2>
<div class="info-block">
<div *ngIf="structure.getLabelTypeStructure()">
<div>
{{ structure.getLabelTypeStructure() }}
</div>
<div *ngIf="structure.structureName">
{{ structure.structureName }}
</div>
<div *ngIf="structure.address">
{{ structure.address.numero }} {{ structure.address.street }}, {{ structure.address.commune }}
</div>
......@@ -243,7 +240,7 @@
fxLayout="column"
class="structure-details-block"
fxLayoutAlign="baseline baseline"
fxLayoutGap="12px"
fxLayoutGap="8px"
>
<h2>Labellisations</h2>
<div class="wrapper">
......@@ -253,6 +250,31 @@
</div>
</div>
<!-- Members -->
<div
*ngIf="userIsLoggedIn() && structureAdmins.length"
fxLayout="column"
class="structure-details-block"
fxLayoutAlign="baseline baseline"
fxLayoutGap="8px"
>
<h2>Membres</h2>
<div fxLayout="column" fxLayoutGap="8px">
<div *ngFor="let member of structureAdmins" class="member-card">
<app-svg-icon
class="avatar"
[type]="'avatar'"
[icon]="'defaultAvatar'"
[iconClass]="'icon-40'"
></app-svg-icon>
<div class="info-member">
<p class="member">{{ member.name }} {{ member.surname }}</p>
<p class="job" *ngIf="displayJobEmployer(member)">{{ displayJobEmployer(member) }}</p>
</div>
</div>
</div>
</div>
<!-- Aides numérique -->
<div
*ngIf="structure.proceduresAccompaniment.length || structure.otherDescription"
......@@ -261,7 +283,7 @@
fxLayoutAlign="baseline baseline"
fxLayoutGap="12px"
>
<h2>Aides numérique</h2>
<h2>Aides au numérique</h2>
<div fxLayout="column">
<div class="wrapper">
<div *ngFor="let accompagnement of structure.proceduresAccompaniment">
......
......@@ -103,6 +103,27 @@ h3 {
border-bottom: none;
padding-bottom: 0px;
}
.member-card {
display: flex;
justify-content: center;
align-items: center;
.avatar {
background-color: $grey-8;
border-radius: 4px;
}
.info-member {
margin-left: 1rem;
p {
margin: 0;
}
.member {
@include lato-bold-14;
}
.job {
@include lato-regular-14;
}
}
}
.info-block > div {
margin-top: 4px;
......
......@@ -11,6 +11,7 @@ import { AuthService } from '../../../services/auth.service';
import { StructureService } from '../../../services/structure.service';
import { TclService } from '../../../services/tcl.service';
import { PrintService } from '../../../shared/service/print.service';
import { Utils } from '../../../utils/utils';
import { AccessModality } from '../../enum/access-modality.enum';
import { Equipment } from '../../enum/equipment.enum';
import { PublicCategorie } from '../../enum/public.enum';
......@@ -120,12 +121,9 @@ export class StructureDetailsComponent implements OnInit {
private async initForm(): Promise<void> {
if (this.userIsLoggedIn()) {
this.currentProfile = await this.profileService.getProfile();
if (this.profileService.isAdmin()) {
this.structureService.getStructureWithOwners(this.structure._id, this.currentProfile).subscribe((res) => {
this.structureAdmins = res.owners;
});
}
this.structureService.getStructureWithOwners(this.structure._id, this.currentProfile).subscribe((res) => {
this.structureAdmins = res.owners;
});
}
this.isClaimed = await this.structureService.isClaimed(this.structure._id, this.currentProfile).toPromise();
......@@ -410,4 +408,7 @@ export class StructureDetailsComponent implements OnInit {
public goToWebsite(): void {
window.open(this.structure.website, '_blank');
}
public displayJobEmployer(profile: User): string {
return new Utils().getJobEmployer(profile);
}
}
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