From ae01cf4d3e8ca9bbb0f5d7e64fe9b017b96753b1 Mon Sep 17 00:00:00 2001 From: vonavi Date: Sat, 22 Mar 2014 14:31:04 +0200 Subject: [PATCH] Improve the look of tournament tables, using the last version of tablesorter. --- _assets/javascripts/custom.js | 5 +- _assets/javascripts/jquery.metadata.js | 2 +- _assets/javascripts/jquery.tablesorter.js | 2 +- _assets/stylesheets/less/table.custom.less | 30 +++++++++++ _assets/stylesheets/less/table.less | 63 ---------------------- _assets/stylesheets/less/theme.blue.less | 1 + _assets/stylesheets/table.css.less | 2 + _assets/stylesheets/theme.css.less | 1 - _layouts/tournament.html | 1 + 9 files changed, 40 insertions(+), 67 deletions(-) create mode 100644 _assets/stylesheets/less/table.custom.less delete mode 100644 _assets/stylesheets/less/table.less create mode 120000 _assets/stylesheets/less/theme.blue.less create mode 100644 _assets/stylesheets/table.css.less diff --git a/_assets/javascripts/custom.js b/_assets/javascripts/custom.js index b513c01..c27dc72 100644 --- a/_assets/javascripts/custom.js +++ b/_assets/javascripts/custom.js @@ -13,7 +13,10 @@ $(function() { /* Sort a tournament table with tablesorter */ $('.tablesorter .opponent').addClass('{sorter: false}'); $('.tablesorter').tablesorter({ - widgets: ['zebra'] + theme : 'blue', + widgets : ['zebra'], + sortReset : true, + sortRestart : true }); }) diff --git a/_assets/javascripts/jquery.metadata.js b/_assets/javascripts/jquery.metadata.js index 36c9ff7..bd4b6f6 120000 --- a/_assets/javascripts/jquery.metadata.js +++ b/_assets/javascripts/jquery.metadata.js @@ -1 +1 @@ -../vendor/tablesorter/jquery.metadata.js \ No newline at end of file +../vendor/tablesorter/js/jquery.metadata.js \ No newline at end of file diff --git a/_assets/javascripts/jquery.tablesorter.js b/_assets/javascripts/jquery.tablesorter.js index 741996e..af54de0 120000 --- a/_assets/javascripts/jquery.tablesorter.js +++ b/_assets/javascripts/jquery.tablesorter.js @@ -1 +1 @@ -../vendor/tablesorter/jquery.tablesorter.js \ No newline at end of file +../vendor/tablesorter/js/jquery.tablesorter.js \ No newline at end of file diff --git a/_assets/stylesheets/less/table.custom.less b/_assets/stylesheets/less/table.custom.less new file mode 100644 index 0000000..d93ee8b --- /dev/null +++ b/_assets/stylesheets/less/table.custom.less @@ -0,0 +1,30 @@ +/* Tournament table */ + +table.tournament { + thead > tr > th, thead > tr > td, + tfoot > tr > th, tfoot > tr > td, + tbody > tr > th, tbody > tr > td { + padding: 0; + } + + thead > tr > .opponent, + tbody > tr > .score, + tbody > tr > .diagonal { + min-width: 21px; + text-align: center; + } + tbody > tr > .diagonal { + background: black !important; + } +} + + +/* Tablesorter */ + +/* Fix the background color of tfoot */ +.tablesorter-blue tfoot { + .tablesorter-headerSortUp, .tablesorter-headerSortDown, + .tablesorter-headerAsc, .tablesorter-headerDesc { + background-color: #fff; + } +} diff --git a/_assets/stylesheets/less/table.less b/_assets/stylesheets/less/table.less deleted file mode 100644 index 93c3531..0000000 --- a/_assets/stylesheets/less/table.less +++ /dev/null @@ -1,63 +0,0 @@ -/* Tablesorter */ - -table.tablesorter { - background-color: #cdcdcd; - border-spacing: 1px; - border-collapse: separate; - - thead tr th, tfoot tr th { - background-color: #e6eeee; - border: 1px solid #fff !important; - } - - thead tr { - .header { - padding-right: 21px; - background-image: url("/assets/img/tablesorter/bg.gif"); - background-repeat: no-repeat; - background-position: center right; - cursor: pointer; - } - - .headerSortUp { - background-image: url("/assets/img/tablesorter/asc.gif"); - } - - .headerSortDown { - background-image: url("/assets/img/tablesorter/desc.gif"); - } - - .headerSortDown, .headerSortUp { - background-color: #8dbdd8; - } - } - - tfoot td, tbody td { - background-color: #fff; - border: none; - } - tbody tr.odd td { - background-color: #f0f0f6; - } -} - - -/* Tournament table */ - -table.tournament { - thead > tr > th, thead > tr > td, - tfoot > tr > th, tfoot > tr > td, - tbody > tr > th, tbody > tr > td { - padding: 0; - } - - thead > tr > .opponent, - tbody > tr > .score, - tbody > tr > .diagonal { - min-width: 21px; - text-align: center; - } - tbody > tr > .diagonal { - background: black !important; - } -} diff --git a/_assets/stylesheets/less/theme.blue.less b/_assets/stylesheets/less/theme.blue.less new file mode 120000 index 0000000..9c0d599 --- /dev/null +++ b/_assets/stylesheets/less/theme.blue.less @@ -0,0 +1 @@ +../../vendor/tablesorter/css/theme.blue.css \ No newline at end of file diff --git a/_assets/stylesheets/table.css.less b/_assets/stylesheets/table.css.less new file mode 100644 index 0000000..7bdeeb2 --- /dev/null +++ b/_assets/stylesheets/table.css.less @@ -0,0 +1,2 @@ +//= require less/theme.blue +//= require less/table.custom diff --git a/_assets/stylesheets/theme.css.less b/_assets/stylesheets/theme.css.less index 751480f..15e95e6 100644 --- a/_assets/stylesheets/theme.css.less +++ b/_assets/stylesheets/theme.css.less @@ -1,2 +1 @@ //= require less/pgn4web -//= require less/table diff --git a/_layouts/tournament.html b/_layouts/tournament.html index bf0cfe0..f74a7da 100644 --- a/_layouts/tournament.html +++ b/_layouts/tournament.html @@ -8,6 +8,7 @@ layout: default
+ {% stylesheet table %} {% assign table = page.url | remove_first: '/' | append: 'table.html' %} {% include {{table}} %}