--- /dev/null
+<div class='eg-bib-staff-view w-100' *ngIf="summary">
+ <div class="row"><!-- "table" -->
+
+ <!-- 1st column -->
+ <div class="col-md-4">
+
+ <!-- Col 1, Title Row -->
+ <div class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Title:</div>
+ <div class="col-sm-8 bib-details">
+ <a *ngIf="summary.display.title" href="/eg2/staff/catalog/search?query={{summary.display.title}}&fieldClass=title&joinOp=&matchOp=contains&dateOp=is">
+ {{summary.display.title}}
+ </a>
+ </div>
+ </div><!-- end of Col 1, Title Row -->
+
+ <!-- Col 1, Series Title Row -->
+ <div *ngIf="summary.display.series_title" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Series Title:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _series of summary.display.series_title">
+ <a href="/eg2/staff/catalog/search?query={{_series}}&fieldClass=series&joinOp=&matchOp=contains&dateOp=is">
+ {{_series}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end Col 1, Series Title Row-->
+
+ <!-- Col 1, Author Row -->
+ <div class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Author:</div>
+ <div class="col-sm-8 bib-details">
+ <a *ngIf="summary.display.author" href="/eg2/staff/catalog/search?query={{summary.display.author}}&fieldClass=author&joinOp=&matchOp=contains&dateOp=is">
+ {{summary.display.author}}
+ </a>
+ </div>
+ </div><!-- end Col 1, Author Row -->
+
+ <!-- Col 1, Performer Row -->
+ <div *ngIf="summary.display.performers" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Performer:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _performer of summary.display.performers">
+ {{_performer}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, Performer Row -->
+
+ <!-- Col 1, Edition Row -->
+ <div *ngIf="summary.display.edition" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Edition:</div>
+ <div class="col-sm-8 bib-details">
+ {{summary.display.edition}}
+ </div>
+ </div><!-- end of Col 1, Edition Row -->
+
+ <!-- Col 1, Publisher Row -->
+ <div *ngIf="summary.display.publisher" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Publisher:</div>
+ <div class="col-sm-8 bib-details">
+ {{summary.display.publisher}}
+ </div>
+ </div><!-- end of Col 1, Publisher Row -->
+
+ <!-- Col 1, Production Credit Row -->
+ <div *ngIf="summary.display.production_credits" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Production Credit:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _credit of summary.display.production_credits">
+ {{_credit}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, Production Credit Row -->
+
+ <!-- Col 1, Type of Resource Row -->
+ <div *ngIf="summary.display.type_of_resource" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Type of Resource:</div>
+ <div class="col-sm-8 bib-details">
+ {{summary.display.type_of_resource}}
+ </div>
+ </div><!-- end of Col 1, Type of Resource Row -->
+
+ <!-- Col 1, Physical Description Row -->
+ <div *ngIf="summary.display.physical_description" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Physical Description:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _desc of summary.display.physical_description">
+ {{_desc}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, Physical Description Row -->
+
+ <!-- Col 1, ISBN Row -->
+ <div *ngIf="summary.display.isbn" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>ISBN:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _isbn of summary.display.isbn">
+ <a href="/eg2/staff/catalog/search?identQuery={{_isbn}}&identQueryType=identifier%7Cisbn">
+ {{_isbn}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, ISBN Row -->
+
+ <!-- Col 1, ISSN Row -->
+ <div *ngIf="summary.display.issn" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>ISSN:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _issn of summary.display.issn">
+ <a href="/eg2/staff/catalog/search?identQuery={{_issn}}&identQueryType=identifier%7Cissn">
+ {{_issn}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, ISSN Row -->
+
+ <!-- Col 1, UPC Row -->
+ <div *ngIf="summary.display.upc" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>UPC:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _upc of summary.display.upc">
+ <a href="/eg2/staff/catalog/search?identQuery={{_upc}}&identQueryType=identifier%7Cupc">
+ {{_upc}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 1, UPC Row -->
+
+ </div><!-- 1st column -->
+
+ <!-- 2nd column -->
+ <div class="col-md-4">
+
+ <!-- Col 2, Abstract Row -->
+ <div *ngIf="summary.display.abstract" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Summary:</div>
+ <div class="col-sm-8 bib-details">
+ {{summary.display.abstract}}
+ </div>
+ </div><!-- end of Col 2, Abstract Row -->
+
+ <!-- Col 2, General Note Row -->
+ <div *ngIf="summary.display.general_note" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>General Note:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _note of summary.display.general_note">
+ {{_note}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 2, General Note Row -->
+
+ <!-- Col 2, Bibliography Row -->
+ <div *ngIf="summary.display.bibliography" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Bibliography:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _bibliography of summary.display.bibliography">
+ {{_bibliography}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 2, Bibliography Row -->
+
+ <!-- Col 2, TOC Row -->
+ <div *ngIf="summary.display.toc" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Table of Contents:</div>
+ <div class="col-sm-8 bib-details">
+ {{summary.display.toc}}
+ </div>
+ </div><!-- end of Col 2, TOC Row -->
+
+ <!-- Col 2, Thesis Row -->
+ <div *ngIf="summary.display.thesis" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Thesis:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _thesis of summary.display.thesis">
+ {{_thesis}}
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 2, Thesis Row -->
+
+ </div><!-- 2nd column -->
+
+ <div class="col-md-4"><!-- 3rd column -->
+
+ <!-- Col 3, Hold and Copy Counts Row -->
+ <div class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Hold and Copy Counts:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li><span i18n>{{summary.holdCount}} hold requests</span></li>
+ <li *ngFor="let _count of summary.holdingsSummary">
+ <span i18n>{{_count.available}} of {{_count.count}} copies available at {{orgName(_count.org_unit)}}.</span>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 3, Hold and Copy Counts Row -->
+
+
+ <!-- Col 3, Subject Row -->
+ <div *ngIf="summary.display.subject" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _subj of summary.display.subject">
+ <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
+ {{_subj}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 3, Subject Row -->
+
+ <!-- Col 3, Genre Row -->
+ <div *ngIf="summary.display.genre" class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Genre:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <li *ngFor="let _genre of summary.display.genre">
+ <a href="/eg2/staff/catalog/search?query={{'subject:identifier|genre[' + _genre + ']'}}">
+ {{_genre}}
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 3, Genre Row -->
+
+ <!-- Col 3, Formats and Editions Row -->
+ <div class="row">
+ <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Formats and Editions:</div>
+ <div class="col-sm-8 bib-details">
+ <ul>
+ <ng-container *ngIf="summary.staffViewMetabibAttributes.icon_format">
+ <li *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format | keyvalue">
+ <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) icon_format({{_x.key}})">
+ {{_x.value.label}}
+ </a>
+ {{_x.value.count}}
+ </li>
+ </ng-container>
+ <ng-container *ngIf="summary.staffViewMetabibAttributes.item_lang">
+ <li *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang | keyvalue">
+ <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) item_lang({{_x.key}})">
+ {{_x.value.label}}
+ </a>
+ {{_x.value.count}}
+ </li>
+ </ng-container>
+ <li>
+ <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}})">
+ <span i18n>View all Formats and Editions</span>
+ </a>
+ <span> {{summary.staffViewMetabibRecords.length}}</span>
+ </li>
+ </ul>
+ </div>
+ </div><!-- end of Col 3, Formats and Editions Row -->
+
+ </div><!-- 3rd column -->
+
+ </div><!-- "table" -->
+</div>
--- /dev/null
+import {Component, OnInit, Input} from '@angular/core';
+import {OrgService} from '@eg/core/org.service';
+import {BibRecordService, BibRecordSummary
+ } from '@eg/share/catalog/bib-record.service';
+import {ServerStoreService} from '@eg/core/server-store.service';
+import {CatalogService} from '@eg/share/catalog/catalog.service';
+import {StaffCatalogService} from '@eg/staff/catalog/catalog.service';
+
+@Component({
+ selector: 'eg-bib-staff-view',
+ templateUrl: 'bib-staff-view.component.html',
+ styleUrls: ['bib-staff-view.component.css']
+})
+export class BibStaffViewComponent implements OnInit {
+
+ recId: number;
+ initDone = false;
+
+ // True / false if the display is vertically expanded
+ private _exp: boolean;
+ set expand(e: boolean) {
+ this._exp = e;
+ if (this.initDone) {
+ this.saveExpandState();
+ }
+ }
+ get expand(): boolean { return this._exp; }
+
+ @Input() set recordId(id: number) {
+ this.recId = id;
+ // Only force new data collection when recordId()
+ // is invoked after ngInit() has already run.
+ if (this.initDone) {
+ this.loadSummary();
+ }
+ }
+
+ // Otherwise, we'll use the provided bib summary object.
+ summary: BibRecordSummary;
+ @Input() set bibSummary(s: any) {
+ this.summary = s;
+ if (this.initDone && this.summary) {
+ this.summary.getBibCallNumber();
+ }
+ }
+
+ constructor(
+ private bib: BibRecordService,
+ private org: OrgService,
+ private store: ServerStoreService,
+ private cat: CatalogService,
+ private staffCat: StaffCatalogService
+ ) {}
+
+ ngOnInit() {
+
+ this.store.getItem('eg.cat.record.staff-view.collapse')
+ .then(value => this.expand = !value)
+ .then(_ => this.cat.fetchCcvms())
+ .then(_ => {
+ if (this.recId) {
+ // ignore any existing this.summary, always refetch
+ return this.loadSummary();
+ }
+ }).then(_ => this.initDone = true);
+ }
+
+ saveExpandState() {
+ this.store.setItem('eg.cat.record.staff-view.collapse', !this.expand);
+ }
+
+ loadSummary(): Promise<any> {
+ return this.bib.getBibSummary(
+ this.recId,
+ this.staffCat.searchContext.searchOrg.id(),
+ true // isStaff
+ ).toPromise()
+ .then(summary => {
+ this.summary = summary;
+ return summary.getBibCallNumber();
+ });
+ }
+
+ orgName(orgId: number): string {
+ if (orgId) {
+ return this.org.get(orgId).shortname();
+ }
+ }
+
+ iconFormatLabel(code: string): string {
+ return this.cat.iconFormatLabel(code);
+ }
+}
+
+