~vpzom/hitide

f1832eb5e889719ab9e39afcc911facc7a524b15 — Colin Reeder a month ago c77c9ec
Show instance description on about page
2 files changed, 23 insertions(+), 8 deletions(-)

M src/resp_types.rs
M src/routes/mod.rs
M src/resp_types.rs => src/resp_types.rs +2 -0
@@ 195,6 195,8 @@ pub struct RespInstanceSoftwareInfo<'a> {

#[derive(Deserialize, Debug)]
pub struct RespInstanceInfo<'a> {
    #[serde(default)]
    pub description: Cow<'a, str>,
    pub software: RespInstanceSoftwareInfo<'a>,
}


M src/routes/mod.rs => src/routes/mod.rs +21 -8
@@ 146,15 146,28 @@ async fn page_about(
        <HTPage base_data={&base_data} lang={&lang} title={&title}>
            <h1>{title.as_ref()}</h1>
            {
                lang.tr(
                    "about_versions",
                    Some(&fluent::fluent_args![
                        "hitide_version" => env!("CARGO_PKG_VERSION"),
                        "backend_name" => api_res.software.name,
                        "backend_version" => api_res.software.version
                    ])
                )
                if api_res.description == "" {
                    None
                } else {
                    Some(render::rsx! {
                        <p>
                            {Some(api_res.description)}
                        </p>
                    })
                }
            }
            <p>
                {
                    lang.tr(
                        "about_versions",
                        Some(&fluent::fluent_args![
                            "hitide_version" => env!("CARGO_PKG_VERSION"),
                            "backend_name" => api_res.software.name,
                            "backend_version" => api_res.software.version
                        ])
                    )
                }
            </p>
            <h2>{lang.tr("about_what_is", None)}</h2>
            <p>
                {lang.tr("about_text1", None)}