Skip to content

Commit

Permalink
circulation: past participle used when action done
Browse files Browse the repository at this point in the history
Actions realised on item into checkin/checkout component are now display
in the past participle. This commit also updates button according UX
chart and the border around an operated item if special actions should
be done (fees|transit)

* Closes rero/rero-ils#890

Co-authored-by: Renaud Michotte <[email protected]>
  • Loading branch information
zannkukai committed Apr 30, 2020
1 parent a5a7be4 commit 01c685d
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 32 deletions.
14 changes: 7 additions & 7 deletions projects/admin/src/app/circulation/item/item.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
 along with this program. If not, see <http://www.gnu.org/licenses/>.
-->

<div [ngClass]="{"border-danger": item.actionDone === "checkin" && (item.status === "in_transit" || item.pending_loans || totalAmountOfFee > 0),
<div [ngClass]="{"callout callout-warning": item.actionDone === itemAction.checkin && (item.status === "in_transit" || item.pending_loans || totalAmountOfFee > 0),
'text-secondary': item.status !== 'on_loan'}"
class="row p-2 mb-1 border rounded align-middle"
*ngIf="item">
Expand Down Expand Up @@ -69,17 +69,17 @@
<!-- ACTION DONE -->
<div class="col-lg-2">
<ng-container *ngIf="item.actionDone" [ngSwitch]="item.actionDone">
<ng-container *ngSwitchCase="checkin">
<ng-container *ngSwitchCase="itemAction.checkin">
<i class="fa fa-arrow-circle-o-down text-success align-baseline" aria-hidden="true"></i>
<span class="align-baseline ml-1">{{ item.actionDone | translate }}</span>
<span class="align-baseline ml-1" translate>checked in</span>
</ng-container>
<ng-container *ngSwitchCase="checkout">
<ng-container *ngSwitchCase="itemAction.checkout">
<i class="fa fa-arrow-circle-o-right text-success align-baseline" aria-hidden="true"></i>
<span class="align-baseline ml-1">{{ item.actionDone | translate }}</span>
<span class="align-baseline ml-1" translate>checked out</span>
</ng-container>
<ng-container *ngSwitchCase="extendLoan">
<ng-container *ngSwitchCase="itemAction.extend_loan">
<i class="fa fa-refresh text-success align-baseline" aria-hidden="true"></i>
<span class="align-baseline ml-1" translate>renew</span>
<span class="align-baseline ml-1" translate>renewed</span>
</ng-container>
<ng-container *ngSwitchDefault>
<span class="align-baseline">{{ item.actionDone | translate }}</span>
Expand Down
10 changes: 2 additions & 8 deletions projects/admin/src/app/circulation/item/item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,8 @@ export class ItemComponent implements OnInit {
/** Notifications related to the current loan */
notifications$: Observable<any>;

/** Extend loan item action */
extendLoan = ItemAction.extend_loan;

/** Checkin item action */
checkin = ItemAction.checkin;

/** Checkout item action */
checkout = ItemAction.checkout;
/** ItemAction reference */
itemAction = ItemAction;

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,32 @@
</div>
</div>
</div>
<!-- CHECKED OUT ITEMS -->
<!-- CHECKED OUT ITEMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<div class="row align-items-start" *ngFor="let item of checkedOutItems">
<!-- CONTENT -->
<div class="col mr-1">
<admin-item [patron]="patron" [item]="item">
</admin-item>
</div>
<!-- ACTIONS -->
<div *ngIf="patron" class="col-md-2 text-left pl-0 mb-2">
<!-- EXTEND LOAN -->
<button id="button-basic" class="btn btn-secondary mr-1 d-md-block" type="button"
[disabled]="!item.actions.includes(extendLoan)" (click)="extendLoanClick($event, item)" translate>
Renew
<!-- extend loan action -->
<button id="button-basic" type="button"
class="btn btn-outline-secondary mr-1 d-md-block"
[disabled]="!item.actions.includes(extendLoan)"
(click)="extendLoanClick($event, item)" translate>
Renew
</button>
</div>
</div>
<!-- CHECKED IN ITEMS : RED BORDER FOR TRANSIT, REQUEST OR FEE | GREYED BY DEFAULT-->
<!-- CHECKED IN ITEMS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Callout border for [TRANSIT|REQUEST|FEE] -->
<div class="row align-items-start" *ngFor="let item of checkedInItems">
<div class="col mr-1">
<admin-item [patron]="patron" [item]="item" (hasFeesEmitter)="hasFees($event)">
</admin-item>
<admin-item [patron]="patron" [item]="item" (hasFeesEmitter)="hasFees($event)"></admin-item>
</div>
<div *ngIf="patron" class="col-md-2 pl-0 mb-2">
<!-- No actions -->
</div>
<div *ngIf="patron" class="col-md-2 pl-0 mb-2">&nbsp;</div>
</div>
</div>
4 changes: 2 additions & 2 deletions projects/admin/src/app/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ json-schema-form {
// source: https://codepen.io/superjaberwocky/pen/AXdEWj
.callout {
border: 1px solid #eee;
border-left-width: 5px;
border-left-width: 5px !important;
border-radius: 3px;
h4 {
margin-top: 0;
Expand All @@ -116,7 +116,7 @@ json-schema-form {
}
@each $name,$color in (default,#777),(primary,$primary),(success,$success),(danger,$danger),(warning,$warning),(info,$info), (dark,$dark) {
.callout-#{$name} {
border-left-color: $color;
border-color: $color !important;
h4 {
color: $color;
}
Expand Down
15 changes: 14 additions & 1 deletion projects/admin/src/app/translate/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Budgets": "Budgets",
"Call number": "Signatur",
"Cancel": "Abbrechen",
"Cancel request": "Cancel request",
"Cancellation reason": "Grund des Abbruches",
"Cash": "Bar",
"Catalog": "Katalog",
Expand Down Expand Up @@ -80,11 +81,13 @@
"Discount amount": "Rabattbetrag",
"Dispute": "Streit",
"Distribution": "Distribution",
"Do you really want to delete this request?": "Do you really want to delete this request?",
"Document": "Dokument",
"Documents": "Dokumente",
"Due date": "Rückgabetermin",
"EAN not found!": "EAN nicht gefunden!",
"Edit": "Bearbeiten",
"Edit queue": "Edit queue",
"Edition": "Edition",
"Email": "E-Mail",
"Email format is not correct.": "Das E-Mail-Format ist nicht korrekt.",
Expand Down Expand Up @@ -146,13 +149,15 @@
"Name must be at least 2 characters long.": "Der Name muss mindestens 2 Zeichen lang sein.",
"Name must be at least 4 characters long.": "Der Name muss mindestens 4 Zeichen lang sein.",
"New request": "Neue Bestelleung",
"No": "No",
"No fee history for this patron.": "Keine Gebühren für diesen Leser",
"No history.": "No history.",
"No item received.": "No item received.",
"No items": "Keine Exemplare",
"No loan for the current patron.": "Keine Ausleihe bei diesem Leser.",
"No order lines": "Keine Bestellzeilen",
"No pending fee for this patron.": "Keine ausstehenden Gebühren für diesen Leser.",
"No pickup location": "No pickup location",
"No request corresponding to the given item has been found.": "Keine Bestellung für das angegebene Exemplar gefunden.",
"Note": "Anmerkung",
"Notes": "Anmerkungen",
Expand Down Expand Up @@ -258,8 +263,11 @@
"The item is already on loan": "Das Exemplar ist bereits ausgeliehen.",
"The item status does not allow requests.": "Der Exemplarstatus erlaubt keine Bestellungen.",
"The organisation's active budget is now on {{ budgetName }}": "Das aktive Budget der Organisation ist jetzt auf {{ budgetName }}",
"The pickup location cannot be modified": "The pickup location cannot be modified",
"The pickup location has been changed.": "The pickup location has been changed.",
"The record contains settings": "Der Datensatz enthält Einstellungen",
"The record has been harvested": "Der Datensatz wurde gesammelt",
"The request cannot be cancelled": "The request cannot be cancelled",
"The two periods are overlapping.": "Die Zeiträume überlappen sich.",
"Title": "Titel",
"Title is required.": "Titel ist erforderlich.",
Expand All @@ -277,6 +285,7 @@
"Vendors": "Lieferanten",
"Website": "Webseite",
"Yearly subscription": "Yearly subscription",
"Yes": "Yes",
"You cannot delete the record for the following reason:": "Aus folgendem Grund können Sie den Datensatz nicht löschen:",
"You cannot delete the record for the following reasons:": "Aus folgenden Gründen können Sie den Datensatz nicht löschen:",
"You do not have sufficient permissions to view this page": "Sie haben keine ausreichenden Berechtigungen, um diese Seite anzuzeigen.",
Expand Down Expand Up @@ -304,6 +313,8 @@
"bookplate": "Exlibris",
"budgets": "Budgets",
"canceled": "abgebrochen",
"checked in": "checked in",
"checked out": "checked out",
"checkout": "Ausleihe",
"circ_policies": "Ausleihpolitiken",
"classReading": "Klassenlektüre",
Expand Down Expand Up @@ -399,11 +410,13 @@
"recall": "Rückruf",
"received": "erhalten",
"relatedResource": "Verwandte Ressource",
"renew": "verlängern",
"renewals": "Verlängerungen",
"renewed": "renewed",
"request": "Bestellung",
"request in the queue": "request in the queue",
"requested": "bestellt",
"requests": "Bestellungen",
"requests in the queue": "requests in the queue",
"resource": "Ressource",
"saturday": "Samstag",
"score": "Partitur",
Expand Down
15 changes: 14 additions & 1 deletion projects/admin/src/app/translate/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Budgets": "Budgets",
"Call number": "Call number",
"Cancel": "Cancel",
"Cancel request": "Cancel request",
"Cancellation reason": "Cancellation reason",
"Cash": "Cash",
"Catalog": "Catalog",
Expand Down Expand Up @@ -80,11 +81,13 @@
"Discount amount": "Discount amount",
"Dispute": "Dispute",
"Distribution": "Distribution",
"Do you really want to delete this request?": "Do you really want to delete this request?",
"Document": "Document",
"Documents": "Documents",
"Due date": "Due date",
"EAN not found!": "EAN not found!",
"Edit": "Edit",
"Edit queue": "Edit queue",
"Edition": "Edition",
"Email": "Email",
"Email format is not correct.": "Email format is incorrect.",
Expand Down Expand Up @@ -146,13 +149,15 @@
"Name must be at least 2 characters long.": "Name must be at least 2 characters long.",
"Name must be at least 4 characters long.": "Name must be at least 4 characters long.",
"New request": "New request",
"No": "No",
"No fee history for this patron.": "No fee history for this patron.",
"No history.": "No history.",
"No item received.": "No item received.",
"No items": "No items",
"No loan for the current patron.": "No loan for the current patron.",
"No order lines": "No order lines",
"No pending fee for this patron.": "No pending fee for this patron.",
"No pickup location": "No pickup location",
"No request corresponding to the given item has been found.": "No request corresponding to the given item has been found.",
"Note": "Note",
"Notes": "Notes",
Expand Down Expand Up @@ -258,8 +263,11 @@
"The item is already on loan": "The item is already on loan",
"The item status does not allow requests.": "The item status does not allow requests.",
"The organisation's active budget is now on {{ budgetName }}": "The organisation's active budget is now on {{ budgetName }}",
"The pickup location cannot be modified": "The pickup location cannot be modified",
"The pickup location has been changed.": "The pickup location has been changed.",
"The record contains settings": "The record contains settings",
"The record has been harvested": "The record has been harvested",
"The request cannot be cancelled": "The request cannot be cancelled",
"The two periods are overlapping.": "The two periods are overlapping.",
"Title": "Title",
"Title is required.": "Title is required.",
Expand All @@ -277,6 +285,7 @@
"Vendors": "Vendors",
"Website": "Website",
"Yearly subscription": "Yearly subscription",
"Yes": "Yes",
"You cannot delete the record for the following reason:": "You cannot delete the record for the following reason:",
"You cannot delete the record for the following reasons:": "You cannot delete the record for the following reasons:",
"You do not have sufficient permissions to view this page": "You do not have sufficient permissions to view this page",
Expand Down Expand Up @@ -304,6 +313,8 @@
"bookplate": "bookplate",
"budgets": "budgets",
"canceled": "canceled",
"checked in": "checked in",
"checked out": "checked out",
"checkout": "checkout",
"circ_policies": "circulation policies",
"classReading": "class reading",
Expand Down Expand Up @@ -399,11 +410,13 @@
"recall": "recall",
"received": "received",
"relatedResource": "related resource",
"renew": "renew",
"renewals": "renewals",
"renewed": "renewed",
"request": "request",
"request in the queue": "request in the queue",
"requested": "requested",
"requests": "requests",
"requests in the queue": "requests in the queue",
"resource": "resource",
"saturday": "Saturday",
"score": "score",
Expand Down
4 changes: 3 additions & 1 deletion projects/admin/src/app/translate/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@
"bookplate": "bookplate",
"budgets": "budgets",
"canceled": "canceled",
"checked in": "checked in",
"checked out": "checked out",
"checkout": "checkout",
"circ_policies": "circ_policies",
"classReading": "classReading",
Expand Down Expand Up @@ -408,8 +410,8 @@
"recall": "recall",
"received": "received",
"relatedResource": "relatedResource",
"renew": "renew",
"renewals": "renewals",
"renewed": "renewed",
"request": "request",
"request in the queue": "request in the queue",
"requested": "requested",
Expand Down
15 changes: 14 additions & 1 deletion projects/admin/src/app/translate/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Budgets": "Presupuestos",
"Call number": "Número de clasificación",
"Cancel": "Cancelar",
"Cancel request": "Cancel request",
"Cancellation reason": "Motivos de cancelación",
"Cash": "Efectivo ",
"Catalog": "Catálogo",
Expand Down Expand Up @@ -80,11 +81,13 @@
"Discount amount": "Monto de descuento",
"Dispute": "Litigio",
"Distribution": "Distribution",
"Do you really want to delete this request?": "Do you really want to delete this request?",
"Document": "Documento",
"Documents": "Documentos",
"Due date": "Fecha de vencimiento",
"EAN not found!": "¡El EAN no ha sido encontrado!",
"Edit": "Editar",
"Edit queue": "Edit queue",
"Edition": "Edición",
"Email": "Correo electrónico",
"Email format is not correct.": "El formato del correo es incorecto.",
Expand Down Expand Up @@ -146,13 +149,15 @@
"Name must be at least 2 characters long.": "El nombre tiene que comportar al menos 2 caracteres.",
"Name must be at least 4 characters long.": "El nombre tiene que comportar más de 4 caracteres.",
"New request": "Nueva reservación",
"No": "No",
"No fee history for this patron.": "No hay histórico de honorarios para este patrón.",
"No history.": "No history.",
"No item received.": "No item received.",
"No items": "Ningún ejemplar.",
"No loan for the current patron.": "No hay préstamo para el usuario actual.",
"No order lines": "Ninguna línea de pedido",
"No pending fee for this patron.": "No hay honorarios pendientes para este patrón.",
"No pickup location": "No pickup location",
"No request corresponding to the given item has been found.": "No se ha encontrado ninguna reservación correspondiente al ejemplar.",
"Note": "Nota",
"Notes": "Notas",
Expand Down Expand Up @@ -258,8 +263,11 @@
"The item is already on loan": "El ejemplar ya está en préstamo",
"The item status does not allow requests.": "El estado del ejemplar no permite reservaciones.",
"The organisation's active budget is now on {{ budgetName }}": "El presupuesto activo de la organización es {{ budgetName }}",
"The pickup location cannot be modified": "The pickup location cannot be modified",
"The pickup location has been changed.": "The pickup location has been changed.",
"The record contains settings": "El registro contiene parámetros.",
"The record has been harvested": "El recurso ha sido importado.",
"The request cannot be cancelled": "The request cannot be cancelled",
"The two periods are overlapping.": "Los dos períodos se superponen.",
"Title": "Título",
"Title is required.": "El título es obligatorio.",
Expand All @@ -277,6 +285,7 @@
"Vendors": "Proveedores",
"Website": "Página web",
"Yearly subscription": "Yearly subscription",
"Yes": "Yes",
"You cannot delete the record for the following reason:": "No puede suprimir el recurso para la razón siguiente:",
"You cannot delete the record for the following reasons:": "No puede suprimir el recurso para las razones siguientes:",
"You do not have sufficient permissions to view this page": "No tiene suficientes permisos para ver esta página",
Expand Down Expand Up @@ -304,6 +313,8 @@
"bookplate": "placa de libro",
"budgets": "presupuestos",
"canceled": "candelado",
"checked in": "checked in",
"checked out": "checked out",
"checkout": "Préstamo",
"circ_policies": "Políticas de circulación",
"classReading": "lectura continuada",
Expand Down Expand Up @@ -399,11 +410,13 @@
"recall": "reclamación",
"received": "recibido",
"relatedResource": "Recurso relacionado",
"renew": "renovar",
"renewals": "renovaciones",
"renewed": "renewed",
"request": "reservación",
"request in the queue": "request in the queue",
"requested": "reservado",
"requests": "reservaciones",
"requests in the queue": "requests in the queue",
"resource": "recurso",
"saturday": "Sábado",
"score": "partición",
Expand Down
Loading

0 comments on commit 01c685d

Please sign in to comment.