Tidy up player edit screen and add custom menu icons

This commit is contained in:
Brian Miyaji
2014-02-18 19:33:06 +11:00
parent f07f60d593
commit 1b30d3a4ce
19 changed files with 293 additions and 209 deletions

View File

@@ -1,38 +1,4 @@
<?php <?php
function sportspress_team_importer() {
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) )
require $class_wp_importer;
}
// includes
require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/importers/team-importer.php';
// Dispatch
$importer = new SP_Team_Importer();
$importer->dispatch();
}
function sportspress_player_importer() {
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) )
require $class_wp_importer;
}
// includes
require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/importers/player-importer.php';
// Dispatch
$importer = new SP_Player_Importer();
$importer->dispatch();
}
function sportspress_admin_init() { function sportspress_admin_init() {
$post_types = array( $post_types = array(
'sp_event', 'sp_event',
@@ -69,9 +35,5 @@ function sportspress_admin_init() {
$administrator->add_cap( $cap . '_' . $post_type . 's' ); $administrator->add_cap( $cap . '_' . $post_type . 's' );
endforeach; endforeach;
endforeach; endforeach;
// Importers
register_importer( 'sportspress_team_csv', __( 'SportsPress Teams (CSV)', 'sportspress' ), __( 'Import <strong>teams</strong> from a csv file.', 'sportspress'), 'sportspress_team_importer' );
register_importer( 'sportspress_player_csv', __( 'SportsPress Players (CSV)', 'sportspress' ), __( 'Import <strong>players</strong> from a csv file.', 'sportspress'), 'sportspress_player_importer' );
} }
add_action( 'admin_init', 'sportspress_admin_init' ); add_action( 'admin_init', 'sportspress_admin_init' );

View File

@@ -3,15 +3,15 @@ function sportspress_admin_menu( $position ) {
global $menu, $submenu; global $menu, $submenu;
// Find where our placeholder is in the menu // Find where our separator is in the menu
foreach( $menu as $key => $data ): foreach( $menu as $key => $data ):
if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' ) if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' )
$seperator_position = $key; $separator_position = $key;
endforeach; endforeach;
// Swap our placeholder post type with a menu separator // Swap our separator post type with a menu separator
if ( $seperator_position ): if ( isset( $separator_position ) ):
$menu[ $seperator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' ); $menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
endif; endif;
// Remove "Venues" and "Positions" links from Media submenu // Remove "Venues" and "Positions" links from Media submenu
@@ -41,6 +41,12 @@ function sportspress_admin_menu( $position ) {
} }
add_action( 'admin_menu', 'sportspress_admin_menu' ); add_action( 'admin_menu', 'sportspress_admin_menu' );
if ( ! function_exists( 'sportspress_admin_menu_remove_add_new' ) ) {
function sportspress_admin_menu_remove_add_new( $arr = array() ) {
return $arr[0] != __( 'Add New', 'sportspress' );
}
}
if ( ! function_exists( 'sportspress_admin_menu_remove_leagues' ) ) { if ( ! function_exists( 'sportspress_admin_menu_remove_leagues' ) ) {
function sportspress_admin_menu_remove_leagues( $arr = array() ) { function sportspress_admin_menu_remove_leagues( $arr = array() ) {
return $arr[0] != __( 'Leagues', 'sportspress' ); return $arr[0] != __( 'Leagues', 'sportspress' );

View File

@@ -1,10 +1,8 @@
<?php <?php
function sportspress_admin_notices_styles() { function sportspress_admin_notices_styles() {
$screen = get_current_screen(); $screen = get_current_screen();
if ( $screen->id != 'settings_page_sportspress' ): if ( $screen->id != 'settings_page_sportspress' ):
if ( isset( $_REQUEST['sportspress_installed'] ) ): if ( isset( $_REQUEST['sportspress_installed'] ) ):
update_option( 'sportspress_installed', $_REQUEST['sportspress_installed'] ); update_option( 'sportspress_installed', $_REQUEST['sportspress_installed'] );
endif; endif;
@@ -12,13 +10,11 @@ function sportspress_admin_notices_styles() {
if ( ! get_option( 'sportspress_installed' ) ): if ( ! get_option( 'sportspress_installed' ) ):
add_action( 'admin_notices', 'sportspress_admin_install_notices' ); add_action( 'admin_notices', 'sportspress_admin_install_notices' );
endif; endif;
endif; endif;
$template = get_option( 'template' ); $template = get_option( 'template' );
if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ): if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ):
if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ): if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ):
update_option( 'sportspress_theme_support_check', $template ); update_option( 'sportspress_theme_support_check', $template );
return; return;
@@ -27,9 +23,7 @@ function sportspress_admin_notices_styles() {
if ( get_option( 'sportspress_theme_support_check' ) !== $template ): if ( get_option( 'sportspress_theme_support_check' ) !== $template ):
add_action( 'admin_notices', 'sportspress_theme_check_notice' ); add_action( 'admin_notices', 'sportspress_theme_check_notice' );
endif; endif;
endif; endif;
} }
add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' ); add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' );
@@ -50,5 +44,5 @@ function sportspress_admin_install_notices() {
* @return void * @return void
*/ */
function sportspress_theme_check_notice() { function sportspress_theme_check_notice() {
include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-theme-support.php' ); // include( dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/includes/notice-theme-support.php' );
} }

View File

@@ -95,15 +95,18 @@ function sportspress_save_post( $post_id ) {
// Update seasons teams to show // Update seasons teams to show
update_post_meta( $post_id, 'sp_leagues', sportspress_array_value( $_POST, 'sp_leagues', array() ) ); update_post_meta( $post_id, 'sp_leagues', sportspress_array_value( $_POST, 'sp_leagues', array() ) );
// Update current team
update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', null ) );
// Update past team array
sportspress_update_post_meta_recursive( $post_id, 'sp_past_team', sportspress_array_value( $_POST, 'sp_past_team', array() ) );
// Update team array // Update team array
sportspress_update_post_meta_recursive( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) ); sportspress_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sportspress_array_value( $_POST, 'sp_current_team', null ) ), sportspress_array_value( $_POST, 'sp_past_team', array() ) ) );
// Update player number // Update player number
update_post_meta( $post_id, 'sp_number', sportspress_array_value( $_POST, 'sp_number', '' ) ); update_post_meta( $post_id, 'sp_number', sportspress_array_value( $_POST, 'sp_number', '' ) );
// Update current team
update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', '' ) );
// Update nationality // Update nationality
update_post_meta( $post_id, 'sp_nationality', sportspress_array_value( $_POST, 'sp_nationality', '' ) ); update_post_meta( $post_id, 'sp_nationality', sportspress_array_value( $_POST, 'sp_nationality', '' ) );

View File

@@ -1,12 +1,10 @@
<?php <?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?> ?>
<?php if ( false ): ?>
<div id="message" class="error sportspress-message"> <div id="message" class="error sportspress-message">
<h4><?php _e( '<strong>Your theme does not declare SportsPress support</strong> &#8211; if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?></h4> <p><?php _e( '<strong>Your theme does not declare SportsPress support</strong> &#8211; if you encounter layout issues please read our integration guide or choose a SportsPress theme :)', 'sportspress' ); ?></p>
<p class="submit"> <p class="submit">
<a class="button-primary" href="http://docs.themeboy.com/sportspress/compatibility/"><?php _e( 'Theme Integration Guide', 'sportspress' ); ?></a> <a class="button-primary" href="http://docs.themeboy.com/sportspress/compatibility/"><?php _e( 'Theme Integration Guide', 'sportspress' ); ?></a>
<a class="button-secondary" href="<?php echo add_query_arg( 'hide_sportspress_theme_support_check', 'true' ); ?>"><?php _e( 'Hide this notice', 'sportspress' ); ?></a> <a class="button-secondary" href="<?php echo add_query_arg( 'hide_sportspress_theme_support_check', 'true' ); ?>"><?php _e( 'Hide this notice', 'sportspress' ); ?></a>
</p> </p>
</div> </div>
<?php endif;

View File

@@ -96,7 +96,7 @@ function sportspress_player_details_meta( $post ) {
endif; endif;
$teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1 ) ); $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1 ) );
$the_teams = array_filter( get_post_meta( $post->ID, 'sp_team', false ) ); $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) );
$current_team = get_post_meta( $post->ID, 'sp_current_team', true ); $current_team = get_post_meta( $post->ID, 'sp_current_team', true );
?> ?>
<p><strong><?php _e( 'Number', 'sportspress' ); ?></strong></p> <p><strong><?php _e( 'Number', 'sportspress' ); ?></strong></p>
@@ -114,6 +114,51 @@ function sportspress_player_details_meta( $post ) {
<?php endforeach; ?> <?php endforeach; ?>
</select></p> </select></p>
<p><strong><?php _e( 'Positions', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'taxonomy' => 'sp_position',
'name' => 'tax_input[sp_position][]',
'selected' => $position_ids,
'values' => 'term_id',
'placeholder' => __( 'Select Positions', 'sportspress' ),
'class' => 'widefat',
'property' => 'multiple',
'chosen' => true,
);
sportspress_dropdown_taxonomies( $args );
?></p>
<p><strong><?php _e( 'Current Team', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'post_type' => 'sp_team',
'name' => 'sp_current_team',
'show_option_blank' => true,
'selected' => $current_team,
'values' => 'ID',
'placeholder' => __( 'Select Team', 'sportspress' ),
'class' => 'sp-current-team widefat',
'chosen' => true,
);
sportspress_dropdown_pages( $args );
?></p>
<p><strong><?php _e( 'Past Teams', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'post_type' => 'sp_team',
'name' => 'sp_past_team[]',
'selected' => $past_teams,
'values' => 'ID',
'placeholder' => __( 'Select Teams', 'sportspress' ),
'class' => 'sp-past-teams widefat',
'property' => 'multiple',
'chosen' => true,
);
sportspress_dropdown_pages( $args );
?></p>
<p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p> <p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p>
<p><?php <p><?php
$args = array( $args = array(
@@ -143,51 +188,6 @@ function sportspress_player_details_meta( $post ) {
); );
sportspress_dropdown_taxonomies( $args ); sportspress_dropdown_taxonomies( $args );
?></p> ?></p>
<p><strong><?php _e( 'Teams', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'post_type' => 'sp_team',
'name' => 'sp_team[]',
'selected' => $the_teams,
'values' => 'ID',
'placeholder' => __( 'Select Teams', 'sportspress' ),
'class' => 'sp-team widefat',
'property' => 'multiple',
'chosen' => true,
);
sportspress_dropdown_pages( $args );
?></p>
<p><strong><?php _e( 'Current Team', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'post_type' => 'sp_team',
'name' => 'sp_current_team',
'show_option_blank' => true,
'selected' => $current_team,
'values' => 'ID',
'placeholder' => __( 'Select Team', 'sportspress' ),
'class' => 'sp-current-team widefat',
'chosen' => true,
);
sportspress_dropdown_pages( $args );
?></p>
<p><strong><?php _e( 'Positions', 'sportspress' ); ?></strong></p>
<p><?php
$args = array(
'taxonomy' => 'sp_position',
'name' => 'tax_input[sp_position][]',
'selected' => $position_ids,
'values' => 'term_id',
'placeholder' => __( 'Select Positions', 'sportspress' ),
'class' => 'widefat',
'property' => 'multiple',
'chosen' => true,
);
sportspress_dropdown_taxonomies( $args );
?></p>
<?php <?php
} }

View File

@@ -7,10 +7,10 @@ function sportspress_settings() {
<div class="wrap"> <div class="wrap">
<h2 class="nav-tab-wrapper"> <h2 class="nav-tab-wrapper">
<a href="?page=sportspress" class="nav-tab<?php echo $active_tab == 'general' ? ' nav-tab-active' : ''; ?>"><?php _e( 'SportsPress', 'sportspress' ); ?></a> <a href="<?php echo remove_query_arg( 'tab' ); ?>" class="nav-tab<?php echo $active_tab == 'general' ? ' nav-tab-active' : ''; ?>"><?php _e( 'General', 'sportspress' ); ?></a>
<a href="?page=sportspress&tab=events" class="nav-tab<?php echo $active_tab == 'events' ? ' nav-tab-active' : ''; ?>"><?php _e( 'Events', 'sportspress' ); ?></a> <a href="<?php echo add_query_arg( 'tab', 'events' ); ?>" class="nav-tab<?php echo $active_tab == 'events' ? ' nav-tab-active' : ''; ?>"><?php _e( 'Events', 'sportspress' ); ?></a>
<a href="?page=sportspress&tab=tables" class="nav-tab<?php echo $active_tab == 'tables' ? ' nav-tab-active' : ''; ?>"><?php _e( 'League Tables', 'sportspress' ); ?></a> <a href="<?php echo add_query_arg( 'tab', 'tables' ); ?>" class="nav-tab<?php echo $active_tab == 'tables' ? ' nav-tab-active' : ''; ?>"><?php _e( 'League Tables', 'sportspress' ); ?></a>
<a href="?page=sportspress&tab=players" class="nav-tab<?php echo $active_tab == 'players' ? ' nav-tab-active' : ''; ?>"><?php _e( 'Players', 'sportspress' ); ?></a> <a href="<?php echo add_query_arg( 'tab', 'players' ); ?>" class="nav-tab<?php echo $active_tab == 'players' ? ' nav-tab-active' : ''; ?>"><?php _e( 'Players', 'sportspress' ); ?></a>
</h2> </h2>
<form method="post" action="options.php"> <form method="post" action="options.php">
@@ -43,13 +43,13 @@ function sportspress_sport_callback() {
$custom_sport_name = sportspress_array_value( $options, 'custom_sport_name', null ); $custom_sport_name = sportspress_array_value( $options, 'custom_sport_name', null );
?> ?>
<select id="sportspress_sport" name="sportspress[sport]"> <select id="sportspress_sport" name="sportspress[sport]">
<option value><?php _e( '-- Select --', 'sportspress' ); ?></option> <option value><?php _e( '&mdash; Select &mdash;', 'sportspress' ); ?></option>
<?php foreach( $sportspress_sports as $slug => $sport ): ?> <?php foreach( $sportspress_sports as $slug => $sport ): ?>
<option value="<?php echo $slug; ?>" <?php selected( $selected, $slug ); ?>><?php echo $sport['name']; ?></option> <option value="<?php echo $slug; ?>" <?php selected( $selected, $slug ); ?>><?php echo $sport['name']; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
<option value="custom" <?php selected( $selected, 'custom' ); ?>><?php _e( 'Custom', 'sportspress' ); ?></option> <option value="custom" <?php selected( $selected, 'custom' ); ?>><?php _e( 'Custom', 'sportspress' ); ?></option>
</select> </select>
<input id="sportspress_custom_sport_name" name="sportspress[custom_sport_name]" type="text" placeholder="<?php _e( 'Sport', 'sportspress' ); ?>" value="<?php echo $custom_sport_name; ?>"<?php if ( $selected != 'custom' ): ?> class="hidden"<?php endif; ?>></p> <input id="sportspress_custom_sport_name" name="sportspress[custom_sport_name]" type="text" placeholder="<?php _e( 'Sport', 'sportspress' ); ?>" value="<?php echo $custom_sport_name; ?>"<?php if ( $selected != 'custom' ): ?> class="hidden"<?php endif; ?>>
<?php <?php
} }
@@ -87,7 +87,7 @@ function sportspress_settings_init() {
register_setting( register_setting(
'sportspress_general', 'sportspress_general',
'sportspress', 'sportspress',
'sportspress_sport_validate' 'sportspress_options_validate'
); );
add_settings_section( add_settings_section(
@@ -108,7 +108,8 @@ function sportspress_settings_init() {
// Event Settings // Event Settings
register_setting( register_setting(
'sportspress_events', 'sportspress_events',
'sportspress' 'sportspress',
'sportspress_options_validate'
); );
add_settings_section( add_settings_section(
@@ -129,14 +130,11 @@ function sportspress_settings_init() {
} }
add_action( 'admin_init', 'sportspress_settings_init', 1 ); add_action( 'admin_init', 'sportspress_settings_init', 1 );
function sportspress_sport_validate( $input ) { function sportspress_options_validate( $input ) {
$options = get_option( 'sportspress' ); $options = get_option( 'sportspress' );
// Do nothing if sport is the same as currently selected if ( isset( $input['sport'] ) && sportspress_array_value( $options, 'sport', null ) != sportspress_array_value( $input, 'sport', null ) ):
if ( sportspress_array_value( $options, 'sport', null ) == sportspress_array_value( $input, 'sport', null ) )
return $input;
// Get sports presets // Get sports presets
global $sportspress_sports; global $sportspress_sports;
@@ -232,10 +230,13 @@ function sportspress_sport_validate( $input ) {
endforeach; endforeach;
return $input; endif;
// Merge with existing options
return array_merge( $options, $input );
} }
function sportspress_add_options_page() { function sportspress_add_menu_page() {
add_options_page( add_options_page(
__( 'SportsPress', 'sportspress' ), __( 'SportsPress', 'sportspress' ),
__( 'SportsPress', 'sportspress' ), __( 'SportsPress', 'sportspress' ),
@@ -244,4 +245,4 @@ function sportspress_add_options_page() {
'sportspress_settings' 'sportspress_settings'
); );
} }
add_action( 'admin_menu', 'sportspress_add_options_page' ); add_action( 'admin_menu', 'sportspress_add_menu_page' );

View File

@@ -9,15 +9,30 @@ if ( !function_exists( 'sportspress_player_metrics' ) ) {
$number = get_post_meta( $id, 'sp_number', true ); $number = get_post_meta( $id, 'sp_number', true );
$nationality = get_post_meta( $id, 'sp_nationality', true ); $nationality = get_post_meta( $id, 'sp_nationality', true );
$current_team = get_post_meta( $id, 'sp_current_team', true );
$past_teams = get_post_meta( $id, 'sp_past_team', false );
$metrics = sportspress_get_player_metrics_data( $id ); $metrics = sportspress_get_player_metrics_data( $id );
$common = array( $common = array();
__( 'Number', 'sportspress' ) => $number,
__( 'Nationality', 'sportspress' ) => sportspress_array_value( $sportspress_countries, $nationality, '&mdash;' ), if ( $number != null )
); $common[ __( 'Number', 'sportspress' ) ] = $number;
if ( $nationality )
$common[ __( 'Nationality', 'sportspress' ) ] = sportspress_array_value( $sportspress_countries, $nationality, '&mdash;' );
$data = array_merge( $common, $metrics ); $data = array_merge( $common, $metrics );
if ( $current_team )
$data[ __( 'Current Team', 'sportspress' ) ] = '<a href="' . get_post_permalink( $current_team ) . '">' . get_the_title( $current_team ) . '</a>';
if ( $past_teams ):
$teams = array();
foreach ( $past_teams as $team ):
$teams[] = '<a href="' . get_post_permalink( $team ) . '">' . get_the_title( $team ) . '</a>';
endforeach;
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
endif;
$output = '<div class="sp-table-wrapper">' . $output = '<div class="sp-table-wrapper">' .
'<table class="sp-player-metrics sp-data-table sp-responsive-table">' . '<tbody>'; '<table class="sp-player-metrics sp-data-table sp-responsive-table">' . '<tbody>';

40
admin/tools/importers.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
function sportspress_team_importer() {
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) )
require $class_wp_importer;
}
// includes
require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/tools/team-importer.php';
// Dispatch
$importer = new SP_Team_Importer();
$importer->dispatch();
}
function sportspress_player_importer() {
require_once ABSPATH . 'wp-admin/includes/import.php';
if ( ! class_exists( 'WP_Importer' ) ) {
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
if ( file_exists( $class_wp_importer ) )
require $class_wp_importer;
}
// includes
require dirname( SPORTSPRESS_PLUGIN_FILE ) . '/admin/tools/player-importer.php';
// Dispatch
$importer = new SP_Player_Importer();
$importer->dispatch();
}
function sportspress_register_importers() {
register_importer( 'sportspress_team_csv', __( 'SportsPress Teams (CSV)', 'sportspress' ), __( 'Import <strong>teams</strong> from a csv file.', 'sportspress'), 'sportspress_team_importer' );
register_importer( 'sportspress_player_csv', __( 'SportsPress Players (CSV)', 'sportspress' ), __( 'Import <strong>players</strong> from a csv file.', 'sportspress'), 'sportspress_player_importer' );
}
add_action( 'admin_init', 'sportspress_register_importers' );

View File

@@ -1,5 +1,50 @@
/* SportsPress admin styles */ /* SportsPress admin styles */
@font-face {
font-family: 'sportspress';
src:url('../fonts/sportspress.eot?ofuus8');
src:url('../fonts/sportspress.eot?#iefixofuus8') format('embedded-opentype'),
url('../fonts/sportspress.woff?ofuus8') format('woff'),
url('../fonts/sportspress.ttf?ofuus8') format('truetype'),
url('../fonts/sportspress.svg?ofuus8#sportspress') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'sportspress';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-sportspress:before {
content: "\f111";
}
.icon-megaphone:before {
content: "\f155";
}
.icon-calendar:before {
content: "\f145";
}
.icon-shield:before {
content: "\f334";
}
#adminmenu #toplevel_page_sportspress .menu-icon-generic div.wp-menu-image:before,
#adminmenu #menu-posts-sp_event .menu-icon-sp_event div.wp-menu-image:before,
#adminmenu #menu-posts-sp_team .menu-icon-sp_team div.wp-menu-image:before,
#adminmenu #menu-posts-sp_sponsor .menu-icon-sp_sponsor div.wp-menu-image:before {
font-family: sportspress, dashicons !important;
}
.sportspress-message { .sportspress-message {
border-left-color: #6bc2a5 !important; border-left-color: #6bc2a5 !important;
} }
@@ -7,7 +52,7 @@
.sportspress-message a.button-primary, .sportspress-message a.button-primary,
.sportspress-message a.button-secondary { .sportspress-message a.button-secondary {
background: #6bc2a5; background: #6bc2a5;
border-color: #3bad87; border-color: #409e7f;
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);
box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);
color: #fff; color: #fff;
@@ -164,8 +209,23 @@ table.widefat td.column-sp_number .sp-flag {
color: #a00; color: #a00;
} }
.chosen-container { .chosen-container-single .chosen-single {
margin: 1px; -webkit-border-radius: 3px;
border-radius: 3px;
color: #555;
border-color: #ccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
}
.chosen-container-active.chosen-with-drop .chosen-single {
background: #fff;
}
.chosen-container-single .chosen-drop {
-webkit-border-radius: 0 0 3px 3px;
border-radius: 0 0 3px 3px;
} }
.chosen-container-multi .chosen-choices { .chosen-container-multi .chosen-choices {

BIN
assets/fonts/sportspress.eot Executable file

Binary file not shown.

14
assets/fonts/sportspress.svg Executable file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="sportspress" horiz-adv-x="512">
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
<glyph unicode="&#xf111;" d="M368.24 407.6c1.44 29.2 2.4 50.32 2.4 50.48h-229.2c0-0.16 1.040-21.28 2.4-50.48h-83.44l10.4-58.24c11.12-62.24 42.96-108.4 81.84-126.96 4.16-46.16 38.56-83.6 83.28-92.4 0-18.48 0-36.64 0-46.88 0-20.32-9.92-52.16-47.44-52.88h-15.68v-32.64h167.040v32.64h-15.68c-37.52 0.72-47.44 32.64-47.44 52.88 0 10.24 0 28.48 0 46.96 44.32 8.96 78.32 46.16 82.56 92 39.2 18.32 71.44 64.72 82.56 127.28l10.4 58.24h-84zM150.72 262.72c-22.32 18.64-40.080 51.92-47.36 92.4l-3.44 19.36h45.44c1.92-39.36 4-83.84 5.36-112.48 0.080 0.24 0.080 0.48 0 0.72zM256.32 159.84c-0.080 0-0.24 0-0.32 0-39.68 0-72 32.32-72 72v1.52c-2.64 54.64-6.88 144.64-9.2 192.96h81.52v-266.48zM409.28 355.2c-7.28-40.88-25.44-74.4-48.080-92.96-0.080-1.6 5.68 118.48 5.36 112.32h46.24l-3.52-19.36z" />
<glyph unicode="&#xf145;" d="M384 435.2h-51.2v-51.2h51.2v51.2zM435.2 435.2h-25.6v-76.8h-102.4v76.8h-102.4v-76.8h-102.4v76.8h-25.6c-14.16 0-25.6-11.44-25.6-25.6v-358.4c0-14.16 11.44-25.6 25.6-25.6h358.4c14.16 0 25.6 11.44 25.6 25.6v358.4c0 14.16-11.44 25.6-25.6 25.6zM409.6 76.8h-307.2v230.4h307.2v-230.4zM179.2 435.2h-51.2v-51.2h51.2v51.2zM281.6 256h-51.2v-51.2h51.2v51.2zM358.4 256h-51.2v-51.2h51.2v51.2zM204.8 179.2h-51.2v-51.2h51.2v51.2zM204.8 256h-51.2v-51.2h51.2v51.2zM281.6 179.2h-51.2v-51.2h51.2v51.2zM358.4 179.2h-51.2v-51.2h51.2v51.2z" />
<glyph unicode="&#xf155;" d="M440.909 306.457c-40.525 94.336-105.779 166.17-138.778 152.73-56.038-22.784 33.408-132.198-241.817-244.071-23.782-9.651-29.799-48.333-19.84-71.45 9.933-23.117 42.445-46.131 66.227-36.48 4.096 1.664 19.225 6.528 19.225 6.528 16.973-22.784 34.739-9.267 41.063-23.757 7.577-17.408 24.038-55.219 29.619-68.070 5.632-12.851 18.329-24.781 27.546-21.274 9.165 3.507 40.473 15.437 52.455 19.968s14.848 15.232 11.187 23.654c-3.942 9.063-20.122 11.725-24.729 22.323-4.634 10.599-19.712 44.519-24.038 55.219-5.888 14.541 6.631 26.368 24.832 28.262 125.286 13.056 148.711-64.333 191.36-46.976 32.921 13.466 26.214 109.056-14.31 203.392zM426.803 153.446c-7.322-2.969-56.627 35.891-88.141 109.235-31.488 73.318-27.52 140.339-20.224 143.309 7.322 2.995 55.424-43.929 86.938-117.248 31.462-73.293 28.749-132.327 21.427-135.296z" />
<glyph unicode="&#xf334;" d="M144 227.2v160h112v-284.24c-19.84 10.48-37.6 21.92-53.28 34.24-39.12 30.64-58.72 60.64-58.72 90zM96 419.2v-192c0-14.32 2.8-28.56 8.4-42.64s12.48-26.56 20.72-37.52c8.24-10.96 18.080-21.52 29.52-31.84 11.44-10.32 21.92-18.88 31.6-25.76s19.76-13.28 30.24-19.36 17.92-10.24 22.4-12.4 7.92-3.84 10.64-4.96c2-0.96 4.16-1.52 6.48-1.52s4.48 0.48 6.48 1.52c2.64 1.2 6.24 2.8 10.64 4.96s11.84 6.32 22.4 12.4 20.56 12.56 30.24 19.36 20.16 15.44 31.6 25.76 21.28 20.96 29.52 31.84 15.2 23.44 20.72 37.52c5.52 14.080 8.4 28.32 8.4 42.64v192c0 4.32-1.6 8.080-4.72 11.28s-6.96 4.72-11.28 4.72h-288c-4.32 0-8.080-1.6-11.28-4.72s-4.72-6.96-4.72-11.28v0z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
assets/fonts/sportspress.ttf Executable file

Binary file not shown.

BIN
assets/fonts/sportspress.woff Executable file

Binary file not shown.

View File

@@ -15,9 +15,9 @@ jQuery(document).ready(function($){
single_backstroke_delete: false single_backstroke_delete: false
}); });
$('#poststuff #sp_detailsdiv .sp-current-team').on('change', function(evt, params) { $('#poststuff #sp_detailsdiv .sp-current-team').on('change', function() {
$el = $(this).closest('#sp_detailsdiv').find('.sp-team'); $el = $(this).closest('#sp_detailsdiv').find('.sp-team');
$el.find('option[value='+$(this).val()+']').attr('selected', true); $el.find('option[value='+$(this).val()+']').attr('selected', false);
$el.trigger('chosen:updated'); $el.trigger('chosen:updated');
}); });

View File

@@ -927,7 +927,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) {
$args = array( $args = array(
'post_type' => 'sp_team', 'post_type' => 'sp_team',
'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']', 'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']',
'show_option_none' => __( '-- Not set --', 'sportspress' ), 'show_option_none' => __( '&mdash; None &mdash;', 'sportspress' ),
'sort_order' => 'ASC', 'sort_order' => 'ASC',
'sort_column' => 'menu_order', 'sort_column' => 'menu_order',
'selected' => $value, 'selected' => $value,
@@ -948,19 +948,7 @@ if ( !function_exists( 'sportspress_edit_player_statistics_table' ) ) {
), ),
); );
if ( ! sportspress_dropdown_pages( $args ) ): if ( ! sportspress_dropdown_pages( $args ) ):
$args = array( _e( 'No teams found.', 'sportspress' );
'post_type' => 'sp_team',
'name' => 'sp_leagues[' . $league_id . '][' . $div_id . ']',
'show_option_none' => __( '-- Not set --', 'sportspress' ),
'sort_order' => 'ASC',
'sort_column' => 'menu_order',
'selected' => $value,
'values' => 'ID',
'include' => $teams,
);
if ( ! sportspress_dropdown_pages( $args ) ):
echo '&mdash;';
endif;
endif; endif;
?> ?>
</td> </td>

View File

@@ -81,6 +81,9 @@ require_once dirname( __FILE__ ) . '/admin/widgets/events-calendar.php';
require_once dirname( __FILE__ ) . '/admin/widgets/player-list.php'; require_once dirname( __FILE__ ) . '/admin/widgets/player-list.php';
require_once dirname( __FILE__ ) . '/admin/widgets/league-table.php'; require_once dirname( __FILE__ ) . '/admin/widgets/league-table.php';
// Tools
require_once dirname( __FILE__ ) . '/admin/tools/importers.php';
// Typical request actions // Typical request actions
require_once dirname( __FILE__ ) . '/admin/hooks/plugins-loaded.php'; require_once dirname( __FILE__ ) . '/admin/hooks/plugins-loaded.php';
require_once dirname( __FILE__ ) . '/admin/hooks/after-setup-theme.php'; require_once dirname( __FILE__ ) . '/admin/hooks/after-setup-theme.php';