1 <eg-string #userDeleteFailedString i18n-text text="Removal of User failed or was not allowed"></eg-string>
2 <eg-string #userDeleteSuccessString i18n-text text="Removal of User succeeded"></eg-string>
3 <eg-string #userAddSuccessString i18n-text text="Addition of User succeeded"></eg-string>
4 <eg-string #userAddFailedString i18n-text text="Addition of User failed or was not allowed"></eg-string>
5 <eg-string #userEditSuccessString i18n-text text="Update of User succeeded"></eg-string>
6 <eg-string #userEditFailedString i18n-text text="Update of User failed or was not allowed"></eg-string>
8 <ng-template #dialogContent>
9 <div class="modal-header bg-info"
10 [ngClass]="isDialog() ? 'modal-header' : 'alert mt-3'">
11 <h4 class="modal-title" i18n>Course Users</h4>
12 <ng-container *ngIf="isDialog()">
13 <button type="button" class="close"
14 i18n-aria-label aria-label="Close" (click)="close()">
15 <span aria-hidden="true">×</span>
19 <div [ngClass]="isDialog() ? 'modal-body' : ''">
21 <div [ngClass]="isDialog() ? 'col-md-12' : 'col-md-4'">
22 <div class="row" [ngClass]="isDialog() ? '' : 'mt-3'">
23 <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12'">
24 <div class="input-group">
25 <div class="input-group-prepend">
26 <label for="associate-user-barcode" class="input-group-text" i18n>Patron Barcode</label>
28 <input type="text" class="flex-grow-1" id="associate-user-barcode"
29 [(ngModel)]="userBarcode" (click)="$event.target.select()"
30 [disabled]="currentCourse && currentCourse.is_archived() == 't'"
31 (keyup.enter)="associateUser(userBarcode)" />
34 <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
35 <div class="input-group">
36 <div class="input-group-prepend">
37 <label for="associate-user-role" class="input-group-text" i18n>Role</label>
39 <input type="text" [(ngModel)]="userRoleInput" id="associate-user-role"
40 [disabled]="currentCourse && currentCourse.is_archived() == 't'"
41 placeholder-i18n placeholder="e.g. Student, TA, Instructor..."
42 class="flex-grow-1" />
46 <div class="row mt-3">
47 <div [ngClass]="isDialog() ? 'offset-md-6 col-md-4' : 'col-md-6'">
48 <div class="input-group">
49 <div class="input-group-prepend">
50 <div class="input-group-text">
51 <label for="associate-user-public" i18n>Is Public Role?</label>
54 <div class="input-group-append">
55 <div class="input-group-text">
56 <input type="checkbox" [(ngModel)]="isPublicRole" id="associate-user-public"
57 [disabled]="currentCourse && currentCourse.is_archived() == 't'"
58 aria-label="Checkbox for allowing user to display on the OPAC Course Page" />
63 <div class="text-right" [ngClass]="isDialog() ? 'col-md-2' : 'col-md-6'">
64 <button class="btn btn-primary"
65 [disabled]="currentCourse && currentCourse.is_archived() == 't'"
66 i18n [disabled]="!userBarcode" (click)="associateUser(userBarcode)">
72 <div class="mt-3" [ngClass]="isDialog() ? 'col-md-12' : 'col-md-8'">
73 <eg-grid #usersGrid [dataSource]="usersDataSource" [useLocalSort]="true">
74 <eg-grid-toolbar-action label="Remove Selected" i18n-label (onClick)="deleteSelectedUsers($event)">
75 </eg-grid-toolbar-action>
76 <eg-grid-toolbar-action label="Edit Selected" i18n-label (onClick)="editSelectedUsers($event)">
77 </eg-grid-toolbar-action>
78 <eg-grid-column label="User ID" path="usr.id" [index]=true [hidden]="true" i18n-label></eg-grid-column>
79 <eg-grid-column label="First Name" path="usr.first_given_name" i18n-label></eg-grid-column>
80 <eg-grid-column label="Second Name" path="usr.second_given_name" i18n-label></eg-grid-column>
81 <eg-grid-column label="Last Name" path="usr.family_name" i18n-label></eg-grid-column>
82 <eg-grid-column label="Prefix" path="usr.pref_prefix" [hidden]="true" i18n-label></eg-grid-column>
83 <eg-grid-column label="Preferred First Name" path="usr.pref_first_given_name"[hidden]="true" i18n-label></eg-grid-column>
84 <eg-grid-column label="Preferred Second Name" path="usr.pref_second_given_name"[hidden]="true" i18n-label></eg-grid-column>
85 <eg-grid-column label="Preferred Family Name" path="usr.pref_family_name"[hidden]="true" i18n-label></eg-grid-column>
86 <eg-grid-column label="Preferred Suffix" path="usr.pref_suffix" [hidden]="true" i18n-label></eg-grid-column>
87 <eg-grid-column label="User Role" path="usr_role" i18n-label></eg-grid-column>
88 <eg-grid-column label="Viewable on OPAC" path="is_public" i18n-label datatype="bool"></eg-grid-column>
95 <ng-container *ngIf="!isDialog()">
96 <!-- in "inline" mode, render the grid pane right here -->
97 <ng-container *ngTemplateOutlet="dialogContent">
101 <eg-fm-record-editor #editDialog
103 [fieldOptions]="{course: {linkedSearchField: 'course_number'}}"
104 [preloadLinkedValues]="true"
105 hiddenFields="id,usr">
106 </eg-fm-record-editor>