This is an automated email from the git hooks/post-receive script.
thrnciar pushed a commit to branch pagination-custom-length-of-page
in repository copr/copr.
commit 2948f9146cd720273c744d133e831e5c33177dcd
Author: Tomas Hrnciar <thrnciar(a)reedhat.com>
AuthorDate: Wed Aug 14 14:43:22 2019 +0200
frontend: adds support for length of pending/running tables
In order to get length menu I had to update dom of DataTables.
It looks bit complicated, but when you look at documentation,
it should be clear.
Here is the link:
https://datatables.net/reference/option/dom.
fixes #709
---
frontend/coprs_frontend/coprs/static/css/custom-styles.css | 10 ++++++++++
frontend/coprs_frontend/coprs/templates/_helpers.html | 7 ++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/frontend/coprs_frontend/coprs/static/css/custom-styles.css
b/frontend/coprs_frontend/coprs/static/css/custom-styles.css
index b554a7a..eecbac6 100644
--- a/frontend/coprs_frontend/coprs/static/css/custom-styles.css
+++ b/frontend/coprs_frontend/coprs/static/css/custom-styles.css
@@ -38,3 +38,13 @@ span.padding {
input.short-input-field {
width: 6em;
}
+
+.table_footer {
+ padding: 7px 0 0 0;
+ background: #f5f5f5;
+ margin: 0;
+ min-width: 54rem;
+ border-left: 1px #d1d1d1 solid;
+ border-right: 1px #d1d1d1 solid;
+ border-bottom: 1px #d1d1d1 solid;
+}
diff --git a/frontend/coprs_frontend/coprs/templates/_helpers.html
b/frontend/coprs_frontend/coprs/templates/_helpers.html
index bdeae03..fb461e8 100644
--- a/frontend/coprs_frontend/coprs/templates/_helpers.html
+++ b/frontend/coprs_frontend/coprs/templates/_helpers.html
@@ -627,7 +627,12 @@
https://admin.fedoraproject.org/accounts/group/view/{{name}}
// Initialize Datatables
$(document).ready(function() {
$('.datatable').dataTable({
- "order": [[ 0, "{{ order }}" ]]
+ "order": [[ 0, '{{ order }}' ]],
+ "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, 'All']],
+ dom:
+
"<'dataTables_header'<'dataTables_filter'f><'dataTables_info'i>>"
+
+ "<'row'<'col-sm-12'tr>>" +
+ "<'row table_footer'<'col-sm-6
dataTables_length'l><'col-sm-6 dataTables_info'p>>"
});
});
</script>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.