fix the pagination area for hazelnut with bootstrap 3
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 24 Sep 2013 13:05:31 +0000 (15:05 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 24 Sep 2013 13:05:31 +0000 (15:05 +0200)
using 'full_numbers' for now

plugins/hazelnut/__init__.py
plugins/hazelnut/static/js/hazelnut.js
third-party/datatables-1.9.4/css/dataTables.full_numbers.css [new file with mode: 0644]

index e09d91a..e8ecfce 100644 (file)
@@ -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
index 748a0a5..dd7f841 100644 (file)
             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 (file)
index 0000000..eafefa5
--- /dev/null
@@ -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;
+}
+