Skip to content

Commit

Permalink
user: display keep_history for patron
Browse files Browse the repository at this point in the history
* Displays the new field keep_history in the patron detailed view.

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
  • Loading branch information
Aly Badr committed Dec 9, 2020
1 parent 937f0bf commit b535cd2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</span>
</a>
</li>
<li class="nav-item">
<li *ngIf="patron.patron.keep_history" class="nav-item">
<a
id="history-tab"
class="nav-link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ <h5 translate>Patron Information</h5>
{{ patron.patron.type.pid | getRecord: 'patron_types' : 'field' : 'name' | async }}
</dd>
</dl>
<!-- KEEP HISTORY -->
<dl class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>Keep history</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<i class="fa" [ngClass]="patron.patron.keep_history ? 'fa-check text-success' : 'fa-times text-danger'"
aria-hidden="true">
</i>
</dd>
</dl>
<!-- ACCOUNT EXPIRATION -->
<dl class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0">
Expand All @@ -125,12 +134,14 @@ <h5 translate>Patron Information</h5>
<dd class="col-sm-7 col-md-8 mb-0">
{{ patron.patron.expiration_date | dateTranslate:'mediumDate' }}
</dd>
</dl>
<dl *ngIf="patron.patron.libraries && patron.patron.libraries.length > 0" class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0">
{{ 'Affiliation libraries' | translate }}:
</dt>
<dd *ngIf="patron.patron.libraries && patron.patron.libraries.length > 0" class="col-sm-7 col-md-8 mb-0">
<dd class="col-sm-7 col-md-8 mb-0">
<div *ngFor="let library of patron.patron.libraries">
{{library.pid | getRecord: 'libraries' : 'field' : 'name' | async}}
{{ library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
</div>
</dd>
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ <h5 translate>Patron Information</h5>
{{ patron.patron.type.pid | getRecord: 'patron_types' : 'field' : 'name' | async }}
</dd>
</dl>
<!-- KEEP HISTORY -->
<dl class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>Keep history</dt>
<dd class="col-sm-7 col-md-8 mb-0">
<i class="fa"
[ngClass]="patron.patron.keep_history ? 'fa-check text-success' : 'fa-times text-danger'"
aria-hidden="true">
</i>
</dd>
</dl>
<!-- ACCOUNT EXPIRATION -->
<dl class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Expand All @@ -143,14 +153,18 @@ <h5 translate>Patron Information</h5>
<dd class="col-sm-7 col-md-8 mb-0">
{{ patron.patron.expiration_date | dateTranslate:'mediumDate' }}
</dd>
<dt class="col-sm-3 offset-sm-2 offset-md-0 label-title" translate>
Affiliation libraries
</dl>
<dl *ngIf="patron.patron.libraries && patron.patron.libraries.length > 0" class="row mb-0">
<dt class="col-sm-3 offset-sm-2 offset-md-0">
{{ 'Affiliation libraries' | translate }}:
</dt>
<dd *ngIf="patron.patron.libraries && patron.patron.libraries.length > 0" class="col-sm-7 col-md-8 mb-0">
<dd class="col-sm-7 col-md-8 mb-0">
<div *ngFor="let library of patron.patron.libraries">
{{ library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}</div>
{{ library.pid | getRecord: 'libraries' : 'field' : 'name' | async }}
</div>
</dd>
</dl>

</section>
</article>
</ng-container>
1 change: 1 addition & 0 deletions projects/shared/src/lib/class/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class User {
communication_channel: string,
communication_language: string,
expiration_date: string,
keep_history: boolean,
libraries?: Array<Library>,
// When patron is blocked, add 'blocked' and 'blocked_note' fields.
blocked?: false,
Expand Down

0 comments on commit b535cd2

Please sign in to comment.