~vpzom/hitide

a5a4ab8c45275257921cda0821989397a64927d2 — Colin Reeder 10 days ago eea36b3
Minimal compat for changes to post list (no actual pagination yet)
2 files changed, 9 insertions(+), 9 deletions(-)

M src/routes/communities.rs
M src/routes/mod.rs
M src/routes/communities.rs => src/routes/communities.rs +3 -3
@@ 288,7 288,7 @@ async fn page_community(
    .await?;
    let posts_api_res = hyper::body::to_bytes(posts_api_res.into_body()).await?;

    let posts: Vec<RespPostListPost<'_>> = serde_json::from_slice(&posts_api_res)?;
    let posts: RespList<RespPostListPost<'_>> = serde_json::from_slice(&posts_api_res)?;

    let new_post_url = format!("/communities/{}/new_post", community_id);



@@ 399,14 399,14 @@ async fn page_community(
                }
            </div>
            {
                if posts.is_empty() {
                if posts.items.is_empty() {
                    Some(render::rsx! { <p>{lang.tr("nothing", None)}</p> })
                } else {
                    None
                }
            }
            <ul>
                {posts.iter().map(|post| {
                {posts.items.iter().map(|post| {
                    PostItem { post, in_community: true, no_user: false, lang: &lang }
                }).collect::<Vec<_>>()}
            </ul>

M src/routes/mod.rs => src/routes/mod.rs +6 -6
@@ 1883,13 1883,13 @@ async fn page_all_inner(
    .await?;

    let api_res = hyper::body::to_bytes(api_res.into_body()).await?;
    let api_res: Vec<RespPostListPost<'_>> = serde_json::from_slice(&api_res)?;
    let api_res: RespList<RespPostListPost<'_>> = serde_json::from_slice(&api_res)?;

    Ok(html_response(render::html! {
        <HTPage base_data={&base_data} lang={&lang} title={"lotide"}>
            <h1>{lang.tr("all_title", None)}</h1>
            {
                if api_res.is_empty() {
                if api_res.items.is_empty() {
                    Some(render::rsx! {
                        <p>
                            {lang.tr("nothing_yet", None)}


@@ 1900,7 1900,7 @@ async fn page_all_inner(
                }
            }
            <ul>
                {api_res.iter().map(|post| {
                {api_res.items.iter().map(|post| {
                    PostItem { post, in_community: false, no_user: false, lang: &lang }
                }).collect::<Vec<_>>()}
            </ul>


@@ 1936,13 1936,13 @@ async fn page_local(
    .await?;

    let api_res = hyper::body::to_bytes(api_res.into_body()).await?;
    let api_res: Vec<RespPostListPost<'_>> = serde_json::from_slice(&api_res)?;
    let api_res: RespList<RespPostListPost<'_>> = serde_json::from_slice(&api_res)?;

    Ok(html_response(render::html! {
        <HTPage base_data={&base_data} lang={&lang} title={"lotide"}>
            <h1>{lang.tr("local_title", None)}</h1>
            {
                if api_res.is_empty() {
                if api_res.items.is_empty() {
                    Some(render::rsx! {
                        <p>
                            {lang.tr("nothing_yet", None)}


@@ 1953,7 1953,7 @@ async fn page_local(
                }
            }
            <ul>
                {api_res.iter().map(|post| {
                {api_res.items.iter().map(|post| {
                    PostItem { post, in_community: false, no_user: false, lang: &lang }
                }).collect::<Vec<_>>()}
            </ul>