-
Notifications
You must be signed in to change notification settings - Fork 27
Improve video table sorting #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -263,7 +263,9 @@ public function create_videos_tables($id, $headers, $columns, $baseurl) { | |
| $table->no_sorting('published'); | ||
| $table->no_sorting('visibility'); // This column cannot be sortable because it does not mean anything to Opencast! | ||
| $table->no_sorting('select'); | ||
| $table->sortable(true, 'start_date', SORT_DESC); | ||
| $table->text_sorting('title'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we initiating the sort with |
||
| $table->sortable(true, null, SORT_DESC); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to restore |
||
| $table->maxsortkeys = 1; | ||
|
|
||
| $table->column_style('selectall', 'max-width', '40px'); | ||
| $table->column_style('start_date', 'min-width', '125px'); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach is not ideal. We are requesting the video list from Opencast sorted by start date, but the Moodle table is not being sorted accordingly. This logic should be removed to avoid inconsistent behavior.
Additionally, instead of using the hardcoded value 3, please use the
SORT_DESCconstant for better readability and maintainability.