diff --git a/assets/js/admin/sportspress-admin.js b/assets/js/admin/sportspress-admin.js index eb81d3c5..5bf07f9b 100644 --- a/assets/js/admin/sportspress-admin.js +++ b/assets/js/admin/sportspress-admin.js @@ -557,6 +557,16 @@ jQuery(document).ready(function($){ }); $(".sp-date-selector select").trigger("change"); + // Show or hide league table selector + $(".sp-team-selector .sp-team-picker select").change(function() { + console.log( $(this) ); + if ( $(this).val() == "table" ) { + $(this).closest(".sp-team-selector").find(".sp-league-table-picker").show(); + } else { + $(this).closest(".sp-team-selector").find(".sp-league-table-picker").hide(); + } + }).trigger("change"); + // Apply color scheme $(".sp-color-option").on("click", function() { colors = $(this).find("label").data("sp-colors").split(","); diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php index 56a76822..0433eeb9 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php @@ -63,36 +63,40 @@ class SP_Meta_Box_Calendar_Details { sp_taxonomy_field( $taxonomy, $post, true ); } ?> -

-

- __( 'All', 'sportspress' ), - 'post_type' => 'sp_team', - 'name' => 'sp_team', - 'selected' => $team_id, - 'values' => 'ID' - ); - if ( ! sp_dropdown_pages( $args ) ): - sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); - endif; - ?> -

-

-

- __( 'All', 'sportspress' ), - 'post_type' => 'sp_table', - 'name' => 'sp_table', - 'selected' => $table_id, - 'values' => 'ID' - ); - if ( ! sp_dropdown_pages( $args ) ): - sp_post_adder( 'sp_table', __( 'Add New', 'sportspress' ) ); - endif; - ?> -

+
+

+

+ __( 'All', 'sportspress' ), + 'post_type' => 'sp_team', + 'name' => 'sp_team', + 'selected' => $team_id, + 'values' => 'ID', + 'append_options' => array( + 'table' => sprintf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ), + ), + ); + if ( ! sp_dropdown_pages( $args ) ): + sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) ); + endif; + ?> +

+

+ __( 'All', 'sportspress' ), + 'post_type' => 'sp_table', + 'name' => 'sp_table', + 'selected' => $table_id, + 'values' => 'ID', + ); + if ( ! sp_dropdown_pages( $args ) ): + sp_post_adder( 'sp_table', __( 'Add New', 'sportspress' ) ); + endif; + ?> +

+