~vpzom/hitide

ec9a80efb3340d4254c460526cd698baa9a92314 — Colin Reeder 4 months ago 69ec042
Limit post titles to one line in lists
2 files changed, 24 insertions(+), 14 deletions(-)

M res/main.css
M src/components/mod.rs
M res/main.css => res/main.css +12 -0
@@ 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;
}

M src/components/mod.rs => src/components/mod.rs +12 -14
@@ 299,22 299,20 @@ pub fn PostItem<'a>(
) {
    render::rsx! {
        <li>
            <a href={format!("/posts/{}", post.as_ref().as_ref().id)}>
                {post.as_ref().as_ref().title.as_ref()}
            </a>
            {
                if let Some(href) = &post.as_ref().href {
                    Some(render::rsx! {
                        <>
                            {" "}
            <div class={"titleLine"}>
                <a href={format!("/posts/{}", post.as_ref().as_ref().id)}>
                    {post.as_ref().as_ref().title.as_ref()}
                </a>
                {
                    if let Some(href) = &post.as_ref().href {
                        Some(render::rsx! {
                            <em><a href={href.as_ref()}>{abbreviate_link(&href)}{" ↗"}</a></em>
                        </>
                    })
                } else {
                    None
                        })
                    } else {
                        None
                    }
                }
            }
            <br />
            </div>
            <small>
                {lang.tr("submitted", None)}
                {" "}