Skip to content

Commit d2386f1

Browse files
committed
Fix different pagination buttons in Finnish. Add translations and icons to DataTables action buttons. Remove Excel export for now as it would require an additional library.
1 parent a0d874e commit d2386f1

2 files changed

Lines changed: 36 additions & 12 deletions

File tree

assets/js/participants.js

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,15 @@ function participants_list(participants, api_url, is_teacher, enrollment_statuse
561561
pageLength: localStorage.getItem('participantsListPageLength') ? parseInt(localStorage.getItem('participantsListPageLength'), 10) : 50,
562562
deferRender: true,
563563
autoWidth: false,
564-
language: { url: pageLanguageUrl },
564+
language: {
565+
paginate: {
566+
first: '<i class="bi-chevron-double-left"></i>',
567+
last: '<i class="bi-chevron-double-right"></i>',
568+
next: '<i class="bi-chevron-right"></i>',
569+
previous: '<i class="bi-chevron-left"></i>'
570+
},
571+
url: pageLanguageUrl
572+
},
565573
initComplete: function(){
566574
if (aplusTranslationsReady) {
567575
try { updateHeaderTranslations(); } catch (e) {}
@@ -596,15 +604,25 @@ function participants_list(participants, api_url, is_teacher, enrollment_statuse
596604
}
597605
} catch (e) {}
598606
},
599-
dom: "<'row'<'col-md-3 col-sm-6'l><'col-md-5 col-sm-6'B><'col-md-4 col-sm-12'f>>" +
607+
dom: "<'row'<'col-md-3 col-sm-6'l><'col-md-6 col-sm-6'B><'col-md-3 col-sm-12'f>>" +
600608
"<'row'<'col-sm-12 mt-3'i>>" +
601609
"<'row'<'#table-participants-div.col-sm-12'tr>>" +
602610
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
603611
buttons: [
604-
$.extend(true, {}, buttonCommon, { extend: 'csvHtml5', className: 'btn-sm' }),
605-
$.extend(true, {}, buttonCommon, { extend: 'copyHtml5', className: 'btn-sm' }),
606-
$.extend(true, {}, buttonCommon, { extend: 'excelHtml5', className: 'btn-sm' }),
607-
{ text: 'Reset filters', className: 'btn-reset-filters btn-sm', name: 'resetFilters', action: function(){ clearSearch(); } }
612+
$.extend( true, {}, buttonCommon, {
613+
text: '<i class="bi-filetype-csv"></i> CSV',
614+
extend: 'csvHtml5'
615+
} ),
616+
$.extend( true, {}, buttonCommon, {
617+
text: '<i class="bi-clipboard"></i> ' + _('Copy to clipboard'),
618+
extend: 'copyHtml5'
619+
} ),
620+
{
621+
text: '<i class="bi-arrow-counterclockwise"></i> ' + _('Reset filters'),
622+
action: function ( e, dt, node, config ) {
623+
clearSearch();
624+
}
625+
}
608626
]
609627
});
610628

exercise/static/exercise/results_staff.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,12 @@
13571357
lengthMenu: [[10, 50, 100, 500, -1], [10, 50, 100, 500, "All"]],
13581358
pageLength: 50, // Set the length to 50 for faster initial load time
13591359
language: {
1360+
paginate: {
1361+
first: '<i class="bi-chevron-double-left"></i>',
1362+
last: '<i class="bi-chevron-double-right"></i>',
1363+
next: '<i class="bi-chevron-right"></i>',
1364+
previous: '<i class="bi-chevron-left"></i>'
1365+
},
13601366
url: pageLanguageUrl
13611367
},
13621368
/**
@@ -1405,7 +1411,7 @@
14051411
* Note that we have a custom "dt-note" div that is used to display a note about
14061412
* using the < and > operators in number column search fields.
14071413
*/
1408-
dom: "<'row'<'col-md-3 col-sm-6'l><'col-md-5 col-sm-6'B><'col-md-4 col-sm-12'f>>" +
1414+
dom: "<'row'<'col-md-3 col-sm-6'l><'col-md-6 col-sm-6'B><'col-md-3 col-sm-12'f>>" +
14091415
"<'row'<'col-sm-6'i><'col-sm-6 dt-note'>>" +
14101416
"<'row'<'#table-points-div.col-sm-12'tr>>" +
14111417
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
@@ -1420,19 +1426,19 @@
14201426
body: removeHtmlFromColumns
14211427
}
14221428
}}, {
1423-
extend: 'csvHtml5', text: 'Sisu'
1429+
text: '<i class="bi-file-earmark-arrow-down"></i> Sisu',
1430+
extend: 'csvHtml5'
14241431
} ),
14251432
$.extend( true, {}, buttonCommon, {
1433+
text: '<i class="bi-filetype-csv"></i> CSV',
14261434
extend: 'csvHtml5'
14271435
} ),
14281436
$.extend( true, {}, buttonCommon, {
1437+
text: '<i class="bi-clipboard"></i> ' + _('Copy to clipboard'),
14291438
extend: 'copyHtml5'
14301439
} ),
1431-
$.extend( true, {}, buttonCommon, {
1432-
extend: 'excelHtml5'
1433-
} ),
14341440
{
1435-
text: 'Reset filters',
1441+
text: '<i class="bi-arrow-counterclockwise"></i> ' + _('Reset filters'),
14361442
action: function ( e, dt, node, config ) {
14371443
clearSearch();
14381444
}

0 commit comments

Comments
 (0)