@fleetbase/storefront-engine 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,329 +1,307 @@
1
- {{#if (and this.loadOrders.isRunning (not this.loaded))}}
2
- <div class="next-content-panel-wrapper">
3
- <div class="next-content-panel-container">
4
- <div class="next-content-panel next-content-panel-is-closed">
5
- <div class="next-content-panel-header next-content-panel-toggle next-content-panel-is-closed">
6
- <a href="javascript:;" class="next-content-panel-header-left">
7
- <span class="icon-container">
8
- <Spinner class="text-sky-400" @height="13" @width="13" />
9
- </span>
10
- <div class="next-content-panel-title-container">
11
- <div class="panel-title flex-shrink-0">
12
- <div class="flex flex-col">
13
- <span>{{this.title}}</span>
14
- </div>
15
- </div>
16
- </div>
17
- </a>
18
- </div>
19
- </div>
20
- </div>
1
+ <ContentPanel
2
+ @title={{this.title}}
3
+ @titleStatusRight={{this.orders.length}}
4
+ @titleStatuRightClass="info-status-badge"
5
+ @hideStatusDot={{true}}
6
+ @open={{this.loaded}}
7
+ @isLoading={{this.loadOrders.isRunning}}
8
+ @pad={{false}}
9
+ @wrapperClass={{@wrapperClass}}
10
+ @panelBodyClass="p-0i"
11
+ >
12
+ <div class="flex justify-end px-4 pt-2 space-x-2">
13
+ <Button @icon="refresh" @size="xs" @onClick={{perform this.loadOrders}} />
14
+ <Toggle @label="Active Orders Filter" @isToggled={{this.activeFilter}} @onToggle={{this.toggleActiveFilter}} />
21
15
  </div>
22
- {{else}}
23
- <ContentPanel
24
- @title={{this.title}}
25
- @titleStatusRight={{this.orders.length}}
26
- @titleStatuRightClass="info-status-badge"
27
- @hideStatusDot={{true}}
28
- @open={{true}}
29
- @isLoading={{this.loadOrders.isRunning}}
30
- @pad={{false}}
31
- @wrapperClass={{@wrapperClass}}
32
- >
33
- <div class="flex justify-end px-4 py-2 space-x-2">
34
- <Button @icon="refresh" @size="xs" @onClick={{perform this.loadOrders}} />
35
- <Toggle @label="Active Orders Filter" @isToggled={{this.activeFilter}} @onToggle={{this.toggleActiveFilter}} />
36
- </div>
37
- {{#if (media "isMobile")}}
38
- <div class="flex flex-col p-3 space-y-3">
39
- {{#each this.orders as |order|}}
40
- <div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
41
- <div class="flex flex-row mb-2">
42
- <div class="flex-1">
43
- <a href="javascript:;" {{on "click" (fn this.viewOrder order)}} class="text-sm font-semibold">{{order.public_id}}</a>
44
- <div class="text-xs">{{order.createdAt}}</div>
45
- <div class="text-xs">{{order.createdAgo}}</div>
46
- </div>
47
- <div class="flex-shrink-0 flex flex-col text-right">
48
- <Badge class="mb-1" @status={{order.status}} />
49
- {{#if order.meta.is_pickup}}
50
- <Badge class="mb-1" @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
51
- "storefront.component.widget.orders.pickup-order"
52
- }}</Badge>
53
- {{/if}}
54
- <div class="text-sm">{{format-currency order.meta.total order.meta.currency}}</div>
55
- </div>
16
+ {{#if (media "isMobile")}}
17
+ <div class="flex flex-col p-3 space-y-3">
18
+ {{#each this.orders as |order|}}
19
+ <div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
20
+ <div class="flex flex-row mb-2">
21
+ <div class="flex-1">
22
+ <a href="javascript:;" {{on "click" (fn this.viewOrder order)}} class="text-sm font-semibold">{{order.public_id}}</a>
23
+ <div class="text-xs">{{order.createdAt}}</div>
24
+ <div class="text-xs">{{order.createdAgo}}</div>
56
25
  </div>
57
- <div class="flex flex-col space-y-2 flex-wrap mb-2">
26
+ <div class="flex-shrink-0 flex flex-col text-right">
27
+ <Badge class="mb-1" @status={{order.status}} />
28
+ {{#if order.meta.is_pickup}}
29
+ <Badge class="mb-1" @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
30
+ "storefront.component.widget.orders.pickup-order"
31
+ }}</Badge>
32
+ {{/if}}
33
+ <div class="text-sm">{{format-currency order.meta.total order.meta.currency}}</div>
34
+ </div>
35
+ </div>
36
+ <div class="flex flex-col space-y-2 flex-wrap mb-2">
37
+ <Button
38
+ @wrapperClass="w-full"
39
+ class="btn-block w-full"
40
+ @size="xs"
41
+ @type="primary"
42
+ @icon="eye"
43
+ @text={{t "storefront.common.view"}}
44
+ @onClick={{fn this.viewOrder order}}
45
+ />
46
+ {{#unless order.meta.is_pickup}}
47
+ <Button
48
+ @wrapperClass="w-full"
49
+ class="btn-block w-full"
50
+ @size="xs"
51
+ @type="default"
52
+ @icon="id-card"
53
+ @text={{if order.has_driver_assigned (t "storefront.component.widget.orders.change-driver") (t "storefront.component.widget.orders.assign-driver")}}
54
+ @onClick={{fn this.assignDriver order}}
55
+ />
56
+ {{/unless}}
57
+ {{#if order.isFresh}}
58
+ <Button
59
+ @wrapperClass="w-full"
60
+ class="btn-block w-full"
61
+ @size="xs"
62
+ @type="success"
63
+ @iconPrefix="fas"
64
+ @icon="check"
65
+ @text={{t "storefront.component.widget.orders.accept-order"}}
66
+ @onClick={{fn this.acceptOrder order}}
67
+ />
68
+ {{/if}}
69
+ {{#if (eq order.status "started")}}
70
+ <Button
71
+ @wrapperClass="w-full"
72
+ class="btn-block w-full"
73
+ @size="xs"
74
+ @type="success"
75
+ @icon="bell-concierge"
76
+ @text={{t "storefront.component.widget.orders.mark-as-preparing"}}
77
+ @onClick={{fn this.markAsPreparing order}}
78
+ />
79
+ {{/if}}
80
+ {{#if (eq order.status "accepted")}}
58
81
  <Button
59
82
  @wrapperClass="w-full"
60
83
  class="btn-block w-full"
61
84
  @size="xs"
62
- @type="primary"
63
- @icon="eye"
64
- @text={{t "storefront.common.view"}}
65
- @onClick={{fn this.viewOrder order}}
85
+ @type={{if order.meta.is_pickup "success" "magic"}}
86
+ @icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
87
+ @text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
88
+ @onClick={{fn this.markAsReady order}}
66
89
  />
90
+ {{/if}}
91
+ {{#if order.isPickupReady}}
92
+ <Button
93
+ @wrapperClass="w-full"
94
+ class="btn-block w-full"
95
+ @size="xs"
96
+ @type="success"
97
+ @icon="check"
98
+ @text={{t "storefront.component.widget.orders.mark-as-completed"}}
99
+ @onClick={{fn this.markAsCompleted order}}
100
+ />
101
+ {{/if}}
102
+ {{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
103
+ <Button
104
+ @wrapperClass="w-full"
105
+ class="btn-block w-full"
106
+ @size="xs"
107
+ @type="danger"
108
+ @icon="ban"
109
+ @text={{t "storefront.component.widget.orders.cancel-order"}}
110
+ @onClick={{fn this.cancelOrder order}}
111
+ />
112
+ {{/if}}
113
+ </div>
114
+ <ContentPanel @title={{t "storefront.component.widget.orders.more-details"}}>
115
+ <div class="p-2 space-y-2">
67
116
  {{#unless order.meta.is_pickup}}
68
- <Button
69
- @wrapperClass="w-full"
70
- class="btn-block w-full"
71
- @size="xs"
72
- @type="default"
73
- @icon="id-card"
74
- @text={{if order.has_driver_assigned (t "storefront.component.widget.orders.change-driver") (t "storefront.component.widget.orders.assign-driver")}}
75
- @onClick={{fn this.assignDriver order}}
76
- />
77
- {{/unless}}
78
- {{#if order.isFresh}}
79
- <Button
80
- @wrapperClass="w-full"
81
- class="btn-block w-full"
82
- @size="xs"
83
- @type="success"
84
- @iconPrefix="fas"
85
- @icon="check"
86
- @text={{t "storefront.component.widget.orders.accept-order"}}
87
- @onClick={{fn this.acceptOrder order}}
88
- />
89
- {{/if}}
90
- {{#if (eq order.status "started")}}
91
- <Button
92
- @wrapperClass="w-full"
93
- class="btn-block w-full"
94
- @size="xs"
95
- @type="success"
96
- @icon="bell-concierge"
97
- @text={{t "storefront.component.widget.orders.mark-as-preparing"}}
98
- @onClick={{fn this.markAsPreparing order}}
99
- />
100
- {{/if}}
101
- {{#if (eq order.status "accepted")}}
102
- <Button
103
- @wrapperClass="w-full"
104
- class="btn-block w-full"
105
- @size="xs"
106
- @type={{if order.meta.is_pickup "success" "magic"}}
107
- @icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
108
- @text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
109
- @onClick={{fn this.markAsReady order}}
110
- />
111
- {{/if}}
112
- {{#if order.isPickupReady}}
113
- <Button
114
- @wrapperClass="w-full"
115
- class="btn-block w-full"
116
- @size="xs"
117
- @type="success"
118
- @icon="check"
119
- @text={{t "storefront.component.widget.orders.mark-as-completed"}}
120
- @onClick={{fn this.markAsCompleted order}}
121
- />
122
- {{/if}}
123
- {{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
124
- <Button
125
- @wrapperClass="w-full"
126
- class="btn-block w-full"
127
- @size="xs"
128
- @type="danger"
129
- @icon="ban"
130
- @text={{t "storefront.component.widget.orders.cancel-order"}}
131
- @onClick={{fn this.cancelOrder order}}
132
- />
133
- {{/if}}
134
- </div>
135
- <ContentPanel @title={{t "storefront.component.widget.orders.more-details"}}>
136
- <div class="p-2 space-y-2">
137
- {{#unless order.meta.is_pickup}}
138
- <div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
139
- <h5 class="dark:text-gray-100 font-semibold">{{t "storefront.component.modals.incoming-order.assigned"}}</h5>
140
- <div class="flex flex-col space-y-4">
141
- {{#if order.driver_assigned.id}}
142
- <div class="flex items-center">
143
- <Image src={{order.driver_assigned.photoUrl}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.driver_assigned.name}} />
144
- <div>
145
- <h5 class="font-semibold dark:text-white text-xs">{{n-a order.driver_assigned.displayName}}</h5>
146
- <div class="font-semibold dark:text-gray-100 text-xs">{{n-a
147
- order.driver_assigned.phone
148
- (t "storefront.component.modals.incoming-order.no-phone")
149
- }}</div>
150
- </div>
151
- </div>
152
- {{else}}
117
+ <div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
118
+ <h5 class="dark:text-gray-100 font-semibold">{{t "storefront.component.modals.incoming-order.assigned"}}</h5>
119
+ <div class="flex flex-col space-y-4">
120
+ {{#if order.driver_assigned.id}}
121
+ <div class="flex items-center">
122
+ <Image src={{order.driver_assigned.photoUrl}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.driver_assigned.name}} />
153
123
  <div>
154
- <h5 class="text-red-500 text-sm">{{t "storefront.component.modals.incoming-order.not-assigned"}}</h5>
124
+ <h5 class="font-semibold dark:text-white text-xs">{{n-a order.driver_assigned.displayName}}</h5>
125
+ <div class="font-semibold dark:text-gray-100 text-xs">{{n-a
126
+ order.driver_assigned.phone
127
+ (t "storefront.component.modals.incoming-order.no-phone")
128
+ }}</div>
155
129
  </div>
156
- {{/if}}
130
+ </div>
131
+ {{else}}
157
132
  <div>
158
- <Button
159
- @size="xs"
160
- @type="default"
161
- @icon="id-card"
162
- @text={{if
163
- order.has_driver_assigned
164
- (t "storefront.component.modals.incoming-order.change-driver")
165
- (t "storefront.component.modals.incoming-order.assign-driver")
166
- }}
167
- @onClick={{this.assignDriver order}}
168
- />
133
+ <h5 class="text-red-500 text-sm">{{t "storefront.component.modals.incoming-order.not-assigned"}}</h5>
169
134
  </div>
135
+ {{/if}}
136
+ <div>
137
+ <Button
138
+ @size="xs"
139
+ @type="default"
140
+ @icon="id-card"
141
+ @text={{if
142
+ order.has_driver_assigned
143
+ (t "storefront.component.modals.incoming-order.change-driver")
144
+ (t "storefront.component.modals.incoming-order.assign-driver")
145
+ }}
146
+ @onClick={{this.assignDriver order}}
147
+ />
170
148
  </div>
171
149
  </div>
172
- {{/unless}}
173
- <div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
174
- <h5 class="dark:text-gray-100 font-semibold">{{t "storefront.common.customer"}}</h5>
175
- <div class="">
176
- <div class="flex flex-row">
177
- <div>
178
- <Image src={{avatar-url order.customer.photo_url}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.customer.name}} />
179
- </div>
180
- <div>
181
- <div class="text-xs font-bold dark:text-gray-100">{{order.customer.name}}</div>
182
- <div class="text-xs dark:text-gray-100">{{order.customer.email}}</div>
183
- <div class="text-xs dark:text-gray-100">{{order.customer.phone}}</div>
184
- </div>
150
+ </div>
151
+ {{/unless}}
152
+ <div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
153
+ <h5 class="dark:text-gray-100 font-semibold">{{t "storefront.common.customer"}}</h5>
154
+ <div class="">
155
+ <div class="flex flex-row">
156
+ <div>
157
+ <Image src={{avatar-url order.customer.photo_url}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.customer.name}} />
185
158
  </div>
186
- {{#unless order.meta.is_pickup}}
187
- <div class="mt-2">
188
- <h5 class="dark:text-gray-100 font-semibold text-xs truncate">{{t "storefront.component.modals.incoming-order.address"}}</h5>
189
- <div class="flex flex-row mt-1">
190
- <div class="flex items-center justify-center rounded-full bg-blue-500 w-8 h-8 mr-3">
191
- <FaIcon @icon="map-marker-alt" class="text-white" />
192
- </div>
193
- <div class="truncate">
194
- <DisplayPlace @place={{order.payload.dropoff}} @type="dropoff" @addressClass="text-xs dark:text-gray-100" @noAddressClass="text-xs" />
195
- </div>
159
+ <div>
160
+ <div class="text-xs font-bold dark:text-gray-100">{{order.customer.name}}</div>
161
+ <div class="text-xs dark:text-gray-100">{{order.customer.email}}</div>
162
+ <div class="text-xs dark:text-gray-100">{{order.customer.phone}}</div>
163
+ </div>
164
+ </div>
165
+ {{#unless order.meta.is_pickup}}
166
+ <div class="mt-2">
167
+ <h5 class="dark:text-gray-100 font-semibold text-xs truncate">{{t "storefront.component.modals.incoming-order.address"}}</h5>
168
+ <div class="flex flex-row mt-1">
169
+ <div class="flex items-center justify-center rounded-full bg-blue-500 w-8 h-8 mr-3">
170
+ <FaIcon @icon="map-marker-alt" class="text-white" />
171
+ </div>
172
+ <div class="truncate">
173
+ <DisplayPlace @place={{order.payload.dropoff}} @type="dropoff" @addressClass="text-xs dark:text-gray-100" @noAddressClass="text-xs" />
196
174
  </div>
197
175
  </div>
198
- {{/unless}}
199
- </div>
176
+ </div>
177
+ {{/unless}}
200
178
  </div>
201
179
  </div>
202
- <div class="py-2 mt-2 space-y-2 border-t dark:border-gray-800">
180
+ </div>
181
+ <div class="py-2 mt-2 space-y-2 border-t dark:border-gray-800">
182
+ <div class="flex items-center justify-between px-3 text-xs">
183
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.subtotal"}}</span>
184
+ <span class="dark:text-gray-50">{{format-currency order.meta.subtotal order.meta.currency}}</span>
185
+ </div>
186
+ {{#unless order.meta.is_pickup}}
203
187
  <div class="flex items-center justify-between px-3 text-xs">
204
- <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.subtotal"}}</span>
205
- <span class="dark:text-gray-50">{{format-currency order.meta.subtotal order.meta.currency}}</span>
188
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-fee"}}</span>
189
+ <span class="dark:text-gray-50">{{format-currency order.meta.delivery_fee order.meta.currency}}</span>
206
190
  </div>
207
- {{#unless order.meta.is_pickup}}
208
- <div class="flex items-center justify-between px-3 text-xs">
209
- <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-fee"}}</span>
210
- <span class="dark:text-gray-50">{{format-currency order.meta.delivery_fee order.meta.currency}}</span>
211
- </div>
212
- {{/unless}}
213
- {{#if order.meta.tip}}
214
- <div class="flex items-center justify-between px-3 py-2 text-xs">
215
- <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.tip"}}</span>
216
- <span class="dark:text-gray-50">{{get-tip-amount order.meta.tip order.meta.subtotal order.meta.currency}}</span>
217
- </div>
218
- {{/if}}
219
- {{#if order.meta.delivery_tip}}
220
- <div class="flex items-center justify-between px-3 text-xs">
221
- <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-tip"}}</span>
222
- <span class="dark:text-gray-50">{{get-tip-amount order.meta.delivery_tip order.meta.subtotal order.meta.currency}}</span>
223
- </div>
224
- {{/if}}
191
+ {{/unless}}
192
+ {{#if order.meta.tip}}
193
+ <div class="flex items-center justify-between px-3 py-2 text-xs">
194
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.tip"}}</span>
195
+ <span class="dark:text-gray-50">{{get-tip-amount order.meta.tip order.meta.subtotal order.meta.currency}}</span>
196
+ </div>
197
+ {{/if}}
198
+ {{#if order.meta.delivery_tip}}
225
199
  <div class="flex items-center justify-between px-3 text-xs">
226
- <span class="dark:text-gray-50 font-bold">{{t "storefront.component.widget.orders.total"}}</span>
227
- <span class="dark:text-gray-50 font-bold">{{format-currency order.meta.total order.meta.currency}}</span>
200
+ <span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-tip"}}</span>
201
+ <span class="dark:text-gray-50">{{get-tip-amount order.meta.delivery_tip order.meta.subtotal order.meta.currency}}</span>
228
202
  </div>
203
+ {{/if}}
204
+ <div class="flex items-center justify-between px-3 text-xs">
205
+ <span class="dark:text-gray-50 font-bold">{{t "storefront.component.widget.orders.total"}}</span>
206
+ <span class="dark:text-gray-50 font-bold">{{format-currency order.meta.total order.meta.currency}}</span>
229
207
  </div>
230
- </ContentPanel>
231
- </div>
232
- {{/each}}
233
- </div>
234
- {{else}}
235
- <div class="table-wrapper table-fluid">
236
- <table class="storefront-widget-table">
237
- <thead>
238
- <tr class="h-12 text-left py-1">
239
- <th style={{"width: 15%"}}>{{t "storefront.component.widget.orders.id-column"}}</th>
240
- <th style={{"width: 10%"}}>{{t "storefront.common.amount"}}</th>
241
- <th style={{"width: 14%"}}>{{t "storefront.common.customer"}}</th>
242
- <th style={{"width: 14%"}}>{{t "storefront.common.driver"}}</th>
243
- <th style={{"width: 10%"}}>{{t "storefront.common.created"}}</th>
244
- <th style={{"width: 15%"}}>{{t "storefront.common.status"}}</th>
245
- <th style={{"width: 24%"}}></th>
246
- </tr>
247
- </thead>
248
- <tbody>
249
- {{#each this.orders as |order|}}
250
- <tr class="h-12">
251
- <td><a href="javascript:;" {{on "click" (fn this.viewOrder order)}}>{{order.public_id}}</a></td>
252
- <td>{{format-currency order.meta.total order.meta.currency}}</td>
253
- <td>{{n-a order.customer.name}}</td>
254
- <td>
255
- {{#if order.meta.is_pickup}}
256
- <Badge @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
257
- "storefront.component.widget.orders.pickup-order"
258
- }}</Badge>
259
- {{else}}
260
- {{n-a order.driver_assigned.name}}
261
- {{/if}}
262
- </td>
263
- <td>{{order.createdAgo}}</td>
264
- <td>
265
- <Badge @status={{order.status}} />
266
- </td>
267
- <td>
268
- <div class="flex flex-row justify-end space-x-2">
269
- {{#if order.isFresh}}
270
- <Button
271
- @size="xs"
272
- @type="success"
273
- @iconPrefix="fas"
274
- @icon="check"
275
- @text={{t "storefront.component.widget.orders.accept-order"}}
276
- @onClick={{fn this.acceptOrder order}}
277
- />
278
- {{/if}}
279
- {{#if (eq order.status "started")}}
280
- <Button
281
- @size="xs"
282
- @type="success"
283
- @icon="hourglass-start"
284
- @text={{t "storefront.component.widget.orders.mark-as-preparing"}}
285
- @onClick={{fn this.markAsPreparing order}}
286
- />
287
- {{/if}}
288
- {{#if (eq order.status "accepted")}}
289
- <Button
290
- @size="xs"
291
- @type={{if order.meta.is_pickup "success" "magic"}}
292
- @icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
293
- @text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
294
- @onClick={{fn this.markAsReady order}}
295
- />
296
- {{/if}}
297
- {{#if order.isPickupReady}}
298
- <Button
299
- @size="xs"
300
- @type="success"
301
- @icon="check"
302
- @text={{t "storefront.component.widget.orders.mark-as-completed"}}
303
- @onClick={{fn this.markAsCompleted order}}
304
- />
305
- {{/if}}
306
- {{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
307
- <Button
308
- @size="xs"
309
- @type="danger"
310
- @icon="ban"
311
- @helpText={{t "storefront.component.widget.orders.cancel-order"}}
312
- @onClick={{fn this.cancelOrder order}}
313
- />
314
- {{/if}}
315
- </div>
316
- </td>
317
- </tr>
318
- {{/each}}
319
-
208
+ </div>
209
+ </ContentPanel>
210
+ </div>
211
+ {{/each}}
212
+ </div>
213
+ {{else}}
214
+ <div class="table-wrapper table-fluid">
215
+ <table class="storefront-widget-table">
216
+ <thead>
217
+ <tr class="h-12 text-left py-1">
218
+ <th style={{"width: 15%"}}>{{t "storefront.component.widget.orders.id-column"}}</th>
219
+ <th style={{"width: 10%"}}>{{t "storefront.common.amount"}}</th>
220
+ <th style={{"width: 14%"}}>{{t "storefront.common.customer"}}</th>
221
+ <th style={{"width: 14%"}}>{{t "storefront.common.driver"}}</th>
222
+ <th style={{"width: 10%"}}>{{t "storefront.common.created"}}</th>
223
+ <th style={{"width: 15%"}}>{{t "storefront.common.status"}}</th>
224
+ <th style={{"width: 24%"}}></th>
225
+ </tr>
226
+ </thead>
227
+ <tbody>
228
+ {{#each this.orders as |order|}}
320
229
  <tr class="h-12">
321
- <td><div class="font-semibold text-green-500">TOTAL</div></td>
322
- <td colspan="6"><div class="flex justify-start text-green-500 font-semibold">{{format-currency this.total this.currency}}</div></td>
230
+ <td><a href="javascript:;" {{on "click" (fn this.viewOrder order)}}>{{order.public_id}}</a></td>
231
+ <td>{{format-currency order.meta.total order.meta.currency}}</td>
232
+ <td>{{n-a order.customer.name}}</td>
233
+ <td>
234
+ {{#if order.meta.is_pickup}}
235
+ <Badge @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
236
+ "storefront.component.widget.orders.pickup-order"
237
+ }}</Badge>
238
+ {{else}}
239
+ {{n-a order.driver_assigned.name}}
240
+ {{/if}}
241
+ </td>
242
+ <td>{{order.createdAgo}}</td>
243
+ <td>
244
+ <Badge @status={{order.status}} />
245
+ </td>
246
+ <td>
247
+ <div class="flex flex-row justify-end space-x-2">
248
+ {{#if order.isFresh}}
249
+ <Button
250
+ @size="xs"
251
+ @type="success"
252
+ @iconPrefix="fas"
253
+ @icon="check"
254
+ @text={{t "storefront.component.widget.orders.accept-order"}}
255
+ @onClick={{fn this.acceptOrder order}}
256
+ />
257
+ {{/if}}
258
+ {{#if (eq order.status "started")}}
259
+ <Button
260
+ @size="xs"
261
+ @type="success"
262
+ @icon="hourglass-start"
263
+ @text={{t "storefront.component.widget.orders.mark-as-preparing"}}
264
+ @onClick={{fn this.markAsPreparing order}}
265
+ />
266
+ {{/if}}
267
+ {{#if (eq order.status "accepted")}}
268
+ <Button
269
+ @size="xs"
270
+ @type={{if order.meta.is_pickup "success" "magic"}}
271
+ @icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
272
+ @text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
273
+ @onClick={{fn this.markAsReady order}}
274
+ />
275
+ {{/if}}
276
+ {{#if order.isPickupReady}}
277
+ <Button
278
+ @size="xs"
279
+ @type="success"
280
+ @icon="check"
281
+ @text={{t "storefront.component.widget.orders.mark-as-completed"}}
282
+ @onClick={{fn this.markAsCompleted order}}
283
+ />
284
+ {{/if}}
285
+ {{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
286
+ <Button
287
+ @size="xs"
288
+ @type="danger"
289
+ @icon="ban"
290
+ @helpText={{t "storefront.component.widget.orders.cancel-order"}}
291
+ @onClick={{fn this.cancelOrder order}}
292
+ />
293
+ {{/if}}
294
+ </div>
295
+ </td>
323
296
  </tr>
324
- </tbody>
325
- </table>
326
- </div>
327
- {{/if}}
328
- </ContentPanel>
329
- {{/if}}
297
+ {{/each}}
298
+
299
+ <tr class="h-12">
300
+ <td><div class="font-semibold text-green-500">TOTAL</div></td>
301
+ <td colspan="6"><div class="flex justify-start text-green-500 font-semibold">{{format-currency this.total this.currency}}</div></td>
302
+ </tr>
303
+ </tbody>
304
+ </table>
305
+ </div>
306
+ {{/if}}
307
+ </ContentPanel>