]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/admin/local/course-reserves/course-associate-users.component.html
LP1972928: Show course user role dropdown choices without typing
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / admin / local / course-reserves / course-associate-users.component.html
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>
7
8 <eg-patron-search-dialog #patronSearch>
9 </eg-patron-search-dialog>
10
11 <ng-template #dialogContent>
12 <div class="modal-header bg-info"
13   [ngClass]="isDialog() ? 'modal-header' : 'alert mt-3'">
14   <h4 class="modal-title" i18n>Course Users</h4>
15   <ng-container *ngIf="isDialog()">
16   <button type="button" class="close"
17     i18n-aria-label aria-label="Close" (click)="close()">
18     <span aria-hidden="true">&times;</span>
19   </button>
20   </ng-container>
21 </div>
22 <div [ngClass]="isDialog() ? 'modal-body' : ''">
23   <div class="row">
24     <div [ngClass]="isDialog() ? 'col-md-12' : 'col-md-4'">
25       <div class="row" [ngClass]="isDialog() ? '' : 'mt-3'">
26         <div class="d-flex"  [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12'">
27           <div class="input-group">
28             <div class="input-group-prepend">
29               <label for="associate-user-barcode" class="input-group-text" i18n>Patron Barcode</label>
30             </div>
31             <input type="text" class="flex-grow-1" id="associate-user-barcode"
32               [(ngModel)]="userBarcode" (click)="$event.target.select()"
33               [disabled]="currentCourse && (courseIsArchived || currentCourse.is_archived()) === 't'"
34               />
35             <button class="btn btn-outline-dark btn-sm" (click)="searchPatrons()">
36               <span class="material-icons mat-icon-in-button align-middle"
37               i18n-title title="Search for Patron">search</span>
38               <span class="align-middle" i18n>Search for Patron</span>
39             </button>
40           </div>
41         </div>
42         <div class="d-flex" [ngClass]="isDialog() ? 'col-md-6' : 'col-md-12 mt-3'">
43           <div class="input-group">
44             <div class="input-group-prepend">
45               <label for="associate-user-role" class="input-group-text" i18n>Role</label>
46             </div>
47             <eg-combobox idlClass="acmr" [(ngModel)]="userRoleInput"
48             [asyncSupportsEmptyTermClick]="true"
49             [disabled]="currentCourse && (courseIsArchived || currentCourse.is_archived()) === 't'">
50             </eg-combobox>
51           </div>
52         </div>
53       </div>
54       <div class="row mt-3">
55         <div class="text-right" [ngClass]="isDialog() ? 'col-md-2' : 'col-md-6'">
56           <button class="btn btn-primary"
57             [disabled]="currentCourse && (courseIsArchived || currentCourse.is_archived()) === 't'"
58             i18n [disabled]="!userBarcode" (click)="associateUser(userBarcode)">
59             Add User
60           </button>
61         </div>
62       </div>
63     </div>
64     <div class="mt-3" [ngClass]="isDialog() ? 'col-md-12' : 'col-md-8'">
65       <eg-grid #usersGrid [dataSource]="usersDataSource" [useLocalSort]="true">
66         <eg-grid-toolbar-action label="Remove Selected" i18n-label (onClick)="deleteSelectedUsers($event)">
67         </eg-grid-toolbar-action>
68         <eg-grid-toolbar-action label="Edit Selected" i18n-label (onClick)="editSelectedUsers($event)">
69         </eg-grid-toolbar-action>
70         <eg-grid-column label="User ID" path="usr.id" [index]=true [hidden]="true" i18n-label></eg-grid-column>
71         <eg-grid-column label="First Name" path="usr.first_given_name" i18n-label></eg-grid-column>
72         <eg-grid-column label="Second Name" path="usr.second_given_name" i18n-label></eg-grid-column>
73         <eg-grid-column label="Last Name" path="usr.family_name" i18n-label></eg-grid-column>
74         <eg-grid-column label="Prefix" path="usr.pref_prefix" [hidden]="true" i18n-label></eg-grid-column>
75         <eg-grid-column label="Preferred First Name" path="usr.pref_first_given_name"[hidden]="true"  i18n-label></eg-grid-column>
76         <eg-grid-column label="Preferred Second Name" path="usr.pref_second_given_name"[hidden]="true"  i18n-label></eg-grid-column>
77         <eg-grid-column label="Preferred Family Name" path="usr.pref_family_name"[hidden]="true"  i18n-label></eg-grid-column>
78         <eg-grid-column label="Preferred Suffix" path="usr.pref_suffix" [hidden]="true" i18n-label></eg-grid-column>
79         <eg-grid-column label="User Role" path="usr_role.name" i18n-label></eg-grid-column>
80         <eg-grid-column label="Viewable on OPAC" path="usr_role.is_public" i18n-label datatype="bool"></eg-grid-column>
81       </eg-grid>
82     </div>
83   </div>
84 </div>
85 </ng-template>
86
87 <ng-container *ngIf="!isDialog()">
88   <!-- in "inline" mode, render the grid pane right here -->
89   <ng-container *ngTemplateOutlet="dialogContent">
90   </ng-container>
91 </ng-container>
92
93 <eg-fm-record-editor #editDialog
94   idlClass='acmcu'
95   [fieldOptions]="{course: {linkedSearchField: 'course_number'}}"
96   [preloadLinkedValues]="true"
97   hiddenFields="id,usr">
98 </eg-fm-record-editor>