diff --git a/includes/sp-template-functions.php b/includes/sp-template-functions.php index 90e834f4..dc2493f5 100644 --- a/includes/sp-template-functions.php +++ b/includes/sp-template-functions.php @@ -516,7 +516,7 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { * @subpackage Responsive * @return void */ - function sportspress_responsive_tables_css($vars,$identity) { + function sportspress_responsive_tables_css( $vars, $identity, $theme = null ) { $custom_css = '/* Max width before this PARTICULAR table gets nasty This query will take effect for any screen smaller than 760px @@ -541,7 +541,7 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { width: auto !important; } - .sp-data-table .data-name { + .sp-data-table [class*="data"] { text-align: center !important; } @@ -552,7 +552,8 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { border: none; border-bottom: 1px solid #eee; position: relative; - padding-left: 50%; + padding-left: 50%; + vertical-align: middle; } table.'.$identity.' td:before { @@ -565,20 +566,106 @@ if ( ! function_exists( 'sportspress_responsive_tables_css' ) ) { padding-right: 10px; white-space: nowrap; } - /* Zebra striping */ - table.'.$identity.' tr:nth-of-type(odd) { - background: #eee !important; - } /* Label the data - */'; + */ + '; $k=1; - foreach ($vars as $label) { - $custom_css .= 'table.'.$identity.' td:nth-of-type('.$k.'):before { content: "'.$label.'"; }'; + foreach ( $vars as $label ) { + $custom_css .= 'table.'.$identity.' td:nth-of-type('.$k.'):before { content: "'.$label.'"; } + '; $k++; } + switch ( $theme ) { + + case 'Emblem': + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: rgba(65, 166, 42, 0.25); !important; + } + + /*table.'.$identity.' tr:nth-of-type(even) { + background: rgb(30, 118, 19); !important; + }*/'; + break; + case 'Courtside': + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: #eee !important; + } + + table.'.$identity.' tr:nth-of-type(even) { + background: #fff !important; + } + + /* Make the links visible */ + .sp-data-table [class*="data"] a{ + color: #0f8bca; + } + + /* Small fix for padding */ + table.'.$identity.' td:last-child { + padding-right: 0.25em; + }'; + break; + case 'Premier': + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: #eee !important; + } + + table.'.$identity.' tr:nth-of-type(even) { + background: #fff !important; + } + + /* Make the links visible */ + .sp-data-table [class*="data"] a{ + color: #0f8bca; + } + + /* Small fix for padding */ + table.'.$identity.' td:last-child { + padding-right: 0.25em; + }'; + break; + case 'Marquee': + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: #f3f3f3 !important; + } + + /*table.'.$identity.' tr:nth-of-type(even) { + background: #fff !important; + }*/'; + break; + case 'Rookie': + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: #eee !important; + } + + table.'.$identity.' tr:nth-of-type(even) { + background: #fff !important; + }'; + break; + case 'Football Club': + break; + default: + $custom_css .= '/* Zebra striping */ + table.'.$identity.' tr:nth-of-type(odd) { + background: #eee !important; + } + + table.'.$identity.' tr:nth-of-type(even) { + background: #fff !important; + }'; + break; + } + + $custom_css .= ' } '; + $dummystyle = 'sportspress-style-inline-'.$identity; wp_register_style( $dummystyle, false ); wp_enqueue_style( $dummystyle ); diff --git a/templates/event-list.php b/templates/event-list.php index 9fb86771..4bed2287 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -94,7 +94,7 @@ if ( $show_title && false === $title && $id ): endif; $labels = array(); //Create a unique identifier based on the current time in microseconds -$identifier = uniqid('eventlist_'); +$identifier = uniqid( 'eventlist_' ); ?>