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 686fa836191f0d9238740a489f683b665c5d2639
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 | 11 ++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
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..76d9773 100644
--- a/frontend/coprs_frontend/coprs/templates/_helpers.html
+++ b/frontend/coprs_frontend/coprs/templates/_helpers.html
@@ -627,13 +627,18 @@
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>
{% endmacro %}
-{% macro status_info(type, tasks) %}
+{% macro status_info(type, tasks) %}
<table class="datatable table table-striped table-bordered">
<thead>
<tr>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.