-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix several issues with Datatables (#3750)
This addresses several issues for the styling of Datatables Closes #3745 ## Styling The PR introduces a few custom CSS styles, overwriting some of the styles found in the bootstrap-4 extension of Datatables. ## Leaderboard The `dom` option is deprecated in Datatables. It had to be updated anyway to account for the new styling. This PR uses the new `layout` option in Datatables to set things up in a future-proof manner. There are four states, as shown below. #### Regular ![image](https://github.com/user-attachments/assets/7657b044-1b5d-4f87-97bc-042a3fc77fc9) #### Date & Additional Metrics ![image](https://github.com/user-attachments/assets/ce2f7ab3-b8e4-4823-a864-cfaf0fca4f4b) #### Date ![image](https://github.com/user-attachments/assets/65494f38-6651-40fa-85dc-d518a35da5c0) #### Additional Metrics ![image](https://github.com/user-attachments/assets/67774a01-80a9-4863-8b35-aa710c8332a4) ### Other It also consolidates a few common settings in Datatables: - Adds a default via-html-element-class selectable `"nonSortable"` column, employing it in one additional location. - Sets the default paging size to 50 (most common). - Sets the default type to `"string"` of client-side datatables, which indicates: do not transform content when searching/ordering. Also prevents unexpected styles from being applied because of 'automagically' detected content types.
- Loading branch information
1 parent
9ce088a
commit 1739b40
Showing
29 changed files
with
109 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 4 additions & 8 deletions
12
app/grandchallenge/challenges/static/js/challenges/challenge_costs_overview.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
document.addEventListener("DOMContentLoaded", event => { | ||
$("#challengeCostsOverviewTable").DataTable({ | ||
order: [[2, "desc"]], | ||
order: [ | ||
[2, "desc"], | ||
[3, "desc"], | ||
], | ||
lengthChange: false, | ||
pageLength: 100, | ||
columnDefs: [ | ||
{ | ||
targets: "datatables-non-sortable", | ||
searchable: false, | ||
orderable: false, | ||
}, | ||
], | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
.dt-layout-start, | ||
.dt-layout-end { | ||
padding-top: $spacer * 0.5; | ||
padding-bottom: $spacer * 0.5; | ||
} | ||
|
||
.dt-container ul.pagination { | ||
justify-content: right; | ||
} | ||
|
||
.dt-layout-full, | ||
.dt-layout-start, | ||
.dt-layout-end { | ||
padding-left: 0 !important; | ||
padding-right: 0 !important; | ||
} | ||
|
||
.dt-scroll-body { | ||
border-bottom: none !important; | ||
} | ||
|
||
.dt-orderable-none .dt-column-order { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
$(document).ready(() => { | ||
$("table.sortable").dataTable({ | ||
bJQueryUI: false, | ||
sPaginationType: "full_numbers", | ||
bPaginate: false, | ||
bLengthChange: false, | ||
bFilter: false, | ||
bInfo: false, | ||
bAutoWidth: false, | ||
paginate: false, | ||
lengthChange: false, | ||
filter: false, | ||
info: false, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 1 addition & 9 deletions
10
app/grandchallenge/evaluation/static/js/evaluation/groundtruths_table.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
$(document).ready(() => { | ||
$("#groundtruthsTable").DataTable({ | ||
columnDefs: [ | ||
{ | ||
targets: "nonSortable", | ||
searchable: false, | ||
orderable: false, | ||
}, | ||
], | ||
}); | ||
$("#groundtruthsTable").DataTable(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 1 addition & 9 deletions
10
app/grandchallenge/evaluation/static/js/evaluation/methods_table.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
$(document).ready(() => { | ||
$("#methodsTable").DataTable({ | ||
columnDefs: [ | ||
{ | ||
targets: "nonSortable", | ||
searchable: false, | ||
orderable: false, | ||
}, | ||
], | ||
}); | ||
$("#methodsTable").DataTable(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
$(document).ready(() => { | ||
$("#pagesTable").DataTable({ | ||
pageLength: 10, | ||
columnDefs: [ | ||
{ | ||
targets: [4, 5], | ||
searchable: false, | ||
orderable: false, | ||
}, | ||
], | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
app/grandchallenge/participants/static/participants/js/user_list.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
$(document).ready(() => { | ||
$("#usersTable").DataTable({ | ||
pageLength: 10, | ||
columnDefs: [ | ||
{ | ||
targets: [-1], | ||
searchable: false, | ||
orderable: false, | ||
}, | ||
], | ||
}); | ||
}); |
Oops, something went wrong.