From 5366218697c64a61eecffb2742b2f8f5180f0a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20Fefli=C5=84ski?= Date: Wed, 22 Apr 2026 13:25:17 +0200 Subject: [PATCH] Singla activity --- assets/css/admin.css | 20 +++--- includes/admin/pages/page-activity-view.php | 79 +++++++++++---------- 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/assets/css/admin.css b/assets/css/admin.css index a996ae3..d664e81 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -26,18 +26,6 @@ margin-bottom: 0; } -/* Kontener dla szczegółów aktywności */ -#statpress-details-container { - display: flex; - flex-wrap: wrap; - gap: 2%; -} -/* Szczegóły aktywności */ -.statpress-details-col { - flex: 1 1 48%; /* Pozwala na elastyczne dopasowanie, z bazową szerokością 48% */ - min-width: 300px; /* Zapobiega zbytniemu ściskaniu kolumn na mniejszych ekranach */ -} - /* Chart Controls */ .statpress-chart-controls { display: flex; @@ -202,5 +190,13 @@ .statpress-progress-bar { background: #1a73e8; height: 100%; border-radius: 10px; transition: width 0.5s ease-in-out; text-align: center; color: white; font-size: 12px; line-height: 20px; font-weight: 500; } .statpress-progress-bar-container.small .statpress-progress-bar { line-height: 12px; font-size: 0; } +/* Grid danych dla widoków (np. szczegóły aktywności) */ +.statpress-single-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; } +.statpress-single-data-item { display: flex; flex-direction: column; } +.statpress-single-data-label { font-size: 12px; color: #5f6368; text-transform: uppercase; font-weight: 500; margin-bottom: 4px; } +.statpress-single-data-value { font-size: 15px; color: #202124; font-weight: 500; } +.statpress-single-data-value a { color: #1a73e8; text-decoration: none; } +.statpress-single-data-value a:hover { text-decoration: underline; } + /* Inne */ .wrap hr { border: 0; height: 1px; background: #dadce0; margin: 24px 0; } diff --git a/includes/admin/pages/page-activity-view.php b/includes/admin/pages/page-activity-view.php index cf0d5a1..7682753 100644 --- a/includes/admin/pages/page-activity-view.php +++ b/includes/admin/pages/page-activity-view.php @@ -38,12 +38,12 @@ function statpress_view_activity_page() { } // Funkcja pomocnicza do wyświetlania wiersza, jeśli wartość istnieje - $render_row = function( $label, $value, $unit = '' ) { + $render_row = function( $label, $value, $unit = '', $is_html = false ) { if ( ! is_null( $value ) && '' !== $value ) { - echo ''; - echo '' . esc_html( $label ) . ''; - echo '' . esc_html( $value ) . ( $unit ? ' ' . esc_html( $unit ) : '' ) . ''; - echo ''; + echo '
'; + echo '' . esc_html( $label ) . ''; + echo '' . ( $is_html ? wp_kses_post( $value ) : esc_html( $value ) ) . ( $unit ? ' ' . esc_html( $unit ) : '' ) . ''; + echo '
'; } }; @@ -169,46 +169,47 @@ function statpress_view_activity_page() {

Podsumowanie

-
-
-

Główne dane

- - category_name ); ?> - date ); ?> - distance, 2, ',', ' ' ), 'km' ); ?> - duration ); ?> - calories, 'kcal' ); ?> - event_type_name ); ?> - equipment_name ); ?> -
-
-
-

Dane szczegółowe

- - avg_speed, 1, ',', ' ' ), 'km/h' ); ?> - max_speed, 1, ',', ' ' ), 'km/h' ); ?> - avg_heart_rate, 'bpm' ); ?> - max_heart_rate, 'bpm' ); ?> - avg_cadence, 'rpm' ); ?> - max_cadence, 'rpm' ); ?> - total_elevation_gain, 'm' ); ?> - total_elevation_loss, 'm' ); ?> - min_altitude, 'm n.p.m.' ); ?> - max_altitude, 'm n.p.m.' ); ?> -
-
+

Główne dane

+
+ category_name ); ?> + date ) ) ); ?> + distance, 2, ',', ' ' ), 'km' ); ?> + duration ); ?> + calories, 'kcal' ); ?> + event_type_name ); ?> + equipment_name ); ?>

-

Notatki i linki

- - comment ) ); ?> +

Dane szczegółowe

+
+ avg_speed, 1, ',', ' ' ), 'km/h' ); ?> + max_speed, 1, ',', ' ' ), 'km/h' ); ?> + avg_heart_rate, 'bpm' ); ?> + max_heart_rate, 'bpm' ); ?> + avg_cadence, 'rpm' ); ?> + max_cadence, 'rpm' ); ?> + total_elevation_gain, 'm' ); ?> + total_elevation_loss, 'm' ); ?> + min_altitude, 'm n.p.m.' ); ?> + max_altitude, 'm n.p.m.' ); ?> +
+
+

Notatki i linki

+
+ comment ) ), '', true ); ?> strava_url ) ) : ?> -
+ gpx_url ) ) : ?> - +
+ Plik GPX + Pobierz plik GPX +
-
StravaZobacz aktywność na Strava
Plik GPXPobierz plik GPX
+