diff --git a/assets/css/admin.css b/assets/css/admin.css index 73a6fcd2..d1081e65 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -315,6 +315,11 @@ table.widefat.sp-data-table input.small-text { min-width: 0; } +table.widefat.sp-data-table input.tiny-text { + width: 25px; + min-width: 0; +} + table.widefat.sp-data-table input.name { min-width: 0; width: auto; diff --git a/assets/css/sportspress.css b/assets/css/sportspress.css index b3432ab1..dd4d9e7a 100644 --- a/assets/css/sportspress.css +++ b/assets/css/sportspress.css @@ -288,6 +288,9 @@ .sp-event-performance .sp-performance-icons { width: 25%; } +.sp-event-performance .sp-event-star { + color: #f4d014; +} /* Event Performance (Icons) */ .sp-event-performance-teams .sp-template-event-performance-icons { diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php index 35f666d2..541cc2a9 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php @@ -20,7 +20,7 @@ class SP_Meta_Box_Event_Performance { */ public static function output( $post ) { $event = new SP_Event( $post ); - list( $labels, $columns, $stats, $teams, $formats, $order, $timed ) = $event->performance( true ); + list( $labels, $columns, $stats, $teams, $formats, $order, $timed, $stars ) = $event->performance( true ); if ( 'yes' == get_option( 'sportspress_event_performance_show_minutes', 'no' ) ) $timeline = $event->timeline( true ); @@ -62,7 +62,7 @@ class SP_Meta_Box_Event_Performance { // Get status option $status = ! $is_individual; - self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed ); + self::tables( $post->ID, $stats, $labels, $columns, $teams, $has_checkboxes, $positions, $status, $formats, $order, $numbers, $is_individual, $timeline, $timed, $stars ); } /** @@ -73,12 +73,13 @@ class SP_Meta_Box_Event_Performance { update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) ); update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) ); update_post_meta( $post_id, 'sp_timeline', sp_array_value( $_POST, 'sp_timeline', array() ) ); + update_post_meta( $post_id, 'sp_stars', sp_array_value( $_POST, 'sp_stars', array() ) ); } /** * Admin edit tables */ - public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array(), $timed = array() ) { + public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array(), $timed = array(), $stars = array() ) { $sections = get_option( 'sportspress_event_performance_sections', -1 ); if ( $is_individual ) { @@ -113,7 +114,7 @@ class SP_Meta_Box_Event_Performance { $player_timeline = false; endif; - self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline, $timed ); + self::row( $labels, $player_id, $player_performance, $team_id, $data, ! empty( $positions ), $status, false, $numbers, -1, $formats, $player_timeline, $timed, $stars ); endforeach; endforeach; ?> @@ -142,7 +143,7 @@ class SP_Meta_Box_Event_Performance { ?>
- +
—
- +| + | + + | + @@ -366,9 +374,10 @@ class SP_Meta_Box_Event_Performance { /** * Admin edit table row */ - public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array(), $player_timeline = array(), $timed = array() ) { + public static function row( $labels = array(), $player_id = 0, $player_performance = array(), $team_id = 0, $data = array(), $positions = true, $status = true, $sortable = true, $numbers = true, $section = -1, $formats = array(), $player_timeline = array(), $timed = array(), $stars = array() ) { if ( $player_id <= 0 ) return; + $stars_type = get_option( 'sportspress_event_performance_stars_type', 0 ); $value = sp_array_value( $player_performance, 'number', '' ); ?> |
|---|
| + '; + break; + case 2: + echo ''; + break; + } + ?> + | +