From 71a2ae95d48c55e6184031b6cfc56789a8f208d6 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 31 Mar 2014 23:28:40 +1100 Subject: [PATCH] Enable editing Key field in Metrics and Performance --- assets/css/admin.css | 9 ++++- assets/css/dashboard.css | 4 +- .../post-types/class-sp-admin-cpt-metric.php | 1 + .../post-types/class-sp-admin-meta-boxes.php | 12 ++++-- .../class-sp-meta-box-metric-details.php | 38 +++++++++++++++++++ .../class-sp-meta-box-performance-details.php | 6 ++- .../settings/class-sp-settings-config.php | 6 ++- readme.txt | 26 ++++++------- sportspress.php | 6 +-- 9 files changed, 83 insertions(+), 25 deletions(-) create mode 100644 includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php diff --git a/assets/css/admin.css b/assets/css/admin.css index 9ad86436..3beff1fe 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -56,7 +56,14 @@ width: 6%; } -.fixed .column-sp_league, .fixed .column-sp_season, .fixed .column-sp_venue, .fixed .column-sp_position, .fixed .column-sp_views { +.post-type-sp_event .fixed .column-sp_league, +.post-type-sp_calendar .fixed .column-sp_league, +.post-type-sp_event .fixed .column-sp_season, +.post-type-sp_calendar .fixed .column-sp_season, +.post-type-sp_event .fixed .column-sp_venue, +.post-type-sp_calendar .fixed .column-sp_venue, +.post-type-sp_player .fixed .column-sp_position, +.fixed .column-sp_views { width: 10%; } diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css index 0c024654..994959a6 100644 --- a/assets/css/dashboard.css +++ b/assets/css/dashboard.css @@ -81,11 +81,11 @@ } #sportspress_dashboard_status .sp_status_list li.events-scheduled a:before { - color: #ffba00; + color: #f9af4b; } #sportspress_dashboard_status .sp_status_list li.events-published a:before { - color: #21759b; + color: #00a69c; } #sportspress_dashboard_status .sp_status_list li strong { diff --git a/includes/admin/post-types/class-sp-admin-cpt-metric.php b/includes/admin/post-types/class-sp-admin-cpt-metric.php index bb7be995..47fb7da4 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-metric.php +++ b/includes/admin/post-types/class-sp-admin-cpt-metric.php @@ -41,6 +41,7 @@ class SP_Admin_CPT_Metric extends SP_Admin_CPT { $columns = array( 'cb' => '', 'title' => __( 'Label', 'sportspress' ), + 'sp_key' => __( 'Key', 'sportspress' ), 'sp_position' => __( 'Positions', 'sportspress' ), ); return $columns; diff --git a/includes/admin/post-types/class-sp-admin-meta-boxes.php b/includes/admin/post-types/class-sp-admin-meta-boxes.php index 9a42e796..1313ca5f 100644 --- a/includes/admin/post-types/class-sp-admin-meta-boxes.php +++ b/includes/admin/post-types/class-sp-admin-meta-boxes.php @@ -32,6 +32,9 @@ class SP_Admin_Meta_Boxes { // Save Outcome Meta Boxes add_action( 'sportspress_process_sp_outcome_meta', 'SP_Meta_Box_Outcome_Details::save', 10, 2 ); + // Save Metric Meta Boxes + add_action( 'sportspress_process_sp_metric_meta', 'SP_Meta_Box_Metric_Details::save', 10, 2 ); + // Save Performance Meta Boxes add_action( 'sportspress_process_sp_performance_meta', 'SP_Meta_Box_Performance_Details::save', 10, 2 ); @@ -80,12 +83,15 @@ class SP_Admin_Meta_Boxes { // Outcomes add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Outcome_Details::output', 'sp_outcome', 'normal', 'high' ); - // Performance - add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Performance_Details::output', 'sp_performance', 'normal', 'high' ); - // Columns add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Column_Details::output', 'sp_column', 'normal', 'high' ); + // Performance + add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Metric_Details::output', 'sp_metric', 'normal', 'high' ); + + // Performance + add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Performance_Details::output', 'sp_performance', 'normal', 'high' ); + // Events add_meta_box( 'sp_formatdiv', __( 'Format', 'sportspress' ), 'SP_Meta_Box_Event_Format::output', 'sp_event', 'side', 'default' ); add_meta_box( 'sp_detailsdiv', __( 'Details', 'sportspress' ), 'SP_Meta_Box_Event_Details::output', 'sp_event', 'side', 'default' ); diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php new file mode 100644 index 00000000..acb80835 --- /dev/null +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-metric-details.php @@ -0,0 +1,38 @@ +ID, 'sp_calculate', true ); + ?> +

+

+ +

+ ID, 'sp_calculate', true ); ?> +

+

+ +

ID, $calculate ); ?> diff --git a/includes/admin/settings/class-sp-settings-config.php b/includes/admin/settings/class-sp-settings-config.php index 512fea90..a7d54cf0 100644 --- a/includes/admin/settings/class-sp-settings-config.php +++ b/includes/admin/settings/class-sp-settings-config.php @@ -281,6 +281,7 @@ class SP_Settings_Config extends SP_Settings_Page { +   @@ -289,6 +290,7 @@ class SP_Settings_Config extends SP_Settings_Page { > post_title; ?> + post_name; ?> ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?>   @@ -297,7 +299,7 @@ class SP_Settings_Config extends SP_Settings_Page {

- +

@@ -330,6 +332,7 @@ class SP_Settings_Config extends SP_Settings_Page { + @@ -338,6 +341,7 @@ class SP_Settings_Config extends SP_Settings_Page { > post_title; ?> + post_name; ?> ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?> ID ); ?> diff --git a/readme.txt b/readme.txt index 0cdba40a..2c195ea6 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: sports, press, sports journalism, teams, team management, fixtures, result Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=support@themeboy.com&item_name=Donation+for+SportsPress Requires at least: 3.8 Tested up to: 3.8.1 -Stable tag: 0.7.2 +Stable tag: 0.7.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -79,19 +79,6 @@ Automatic updates should work like a charm; as always though, ensure you backup If on the off-chance you do encounter issues with the event/team/player/staff pages after an update you simply need to flush the permalinks by going to WordPress > Settings > Permalinks and hitting 'save'. That should return things to normal. -== Screenshots == - -1. League Table in Twenty Fourteen theme. -2. Events List in Twenty Fourteen theme. -3. Events Calendar in Twenty Fourteen theme. -4. Player List in Twenty Fourteen theme. -5. League Table column configuration. -6. General Options page. -7. Player List widget settings. -8. SportsPress Status dashboard widget. - -== Other Notes == - = Sport Presets = SportsPress comes with settings for some sports that you can apply by going to WordPress > Settings > SportsPress. By selecting a sport, presets will be applied to Events, League Tables, and Players. @@ -137,6 +124,17 @@ Metrics are static values associated with players, and are useful for variables Performance is for keeping track of the performance variables like goals, assists, yellow cards, and red cards. They are displayed on player profile pages, event pages, and player lists. Each player will have their own set of statistics for each event and league per season. You can choose whether to calculate the total or average of each variable by selecting from the “Calculate” dropdown menu. Be sure to select the position(s) that each statistic applies to so it shows up on the appropriate players' profile pages. +== Screenshots == + +1. League Table in Twenty Fourteen theme with default color scheme. +2. Events List in Twenty Fourteen theme with custom color scheme. +3. Events Calendar in Twenty Fourteen theme with custom color scheme. +4. Player List in Twenty Fourteen theme with custom color scheme. +5. League Table column configuration. +6. General Options page. +7. Player List widget settings. +8. SportsPress Status dashboard widget. + == Frequently Asked Questions == = Which sports does this plugin support? = diff --git a/sportspress.php b/sportspress.php index cce57b85..eb9f3309 100644 --- a/sportspress.php +++ b/sportspress.php @@ -3,7 +3,7 @@ * Plugin Name: SportsPress * Plugin URI: http://wordpress.org/plugins/sportspress * Description: Manage your club and its players, staff, events, league tables, and player lists. - * Version: 0.7.2 + * Version: 0.7.3 * Author: ThemeBoy * Author URI: http://themeboy.com * Requires at least: 3.8 @@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) : * Main SportsPress Class * * @class SportsPress - * @version 0.7.2 + * @version 0.7.3 */ final class SportsPress { /** * @var string */ - public $version = '0.7.2'; + public $version = '0.7.3'; /** * @var SporsPress The single instance of the class