Dynamic layout vs screen size

This commit is contained in:
Alexandre
2024-11-27 15:39:44 +01:00
committed by Nachtzuster
parent aede3cc8b7
commit f231f5e9dc
+11 -7
View File
@@ -400,20 +400,20 @@ function display_species($species_list, $title, $show_last_seen=false) {
$image_url = $image[1] ?? ""; // Get the image URL if available $image_url = $image[1] ?? ""; // Get the image URL if available
} }
$last_seen_text = "";
if ($show_last_seen && isset($todaytable['DaysAgo'])) { if ($show_last_seen && isset($todaytable['DaysAgo'])) {
$days_ago = $todaytable['DaysAgo']; $days_ago = $todaytable['DaysAgo'];
if ($days_ago > 30) { if ($days_ago > 30) {
$months_ago = floor($days_ago / 30); $months_ago = floor($days_ago / 30);
$last_seen_text = "<br><i>Last: {$months_ago}mo ago</i>"; $last_seen_text = "<br><i><span class='text left'>Last seen: </span>{$months_ago}mo ago</i>";
} else { } else {
$last_seen_text = "<br><i>Last: {$days_ago}d ago</i>"; $last_seen_text = "<br><i><span class='text left'>Last seen: </span>{$days_ago}d ago</i>";
} }
} }
$time_occurrence_text = "<br>{$todaytable['Time']}"; $occurrence_text = "";
if (isset($todaytable['OccurrenceCount']) && $todaytable['OccurrenceCount'] > 1) { if (isset($todaytable['OccurrenceCount']) && $todaytable['OccurrenceCount'] > 1) {
$time_occurrence_text .= " ({$todaytable['OccurrenceCount']}x)"; $occurrence_text = " ({$todaytable['OccurrenceCount']}x)";
} }
?> ?>
<tr class="relative" id="<?php echo $iterations; ?>"> <tr class="relative" id="<?php echo $iterations; ?>">
@@ -434,8 +434,12 @@ function display_species($species_list, $title, $show_last_seen=false) {
</i> </i>
</form></div> </form></div>
</td> </td>
<td style="white-space: nowrap;">Confidence: <?php echo round($todaytable['Confidence'] * 100 ) . '%'; echo $last_seen_text; echo $time_occurrence_text; ?><br></td> <td style="white-space: nowrap;"><?php
</tr> echo '<span class="text left">Max Confidence: </span>' . round($todaytable['Confidence'] * 100 ) . '%' . $occurrence_text;
echo "<br><span class='text left'>First detection: </span>{$todaytable['Time']}";
echo $last_seen_text;
?></td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<?php endif; ?> <?php endif; ?>