diff --git a/includes/admin/pages/page-goals.php b/includes/admin/pages/page-goals.php
index 5f907e5..4ec92cb 100644
--- a/includes/admin/pages/page-goals.php
+++ b/includes/admin/pages/page-goals.php
@@ -192,8 +192,8 @@ function statpress_goals_page() {
array(
'label' => 'Dystans (km)',
'data' => $chart_datasets['distance'],
- 'backgroundColor' => 'rgba(52, 152, 219, 0.5)',
- 'borderColor' => 'rgba(52, 152, 219, 1)',
+ 'backgroundColor' => 'rgba(26, 115, 232, 0.5)', /* Google Blue */
+ 'borderColor' => 'rgba(26, 115, 232, 1)',
'yAxisLabel' => 'Kilometry',
),
'duration' => array(
'label' => 'Czas trwania (godz.)',
'data' => $chart_datasets['duration'],
- 'backgroundColor' => 'rgba(26, 188, 156, 0.5)',
- 'borderColor' => 'rgba(26, 188, 156, 1)',
+ 'backgroundColor' => 'rgba(24, 128, 56, 0.5)', /* Google Green */
+ 'borderColor' => 'rgba(24, 128, 56, 1)',
'yAxisLabel' => 'Godziny',
),
'calories' => array(
'label' => 'Kalorie (kcal)',
'data' => $chart_datasets['calories'],
- 'backgroundColor' => 'rgba(231, 76, 60, 0.5)',
- 'borderColor' => 'rgba(231, 76, 60, 1)',
+ 'backgroundColor' => 'rgba(217, 48, 37, 0.5)', /* Google Red */
+ 'borderColor' => 'rgba(217, 48, 37, 1)',
'yAxisLabel' => 'kcal',
),
'activities' => array(
'label' => 'Liczba aktywności',
'data' => $chart_datasets['activities'],
- 'backgroundColor' => 'rgba(241, 196, 15, 0.5)',
- 'borderColor' => 'rgba(241, 196, 15, 1)',
+ 'backgroundColor' => 'rgba(249, 171, 0, 0.5)', /* Google Yellow */
+ 'borderColor' => 'rgba(249, 171, 0, 1)',
'yAxisLabel' => 'Ilość',
),
);
@@ -247,7 +247,7 @@ function statpress_yearly_summary_page() {
diff --git a/includes/frontend/shortcodes.php b/includes/frontend/shortcodes.php
index 17a41e4..c49cbe9 100644
--- a/includes/frontend/shortcodes.php
+++ b/includes/frontend/shortcodes.php
@@ -38,7 +38,7 @@ function statpress_shortcode_handler( $atts ) {
$table_activities = $wpdb->prefix . 'statpress_activities';
$sql = $wpdb->prepare(
"
- SELECT a.*, c.name as category_name, eq.name as equipment_name
+ SELECT a.*, c.name as category_name, c.icon, c.color, eq.name as equipment_name
FROM $table_activities a
LEFT JOIN {$wpdb->prefix}statpress_categories c ON a.category_id = c.id
LEFT JOIN {$wpdb->prefix}statpress_equipment eq ON a.equipment_id = eq.id
@@ -68,78 +68,95 @@ function statpress_shortcode_handler( $atts ) {
// Rozpoczęcie buforowania wyjścia
ob_start();
?>
-
+
+
+
Podsumowanie miesiąca
-
-
-
- | Całkowity dystans |
- Całkowity czas |
-
-
-
-
- | km |
- |
-
-
-
+
+
+
Całkowity dystans
+
km
+
+
+
Lista aktywności
-
-
-
- | Data |
- Tytuł |
- Kategoria |
-
- Dystans |
- Czas |
- Sprzęt |
-
-
-
-
-
-
- | date ) ) ); ?> |
- title ); ?> |
- category_name ); ?> |
- distance, 2, ',', ' ' ); ?> km |
- duration ); ?> |
- equipment_name ); ?> |
-
- avg_speed || $row->avg_heart_rate || $row->avg_cadence ) : ?>
-
-
-
-
-
- avg_speed ) { echo '| Śr. prędkość | '; } ?>
- avg_heart_rate ) { echo 'Śr. tętno | '; } ?>
- avg_cadence ) { echo 'Śr. kadencja | '; } ?>
-
-
-
-
- avg_speed ) { echo '| ' . number_format( $row->avg_speed, 1, ',', ' ' ) . ' km/h | '; } ?>
- avg_heart_rate ) { echo '' . $row->avg_heart_rate . ' bpm | '; } ?>
- avg_cadence ) { echo '' . $row->avg_cadence . ' rpm | '; } ?>
-
-
-
- |
-
-
-
-
-
- | Brak aktywności w tym miesiącu. |
-
-
-
-
+
+
+ icon, 'groups' ) !== false ) { $material_icon = 'directions_bike'; }
+ elseif ( strpos( $row->icon, 'businessman' ) !== false ) { $material_icon = 'directions_run'; }
+ $bg_color = !empty($row->color) ? $row->color : '#1a73e8';
+ ?>
+
+
+
+
+
+
title ); ?>
+
+ date ) ) ); ?>
+ •
+ category_name ); ?>
+ equipment_name ) : ?>
+ •
+ equipment_name ); ?>
+
+
+
+
+
Dystansdistance, 2, ',', ' ' ); ?> km
+
Czasduration ); ?>
+ avg_speed ) : ?>
Śr. prędkośćavg_speed, 1, ',', ' ' ); ?> km/h
+ avg_heart_rate ) : ?>
Śr. tętnoavg_heart_rate ); ?> bpm
+
+
+
+
+
+
Brak aktywności w tym miesiącu.
+
+
+
';
- echo '
' . esc_html( $label ) . ' | ';
- echo '
' . esc_html( $value ) . ( $unit ? ' ' . esc_html( $unit ) : '' ) . ' | ';
- echo '';
+ echo '
';
+ echo '' . esc_html( $label ) . '';
+ echo '' . esc_html( $value ) . ( $unit ? ' ' . esc_html( $unit ) : '' ) . '';
+ echo '
';
}
};
@@ -323,32 +340,36 @@ function statpress_single_activity_shortcode_handler( $atts ) {
}
?>
-
-
title ); ?>
-
date ) ) ); ?>
+
+
-
-
-
-
- distance, 2, ',', ' ' ), 'km' ); ?>
- duration ); ?>
- avg_speed, 1, ',', ' ' ), 'km/h' ); ?>
- total_elevation_gain, 'm' ); ?>
-
-
-
-
-
-
- category_name ); ?>
- equipment_name ); ?>
- strava_url ) ) : ?>
- | Strava | Zobacz aktywność |
-
-
-
+
+
+
+ distance, 2, ',', ' ' ), 'km' ); ?>
+ duration ); ?>
+ avg_speed, 1, ',', ' ' ), 'km/h' ); ?>
+ total_elevation_gain, 'm' ); ?>
+ category_name ); ?>
+ equipment_name ); ?>
+ strava_url ) ) : ?>
+
+
diff --git a/moje-statystyki.php b/moje-statystyki.php
index 2db0b9f..ceaab63 100644
--- a/moje-statystyki.php
+++ b/moje-statystyki.php
@@ -43,6 +43,115 @@ add_action( 'admin_menu', 'statpress_add_admin_menu' );
add_action( 'admin_init', 'statpress_admin_init_setup' );
add_action( 'admin_enqueue_scripts', 'statpress_enqueue_admin_styles' );
+add_action( 'admin_enqueue_scripts', 'statpress_enqueue_material_assets' );
+function statpress_enqueue_material_assets() {
+ $screen = get_current_screen();
+ if ( $screen && strpos( $screen->id, 'statpress' ) !== false ) {
+ wp_enqueue_style( 'google-fonts-roboto', 'https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap', false );
+ wp_enqueue_style( 'google-material-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons', false );
+ }
+}
+
+add_action( 'admin_head', 'statpress_material_design_styles' );
+function statpress_material_design_styles() {
+ $screen = get_current_screen();
+ if ( ! $screen || strpos( $screen->id, 'statpress' ) === false ) {
+ return;
+ }
+ ?>
+
+