Skip to content

Commit

Permalink
circulation: improve requested loans tab
Browse files Browse the repository at this point in the history
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Jul 14, 2021
1 parent edbc98f commit 6ae80f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,16 @@ export class MainRequestComponent implements OnInit, OnDestroy {
const bTime = moment(b.loan.transaction_date);
switch (this._sortCriteria) {
case '-requestdate': return bTime.diff(aTime);
case 'callnumber': return a.call_number.localeCompare(b.call_number);
case '-callnumber': return b.call_number.localeCompare(a.call_number);
case 'callnumber':
if (('call_number' in a) && ('call_number' in b)) {
return a.call_number.localeCompare(b.call_number);
}
return 1;
case '-callnumber':
if (('call_number' in a) && ('call_number' in b)) {
return b.call_number.localeCompare(a.call_number);
}
return 1;
default: return aTime.diff(bTime);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,14 @@
<!-- Patron information -->
<dt class="col-2 label-title text-right" translate>Requested by</dt>
<dd class="col-10">
<ng-container *ngIf="item.loan.patron.name as patronName">
<a name="patron-name" [routerLink]="['/circulation', 'patron', item.loan.patron.barcode[0]]">{{ patronName }}</a>
</ng-container>
</dd>
<!-- rank in the queue -->
<dt class="col-2 label-title text-right" translate>Position</dt>
<dd class="col-10">
<span class="badge badge-info">
{{ item.loan.rank }} / {{ item.pending_loans.length }}
</span>
<a name="patron-name" [routerLink]="['/circulation', 'patron', item.loan.patron.barcode[0]]">
{{ item.loan.patron.name }}
</a>
</dd>
<!-- item shelf location + destination -->
<dt class="col-2 label-title text-right" translate>Location</dt>
<dd name="location" class="col-10">
<ng-container *ngIf="item.location.pid | getRecord: 'locations' | async as location">
{{ location.metadata.library.pid | getRecord: 'libraries' : 'field' : 'name' | async }} &mdash;
</ng-container>
{{ item.location.name }}
{{ item.library.name }} {{ item.location.name }}
</dd>
<dt class="col-2 label-title text-right" translate>Pick-up Location</dt>
<dd name="pickup-location" class="col-10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class RequestedItemComponent implements OnInit {
/** OnInit hook */
ngOnInit() {
if (this.item) {
this._recordService.getRecord('documents', this.item.document.pid, 1, {
this._recordService.getRecord('documents', this.item.loan.document_pid, 1, {
Accept: 'application/rero+json, application/json'
}).subscribe(document => this.document = document.metadata);
}
Expand Down

0 comments on commit 6ae80f3

Please sign in to comment.