From b711d074cffe0cf4b24098a4dad1f22963137054 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 24 Sep 2013 15:05:31 +0200 Subject: [PATCH] fix the pagination area for hazelnut with bootstrap 3 using 'full_numbers' for now --- plugins/hazelnut/__init__.py | 3 ++ plugins/hazelnut/static/js/hazelnut.js | 7 ++- .../css/dataTables.full_numbers.css | 47 +++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 third-party/datatables-1.9.4/css/dataTables.full_numbers.css diff --git a/plugins/hazelnut/__init__.py b/plugins/hazelnut/__init__.py index e09d91a9..e8ecfce7 100644 --- a/plugins/hazelnut/__init__.py +++ b/plugins/hazelnut/__init__.py @@ -49,6 +49,9 @@ class Hazelnut (Plugin): ] , 'css_files': [ "css/hazelnut.css" , "css/dataTables.bootstrap.css", + # hopefully temporary, when/if datatables supports sPaginationType=bootstrap3 + # for now we use full_numbers\, with our own ad hoc css + "css/dataTables.full_numbers.css", ], } return reqs diff --git a/plugins/hazelnut/static/js/hazelnut.js b/plugins/hazelnut/static/js/hazelnut.js index 748a0a5d..dd7f8411 100644 --- a/plugins/hazelnut/static/js/hazelnut.js +++ b/plugins/hazelnut/static/js/hazelnut.js @@ -80,8 +80,11 @@ actual_options = { // Customize the position of Datatables elements (length,filter,button,...) // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time - sDom: "<'row-fluid'<'span5'l><'span1'r><'span6'f>>t<'row-fluid'<'span5'i><'span7'p>>", - sPaginationType: 'bootstrap', + sDom: "<'row'<'col-md-5'l><'col-md-1'r><'col-md-6'f>>t<'row'<'col-md-5'i><'col-md-7'p>>", + // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now + // hopefully this would come with dataTables v1.10 ? + // in any case, search for 'sPaginationType' all over the code for more comments + sPaginationType: 'full_numbers', // Handle the null values & the error : Datatables warning Requested unknown parameter // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2 aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}], diff --git a/third-party/datatables-1.9.4/css/dataTables.full_numbers.css b/third-party/datatables-1.9.4/css/dataTables.full_numbers.css new file mode 100644 index 00000000..eafefa59 --- /dev/null +++ b/third-party/datatables-1.9.4/css/dataTables.full_numbers.css @@ -0,0 +1,47 @@ +/* + // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now + // hopefully this would come with dataTables v1.10 ? + // in any case, search for 'sPaginationType' all over the code for more comments + // + // this file was made manually from dataTables's demo_tables.css or something +*/ + +.paging_full_numbers { + width: 400px; + height: 22px; + line-height: 22px; +} + +.paging_full_numbers a:active { + outline: none +} + +.paging_full_numbers a:hover { + text-decoration: none; +} + +.paging_full_numbers a.paginate_button, + .paging_full_numbers a.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; + color: #333 !important; +} + +.paging_full_numbers a.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers a.paginate_button:hover { + background-color: #ccc; + text-decoration: none !important; +} + +.paging_full_numbers a.paginate_active { + background-color: #99B3FF; +} + -- 2.43.0