a5aa235400eafd1b07e592669867a1e8ea453689
[working/Evergreen.git] / Open-ILS / src / eg2 / src / app / share / grid / grid-toolbar.component.html
1
2 <div class="eg-grid-toolbar mb-2">
3
4   <div class="btn-toolbar">
5
6     <!-- buttons -->
7     <div class="btn-grp" *ngIf="gridContext.toolbarButtons.length">
8       <button *ngFor="let btn of gridContext.toolbarButtons"
9         [disabled]="btn.disabled"
10         class="btn btn-outline-dark mr-1" (click)="performButtonAction(btn)">
11         {{btn.label}}
12       </button>
13     </div>
14
15     <!-- checkboxes -->
16     <div class="form-check form-check-inline"
17       *ngIf="gridContext.toolbarCheckboxes.length">
18       <ng-container *ngFor="let cb of gridContext.toolbarCheckboxes">
19         <label class="form-check-label">
20           <input class="form-check-input" type="checkbox"
21             [(ngModel)]="cb.isChecked"
22             (click)="cb.onChange($event.target.checked)"/>
23             {{cb.label}}
24         </label>
25       </ng-container>
26     </div>
27   </div>
28
29   <!-- push everything else to the right -->
30   <div class="flex-1"></div>
31
32   <div class="font-sm font-italic d-flex flex-column-reverse mr-2">
33     {{gridContext.rowSelector.selected().length}} selected
34   </div>
35   <div ngbDropdown class="mr-1" placement="bottom-right">
36     <button ngbDropdownToggle [disabled]="!gridContext.toolbarActions.length"
37         class="btn btn-outline-dark no-dropdown-caret">
38       <span title="Actions For Selected Rows" i18n-title
39         class="material-icons mat-icon-in-button">playlist_add_check</span>
40     </button>
41     <div class="dropdown-menu scrollable-menu" ngbDropdownMenu>
42       <button class="dropdown-item" (click)="performAction(action)"
43         *ngFor="let action of gridContext.toolbarActions"
44         [disabled]="shouldDisableAction(action)">
45         <ng-container *ngIf="action.isGroup">
46           <span class="ml-2 font-weight-bold font-italic">{{action.label}}</span>
47         </ng-container>
48         <ng-container *ngIf="action.separator">
49           <div class="dropdown-divider"></div>
50         </ng-container>
51         <ng-container *ngIf="action.group && !action.isGroup">
52           <!-- grouped entries are indented -->
53           <span class="ml-4">{{action.label}}</span>
54         </ng-container>
55         <ng-container 
56           *ngIf="!action.group && !action.isGroup && !action.separator">
57           <span class="ml-2">{{action.label}}</span>
58         </ng-container>
59       </button>
60     </div>
61   </div>
62
63   <ng-container *ngIf="!gridContext.disablePaging">
64
65   <button [disabled]="gridContext.pager.isFirstPage()" type="button"
66     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toFirst()">
67     <span title="First Page" i18n-title
68         class="material-icons mat-icon-in-button">first_page</span>
69   </button>
70   <button [disabled]="gridContext.pager.isFirstPage()" type="button"
71     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.decrement()">
72     <span title="Previous Page" i18n-title
73         class="material-icons mat-icon-in-button">keyboard_arrow_left</span>
74   </button>
75   <button [disabled]="gridContext.pager.isLastPage()" type="button"
76     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.increment()">
77     <span title="Next Page" i18n-title
78         class="material-icons mat-icon-in-button">keyboard_arrow_right</span>
79   </button>
80   <div ngbDropdown class="mr-1" placement="bottom-right">
81     <button ngbDropdownToggle class="btn btn-outline-dark text-button">
82       <span title="Select Row Count" i18n-title i18n>
83         Rows {{gridContext.pager.limit}}
84       </span>
85     </button>
86     <div class="dropdown-menu" ngbDropdownMenu>
87       <a class="dropdown-item"
88         *ngFor="let count of [5, 10, 25, 50, 100]"
89         (click)="gridContext.pager.setLimit(count)">
90         <span class="ml-2">{{count}}</span>
91       </a>
92     </div>
93   </div>
94   
95   </ng-container><!-- if disablePaging-->
96
97
98   <button type="button"
99     class="btn btn-outline-dark mr-1"
100     (click)="gridContext.overflowCells=!gridContext.overflowCells">
101     <span *ngIf="!gridContext.overflowCells"
102       title="Expand Cells Vertically" i18n-title
103       class="material-icons mat-icon-in-button">expand_more</span>
104     <span *ngIf="gridContext.overflowCells"
105       title="Collaps Cells Vertically" i18n-title
106       class="material-icons mat-icon-in-button">expand_less</span>
107   </button>
108
109   <eg-grid-column-config #columnConfDialog [columnSet]="gridContext.columnSet">
110   </eg-grid-column-config>
111   <div ngbDropdown placement="bottom-right">
112     <button ngbDropdownToggle class="btn btn-outline-dark no-dropdown-caret">
113       <span title="Show Grid Options" i18n-title
114         class="material-icons mat-icon-in-button">settings</span>
115     </button>
116     <div class="dropdown-menu scrollable-menu" ngbDropdownMenu>
117       <a class="dropdown-item label-with-material-icon"
118         (click)="columnConfDialog.open({size:'lg'})">
119         <span class="material-icons">build</span>
120         <span class="ml-2" i18n>Manage Columns</span>
121       </a>
122       <a class="dropdown-item label-with-material-icon"
123         (click)="colWidthConfig.isVisible = !colWidthConfig.isVisible">
124         <span class="material-icons">compare_arrows</span>
125         <span class="ml-2" i18n>Manage Column Widths</span>
126       </a>
127       <a class="dropdown-item label-with-material-icon"
128         (click)="saveGridConfig()">
129         <span class="material-icons">save</span>
130         <span class="ml-2" i18n>Save Grid Settings</span>
131       </a>
132       <a class="dropdown-item label-with-material-icon"
133         (click)="gridContext.columnSet.reset()">
134         <span class="material-icons">restore</span>
135         <span class="ml-2" i18n>Reset Columns</span>
136       </a>
137       <a class="dropdown-item label-with-material-icon"
138         (click)="generateCsvExportUrl($event)"
139         [download]="csvExportFileName"
140         [href]="csvExportUrl">
141         <span class="material-icons">cloud_download</span>
142         <span class="ml-2" i18n>Download Full CSV</span>
143       </a>
144       <a class="dropdown-item label-with-material-icon" (click)="printHtml()">
145         <span class="material-icons">print</span>
146         <span class="ml-2" i18n>Print Full Grid</span>
147       </a>
148
149       <div class="dropdown-divider"></div>
150
151       <a class="dropdown-item label-with-material-icon"
152         (click)="col.visible=!col.visible" *ngFor="let col of gridContext.columnSet.columns">
153         <span *ngIf="col.visible" class="badge badge-success">&#x2713;</span>
154         <span *ngIf="!col.visible" class="badge badge-warning">&#x2717;</span>
155         <span class="ml-2">{{col.label}}</span>
156       </a>
157
158     </div>
159   </div>
160
161 <div>
162
163
164