Skip to content

Commit 6790fcd

Browse files
Merge pull request #28 from killbill/518-sorting-fix
Enhance plugins table: enable ordering and define column orderability
2 parents f24e9a0 + 48b1b83 commit 6790fcd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

app/assets/stylesheets/kpm/kpm.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,12 @@
391391

392392
.kpm-plugins-index table th {
393393
padding: 0.375rem 0.75rem !important;
394+
padding-right: 2rem !important;
394395
font-weight: 500;
395396
font-size: 0.875rem;
396397
color: #717680;
397398
text-transform: capitalize;
399+
position: relative;
398400
}
399401

400402
.kpm-plugins-index table td {
@@ -405,8 +407,8 @@
405407
text-transform: capitalize !important;
406408
}
407409

408-
.kpm-plugins-index table thead tr th::after,
409-
.kpm-plugins-index table thead tr th::before {
410+
.kpm-plugins-index table thead tr th:not(:last-child)::after,
411+
.kpm-plugins-index table thead tr th:not(:last-child)::before {
410412
content: "" !important;
411413
display: inline-block !important;
412414
width: 0.75rem !important;
@@ -415,16 +417,16 @@
415417
background-position: center !important;
416418
background-size: 0.75rem 0.75rem !important;
417419
position: absolute !important;
418-
right: 0.5rem !important;
420+
left: 4rem !important;
419421
}
420422

421-
.kpm-plugins-index table thead tr th::after {
423+
.kpm-plugins-index table thead tr th:not(:last-child)::after {
422424
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 5.5L6 2.5L9 5.5' stroke='%23A4A7AE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
423425
top: 45% !important;
424426
transform: translateY(-50%) !important;
425427
}
426428

427-
.kpm-plugins-index table thead tr th::before {
429+
.kpm-plugins-index table thead tr th:not(:last-child)::before {
428430
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 6.5L6 9.5L9 6.5' stroke='%23A4A7AE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
429431
bottom: 45% !important;
430432
transform: translateY(50%) !important;

app/views/kpm/plugins/_plugins_table.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
$('#plugins-table').dataTable({
2727
"dom": "t",
2828
"paging": false,
29-
"ordering": false
29+
"ordering": true,
30+
"columnDefs": [
31+
{ "orderable": true, "targets": [0, 1] },
32+
{ "orderable": false, "targets": [2] }
33+
]
3034
});
3135
});
3236
<% end %>

0 commit comments

Comments
 (0)