<div class="col-lg-7">{{p().net_access_level().name()}}</div>
</div>
<div class="row mb-1">
- <div class="col-lg-5" i18n>Date of Birth</div>
- <div class="col-lg-7">{{p().dob() | date}}</div>
+ <div class="col-lg-5" i18n>
+ <a href="javascript:;" (click)="showDob = !showDob">Date of Birth</a>
+ </div>
+ <div class="col-lg-7">
+ <ng-container *ngIf="showDob">{{p().dob() | date}}</ng-container>
+ <ng-container *ngIf="!showDob" i18n><Hidden></ng-container>
+ </div>
</div>
<div class="row mb-1">
<div class="col-lg-5" i18n>Parent/Guardian</div>
import {NetService} from '@eg/core/net.service';
import {PrintService} from '@eg/share/print/print.service';
import {PatronService, PatronSummary} from './patron.service';
+import {ServerStoreService} from '@eg/core/server-store.service';
@Component({
templateUrl: 'summary.component.html',
})
export class PatronSummaryComponent implements OnInit {
- @Input() summary: PatronSummary;
+ private _summary: PatronSummary;
+ @Input() set summary(s: PatronSummary) {
+ if (s && this._summary && s.id !== this._summary.id) {
+ this.showDob = this.showDobDefault;
+ }
+ this._summary = s;
+ }
+
+ get summary(): PatronSummary {
+ return this._summary;
+ }
+
+ showDobDefault = false;
+ showDob = false;
constructor(
private org: OrgService,
private net: NetService,
private printer: PrintService,
+ private serverStore: ServerStoreService,
public patronService: PatronService
) {}
ngOnInit() {
+ this.serverStore.getItem('circ.obscure_dob').then(hide => {
+ this.showDobDefault = this.showDob = !hide;
+ });
}
p(): IdlObject { // patron shorthand