import {ResultsComponent} from './result/results.component';
import {RecordComponent} from './record/record.component';
import {CopiesComponent} from './record/copies.component';
+import {OpacViewComponent} from './record/opac.component';
import {ResultPaginationComponent} from './result/pagination.component';
import {ResultFacetsComponent} from './result/facets.component';
import {ResultRecordComponent} from './result/record.component';
HoldingsMaintenanceComponent,
SearchTemplatesComponent,
CnBrowseComponent,
+ OpacViewComponent,
CnBrowseResultsComponent
],
imports: [
<div class="row ml-0 mr-0">
- <a target="_blank" href="/eg/opac/record/{{recId}}">
- <button class="btn btn-outline-primary ml-1" i18n>View in Catalog</button>
- </a>
-
<a routerLink="/staff/catalog/hold/T" [queryParams]="{target: recId}">
<button class="btn btn-outline-primary ml-1" i18n>Place Hold</button>
</a>
--- /dev/null
+
+<ng-container *ngIf="url">
+ <iframe class="w-100" height="450px" [src]="url"></iframe>
+</ng-container>
+
--- /dev/null
+import {Component, Input} from '@angular/core';
+import {DomSanitizer} from '@angular/platform-browser';
+
+const OPAC_BASE_URL = '/eg/opac/record';
+
+@Component({
+ selector: 'eg-opac-record-detail',
+ templateUrl: 'opac.component.html'
+})
+export class OpacViewComponent {
+
+ url; // SafeResourceUrlImpl
+
+ _recordId: number;
+ @Input() set recordId(id: number) {
+
+ // Verify record ID is numeric only
+ if (id && (id + '').match(/^\d+$/)) {
+ this._recordId = id;
+ this.url = this.sanitizer.bypassSecurityTrustResourceUrl(
+ `${OPAC_BASE_URL}/${id}`);
+ } else {
+ this._recordId = null;
+ this.url = null;
+ }
+ }
+
+ get recordId(): number {
+ return this._recordId;
+ }
+
+ constructor(private sanitizer: DomSanitizer) {}
+}
+
</eg-catalog-record-conjoined>
</ng-template>
</ngb-tab>
+ <ngb-tab title="Patron View" i18n-title id="opac">
+ <ng-template ngbTabContent>
+ <eg-opac-record-detail [recordId]="recordId">
+ </eg-opac-record-detail>
+ </ng-template>
+ </ngb-tab>
</ngb-tabset>
</div>
</div>