Commit cf4ef4b3 authored by Curtis Adam's avatar Curtis Adam

Hide empty modal fields for not logged in users

parent a53e7a63
Pipeline #30039 passed with stage
in 7 minutes and 51 seconds
......@@ -9,21 +9,21 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.name)">
<label class="col-3 col-form-label col-form-label-sm">Name</label>
<div class="col-9">
<input class="form-control form-control-sm" appFocus type="text" [disabled]="!this.authService.isLoggedIn()" [(ngModel)]="poi.name">
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.category)">
<label class="col-3 col-form-label col-form-label-sm">Category</label>
<div class="col-9">
<app-single-model-input [modelDefinition]="categoryModelDefinition" [(model)]="poi.category"></app-single-model-input>
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.persons)">
<label class="col-3 col-form-label col-form-label-sm">Persons</label>
<div class="col-9">
<app-multi-model-input [modelList]="poi.persons"
......@@ -55,7 +55,7 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.levels)">
<label class="col-3 col-form-label col-form-label-sm">Levels</label>
<div class="col-9">
<div class="btn-group btn-group-sm btn-group-toggle" data-toggle="buttons">
......@@ -70,7 +70,7 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.description)">
<label class="col-3 col-form-label col-form-label-sm">Description</label>
<div class="col-9">
<textarea class="form-control form-control-sm" rows="4" [(ngModel)]="poi.description" [disabled]="!this.authService.isLoggedIn()" ></textarea>
......@@ -84,28 +84,28 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.building)">
<label class="col-3 col-form-label col-form-label-sm">Building</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.building" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.street)">
<label class="col-3 col-form-label col-form-label-sm">Street</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.street" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.zip)">
<label class="col-3 col-form-label col-form-label-sm">ZIP</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.zip" [disabled]="!this.authService.isLoggedIn()" >
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.city)">
<label class="col-3 col-form-label col-form-label-sm">City</label>
<div class="col-9">
<input class="form-control form-control-sm" type="text" [(ngModel)]="poi.city" [disabled]="!this.authService.isLoggedIn()" >
......@@ -133,7 +133,7 @@
</div>
</div>
<div class="form-group row">
<div class="form-group row" *ngIf="this.canViewContent(poi.contacts)">
<label class="col-3 col-form-label col-form-label-sm">Contacts</label>
<div class="col-9">
<app-contact-input [contacts]="poi.contacts"></app-contact-input>
......
......@@ -50,6 +50,14 @@ export class AddEditPoiComponent implements OnInit {
}
}
canViewContent(content: any): boolean {
if (this.authService.isLoggedIn()) {
return true;
} else {
return content.length;
}
}
get poi(): PoiModel {
return this.commonAddEditService.object as PoiModel;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment