@@ -49,10 +49,68 @@ class="primary-button"
49
49
{!! view_render_event (' krayin.admin.mail.' . request (' route' ). ' .datagrid.before' ) ! !}
50
50
51
51
<!-- DataGrid -->
52
- < x- admin:: datagrid
52
+ <!-- DataGrid -->
53
+ < x- admin:: datagrid
53
54
ref= " datagrid"
54
55
src= " {{ route (' admin.mail.index' , request (' route' )) } }"
55
- / >
56
+ >
57
+ < template #body= " {
58
+ isLoading,
59
+ available,
60
+ applied,
61
+ selectAll,
62
+ sort,
63
+ performAction
64
+ }" >
65
+ < template v- if = " isLoading" >
66
+ < x- admin:: shimmer .datagrid .table .body / >
67
+ < / template>
68
+
69
+ < template v- else >
70
+ < div
71
+ v- for = " record in available.records"
72
+ class = " row grid items-center gap-2.5 border-b px-4 py-4 text-gray-600 transition-all hover:bg-gray-50 dark:border-gray-800 dark:text-gray-300 dark:hover:bg-gray-950"
73
+ : style= " `grid-template-columns: repeat(${gridsCount}, minmax(0, 1fr))`"
74
+ >
75
+ <!-- Group ID -->
76
+ < p> @ {{ record .id }}< / p>
77
+
78
+ <!-- Attachments -->
79
+ < p : class = " record.attachments ? 'icon-attachmetent' : ''" >
80
+ @ {{ record .attachments ?? ' N/A' }}
81
+ < / p>
82
+
83
+ <!-- Name -->
84
+ < p> @ {{ record .name }}< / p>
85
+
86
+ <!-- Subject -->
87
+ < p v- html= " record.subject" >< / p>
88
+
89
+ <!-- Created At -->
90
+ < p v- html= " record.created_at" >< / p>
91
+
92
+ <!-- Actions -->
93
+ < div class = " flex justify-end" >
94
+ < a @click = " selectedMail=true; editModal(record.actions.find(action => action.index === 'edit'))" >
95
+ < span
96
+ : class = " record.actions.find(action => action.index === 'edit')?.icon"
97
+ class = " cursor-pointer rounded-md p-1.5 text-2xl transition-all hover:bg-gray-200 dark:hover:bg-gray-800 max-sm:place-self-center"
98
+ >
99
+ < / span>
100
+ < / a>
101
+
102
+ < a @click = " performAction(record.actions.find(action => action.index === 'delete'))" >
103
+ < span
104
+ : class = " record.actions.find(action => action.index === 'delete')?.icon"
105
+ class = " cursor-pointer rounded-md p-1.5 text-2xl transition-all hover:bg-gray-200 dark:hover:bg-gray-800 max-sm:place-self-center"
106
+ >
107
+ < / span>
108
+ < / a>
109
+ < / div>
110
+ < / div>
111
+ < / template>
112
+ < / template>
113
+ < / x- admin:: datagrid>
56
114
57
115
{!! view_render_event (' krayin.admin.mail.' . request (' route' ). ' .datagrid.after' ) ! !}
58
116
@@ -268,6 +326,22 @@ class="primary-button"
268
326
};
269
327
},
270
328
329
+ computed: {
330
+ gridsCount () {
331
+ let count = this .$refs .datagrid .available .columns .length ;
332
+
333
+ if (this .$refs .datagrid .available .actions .length ) {
334
+ ++ count;
335
+ }
336
+
337
+ if (this .$refs .datagrid .available .massActions .length ) {
338
+ ++ count;
339
+ }
340
+
341
+ return count;
342
+ },
343
+ },
344
+
271
345
methods: {
272
346
toggleModal () {
273
347
this .$refs .toggleComposeModal .toggle ();
0 commit comments