68f7fade5f4236683de6a397ef68309f7497c29f
[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" 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.group && !action.isGroup">
49           <!-- grouped entries are indented -->
50           <span class="ml-4">{{action.label}}</span>
51         </ng-container>
52         <ng-container *ngIf="!action.group && !action.isGroup">
53           <span class="ml-2">{{action.label}}</span>
54         </ng-container>
55       </button>
56     </div>
57   </div>
58
59   <ng-container *ngIf="!gridContext.disablePaging">
60
61   <button [disabled]="gridContext.pager.isFirstPage()" type="button"
62     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toFirst()">
63     <span title="First Page" i18n-title
64         class="material-icons mat-icon-in-button">first_page</span>
65   </button>
66   <button [disabled]="gridContext.pager.isFirstPage()" type="button"
67     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.decrement()">
68     <span title="Previous Page" i18n-title
69         class="material-icons mat-icon-in-button">keyboard_arrow_left</span>
70   </button>
71   <button [disabled]="gridContext.pager.isLastPage()" type="button"
72     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.increment()">
73     <span title="Next Page" i18n-title
74         class="material-icons mat-icon-in-button">keyboard_arrow_right</span>
75   </button>
76   <div ngbDropdown class="mr-1" placement="bottom-right">
77     <button ngbDropdownToggle class="btn btn-outline-dark text-button">
78       <span title="Select Row Count" i18n-title i18n>
79         Rows {{gridContext.pager.limit}}
80       </span>
81     </button>
82     <div class="dropdown-menu" ngbDropdownMenu>
83       <a class="dropdown-item"
84         *ngFor="let count of [5, 10, 25, 50, 100]"
85         (click)="gridContext.pager.setLimit(count)">
86         <span class="ml-2">{{count}}</span>
87       </a>
88     </div>
89   </div>
90   
91   </ng-container><!-- if disablePaging-->
92
93
94   <button type="button"
95     class="btn btn-outline-dark mr-1"
96     (click)="gridContext.overflowCells=!gridContext.overflowCells">
97     <span *ngIf="!gridContext.overflowCells"
98       title="Expand Cells Vertically" i18n-title
99       class="material-icons mat-icon-in-button">expand_more</span>
100     <span *ngIf="gridContext.overflowCells"
101       title="Collaps Cells Vertically" i18n-title
102       class="material-icons mat-icon-in-button">expand_less</span>
103   </button>
104
105   <eg-grid-column-config #columnConfDialog [columnSet]="gridContext.columnSet">
106   </eg-grid-column-config>
107   <div ngbDropdown placement="bottom-right">
108     <button ngbDropdownToggle class="btn btn-outline-dark no-dropdown-caret">
109       <span title="Show Grid Options" i18n-title
110         class="material-icons mat-icon-in-button">settings</span>
111     </button>
112     <div class="dropdown-menu" ngbDropdownMenu>
113       <a class="dropdown-item label-with-material-icon"
114         (click)="columnConfDialog.open({size:'lg'})">
115         <span class="material-icons">build</span>
116         <span class="ml-2" i18n>Manage Columns</span>
117       </a>
118       <a class="dropdown-item label-with-material-icon"
119         (click)="colWidthConfig.isVisible = !colWidthConfig.isVisible">
120         <span class="material-icons">compare_arrows</span>
121         <span class="ml-2" i18n>Manage Column Widths</span>
122       </a>
123       <a class="dropdown-item label-with-material-icon"
124         (click)="saveGridConfig()">
125         <span class="material-icons">save</span>
126         <span class="ml-2" i18n>Save Grid Settings</span>
127       </a>
128       <a class="dropdown-item label-with-material-icon"
129         (click)="gridContext.columnSet.reset()">
130         <span class="material-icons">restore</span>
131         <span class="ml-2" i18n>Reset Columns</span>
132       </a>
133       <a class="dropdown-item label-with-material-icon"
134         (click)="generateCsvExportUrl($event)"
135         [download]="csvExportFileName"
136         [href]="csvExportUrl">
137         <span class="material-icons">cloud_download</span>
138         <span class="ml-2" i18n>Download Full CSV</span>
139       </a>
140       <a class="dropdown-item label-with-material-icon" (click)="printHtml()">
141         <span class="material-icons">print</span>
142         <span class="ml-2" i18n>Print Full Grid</span>
143       </a>
144
145       <div class="dropdown-divider"></div>
146
147       <a class="dropdown-item label-with-material-icon"
148         (click)="col.visible=!col.visible" *ngFor="let col of gridContext.columnSet.columns">
149         <span *ngIf="col.visible" class="badge badge-success">&#x2713;</span>
150         <span *ngIf="!col.visible" class="badge badge-warning">&#x2717;</span>
151         <span class="ml-2">{{col.label}}</span>
152       </a>
153
154     </div>
155   </div>
156
157 <div>
158
159
160