From ec9a80efb3340d4254c460526cd698baa9a92314 Mon Sep 17 00:00:00 2001 From: Colin Reeder Date: Sun, 20 Dec 2020 15:18:57 -0700 Subject: Limit post titles to one line in lists --- res/main.css | 12 ++++++++++++ src/components/mod.rs | 26 ++++++++++++-------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/res/main.css b/res/main.css index 71a0e10..36359f5 100644 --- a/res/main.css +++ b/res/main.css @@ -113,6 +113,18 @@ body { padding-left: 0; } +.titleLine { + white-space: nowrap; + display: flex; + padding-right: .5em; +} +.titleLine > a { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + margin-right: .5em; +} + form.inline { display: inline-block; } diff --git a/src/components/mod.rs b/src/components/mod.rs index c0ad1dc..869f021 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -299,22 +299,20 @@ pub fn PostItem<'a>( ) { render::rsx! {
  • - - {post.as_ref().as_ref().title.as_ref()} - - { - if let Some(href) = &post.as_ref().href { - Some(render::rsx! { - <> - {" "} +
    + + {post.as_ref().as_ref().title.as_ref()} + + { + if let Some(href) = &post.as_ref().href { + Some(render::rsx! { {abbreviate_link(&href)}{" ↗"} - - }) - } else { - None + }) + } else { + None + } } - } -
    +
    {lang.tr("submitted", None)} {" "} -- cgit v1.2.3