From 212a0f23bc894faf88e159560c113f504349cc05 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 29 Apr 2025 17:06:23 +0200 Subject: comiles again but still many logic holes --- ui/src/stats.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'ui/src/stats.rs') diff --git a/ui/src/stats.rs b/ui/src/stats.rs index c3e5a14..11163f3 100644 --- a/ui/src/stats.rs +++ b/ui/src/stats.rs @@ -5,6 +5,7 @@ */ use crate::{ + Page, format::{format_duration, format_duration_long, format_kind, format_size}, locale::{Language, tr, trs}, }; @@ -14,6 +15,15 @@ use jellycommon::{ }; use markup::raw; +impl Page for StatsPage<'_> { + fn title(&self) -> String { + tr(*self.lang, "stats.title").to_string() + } + fn to_render(&self) -> markup::DynRender { + markup::new!(@self) + } +} + markup::define! { StatsPage<'a>(lang: &'a Language, r: ApiStatsResponse) { .page.stats { @@ -57,12 +67,6 @@ markup::define! { } } -impl StatsPage<'_> { - pub fn title(&self) -> String { - tr(*self.lang, "stats.title").to_string() - } -} - trait BinExt { fn average_runtime(&self) -> f64; fn average_size(&self) -> f64; -- cgit v1.2.3-70-g09d2