Forward-port 3.2.3 upgrade script
[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)="btn.action()">
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             (click)="cb.onChange($event.target.checked)"/>
22             {{cb.label}}
23         </label>
24       </ng-container>
25     </div>
26   </div>
27
28   <!-- push everything else to the right -->
29   <div class="flex-1"></div>
30
31   <div ngbDropdown class="mr-1" placement="bottom-right">
32     <button ngbDropdownToggle [disabled]="!gridContext.toolbarActions.length"
33         class="btn btn-outline-dark no-dropdown-caret">
34       <span title="Actions For Selected Rows" i18n-title 
35         class="material-icons mat-icon-in-button">playlist_add_check</span>
36     </button>
37     <div class="dropdown-menu" ngbDropdownMenu>
38       <a class="dropdown-item" (click)="performAction(action)"
39         *ngFor="let action of gridContext.toolbarActions">
40         <span class="ml-2">{{action.label}}</span>
41       </a>
42     </div>
43   </div>
44
45   <button [disabled]="gridContext.pager.isFirstPage()" type="button" 
46     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toFirst()">
47     <span title="First Page" i18n-title 
48         class="material-icons mat-icon-in-button">first_page</span>
49   </button>
50   <button [disabled]="gridContext.pager.isFirstPage()" type="button" 
51     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.decrement()">
52     <span title="Previous Page" i18n-title 
53         class="material-icons mat-icon-in-button">keyboard_arrow_left</span>
54   </button>
55   <button [disabled]="gridContext.pager.isLastPage()" type="button" 
56     class="btn btn-outline-dark mr-1" (click)="gridContext.pager.increment()">
57     <span title="Next Page" i18n-title 
58         class="material-icons mat-icon-in-button">keyboard_arrow_right</span>
59   </button>
60
61   <!--
62   Hiding jump-to-last since there's no analog in the angularjs grid and
63   it has limited value since the size of the data set is often unknown.
64   <button [disabled]="!gridContext.pager.resultCount || gridContext.pager.isLastPage()" 
65     type="button" class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toLast()">
66     <span title="First Page" i18n-title 
67         class="material-icons mat-icon-in-button">last_page</span>
68   </button>
69   -->
70
71   <div ngbDropdown class="mr-1" placement="bottom-right">
72     <button ngbDropdownToggle class="btn btn-outline-dark text-button">
73       <span title="Select Row Count" i18n-title i18n>
74         Rows {{gridContext.pager.limit}}
75       </span>
76     </button>
77     <div class="dropdown-menu" ngbDropdownMenu>
78       <a class="dropdown-item" 
79         *ngFor="let count of [5, 10, 25, 50, 100]"
80         (click)="gridContext.pager.setLimit(count)">
81         <span class="ml-2">{{count}}</span>
82       </a>
83     </div>
84   </div>
85
86   <button type="button" 
87     class="btn btn-outline-dark mr-1" 
88     (click)="gridContext.overflowCells=!gridContext.overflowCells">
89     <span *ngIf="!gridContext.overflowCells"
90       title="Expand Cells Vertically" i18n-title 
91       class="material-icons mat-icon-in-button">expand_more</span>
92     <span *ngIf="gridContext.overflowCells"
93       title="Collaps Cells Vertically" i18n-title 
94       class="material-icons mat-icon-in-button">expand_less</span>
95   </button>
96
97   <eg-grid-column-config #columnConfDialog [columnSet]="gridContext.columnSet">
98   </eg-grid-column-config>
99   <div ngbDropdown placement="bottom-right">
100     <button ngbDropdownToggle class="btn btn-outline-dark no-dropdown-caret">
101       <span title="Show Grid Options" i18n-title 
102         class="material-icons mat-icon-in-button">settings</span>
103     </button>
104     <div class="dropdown-menu" ngbDropdownMenu>
105       <a class="dropdown-item label-with-material-icon" 
106         (click)="columnConfDialog.open({size:'lg'})">
107         <span class="material-icons">build</span>
108         <span class="ml-2" i18n>Manage Columns</span>
109       </a>
110       <a class="dropdown-item label-with-material-icon" 
111         (click)="colWidthConfig.isVisible = !colWidthConfig.isVisible">
112         <span class="material-icons">compare_arrows</span>
113         <span class="ml-2" i18n>Manage Column Widths</span>
114       </a>
115       <a class="dropdown-item label-with-material-icon" 
116         (click)="saveGridConfig()">
117         <span class="material-icons">save</span>
118         <span class="ml-2" i18n>Save Grid Settings</span>
119       </a>
120       <a class="dropdown-item label-with-material-icon" 
121         (click)="gridContext.columnSet.reset()">
122         <span class="material-icons">restore</span>
123         <span class="ml-2" i18n>Reset Columns</span>
124       </a>
125       <a class="dropdown-item label-with-material-icon" 
126         (click)="generateCsvExportUrl($event)"
127         [download]="csvExportFileName"
128         [href]="csvExportUrl">
129         <span class="material-icons">cloud_download</span>
130         <span class="ml-2" i18n>Download Full CSV</span>
131       </a>
132       <a class="dropdown-item label-with-material-icon" (click)="printHtml()">
133         <span class="material-icons">print</span>
134         <span class="ml-2" i18n>Print Full Grid</span>
135       </a>
136
137       <div class="dropdown-divider"></div>
138
139       <a class="dropdown-item label-with-material-icon" 
140         (click)="col.visible=!col.visible" *ngFor="let col of gridContext.columnSet.columns">
141         <span *ngIf="col.visible" class="badge badge-success">&#x2713;</span>
142         <span *ngIf="!col.visible" class="badge badge-warning">&#x2717;</span>
143         <span class="ml-2">{{col.label}}</span>
144       </a>
145
146     </div>
147   </div>
148
149 <div>
150
151
152