Shortcode

This commit is contained in:
2026-01-29 22:21:15 +01:00
parent 87da77584f
commit a7db042d7c
2 changed files with 62 additions and 0 deletions
+39
View File
@@ -15,11 +15,50 @@
.mystats-shortcode-container th {
background-color: #f4f4f4;
}
.mystats-activity-table td:nth-child(4),
.mystats-activity-table td:nth-child(5) {
text-align: right;
}
/* Styles for the nested details table */
.mystats-activity-details-row > .mystats-activity-details-cell {
padding: 0 !important;
border-top: none;
border-bottom: 1px solid #ddd;
}
.mystats-nested-details-table {
width: 100%;
margin: 0;
background-color: #fdfdfd;
border: none !important;
border-collapse: collapse;
}
.mystats-nested-details-table th,
.mystats-nested-details-table td {
border: none !important;
padding: 6px 12px;
text-align: center;
font-size: 0.9em;
width: 33.33%;
}
.mystats-nested-details-table th {
background-color: transparent;
font-weight: normal;
color: #777;
padding-top: 8px;
padding-bottom: 2px;
}
.mystats-nested-details-table td {
font-weight: bold;
padding-top: 0;
padding-bottom: 8px;
}
/* Shortcode [moje_statystyki_wpis] */
.mystat-single-activity-shortcode {
border: 1px solid #eee;
+23
View File
@@ -1915,6 +1915,7 @@ function mystat_shortcode_handler( $atts ) {
<th>Data</th>
<th>Tytuł</th>
<th>Kategoria</th>
<th>Dystans</th>
<th>Czas</th>
<th>Sprzęt</th>
@@ -1931,6 +1932,28 @@ function mystat_shortcode_handler( $atts ) {
<td><?php echo esc_html( $row->duration ); ?></td>
<td><?php echo esc_html( $row->equipment_name ); ?></td>
</tr>
<?php if ( $row->avg_speed || $row->avg_heart_rate || $row->avg_cadence ) : ?>
<tr class="mystats-activity-details-row">
<td colspan="6" class="mystats-activity-details-cell">
<table class="mystats-nested-details-table">
<thead>
<tr>
<?php if ($row->avg_speed) echo '<th>Śr. prędkość</th>'; ?>
<?php if ($row->avg_heart_rate) echo '<th>Śr. tętno</th>'; ?>
<?php if ($row->avg_cadence) echo '<th>Śr. kadencja</th>'; ?>
</tr>
</thead>
<tbody>
<tr>
<?php if ($row->avg_speed) echo '<td>' . number_format( $row->avg_speed, 1, ',', ' ' ) . ' km/h</td>'; ?>
<?php if ($row->avg_heart_rate) echo '<td>' . $row->avg_heart_rate . ' bpm</td>'; ?>
<?php if ($row->avg_cadence) echo '<td>' . $row->avg_cadence . ' rpm</td>'; ?>
</tr>
</tbody>
</table>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<tr>