Improve feed list and add feed page

This commit is contained in:
2023-07-07 16:03:12 -04:00
parent 3f028c3088
commit f69d0f2752
8 changed files with 88 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ use sqlx::PgPool;
use crate::error::Result;
use crate::models::feed::get_feeds;
use crate::partials::layout::Layout;
use crate::uuid::Base62Uuid;
pub async fn get(State(pool): State<PgPool>, layout: Layout) -> Result<Response> {
let feeds = get_feeds(&pool).await?;
@@ -13,7 +14,8 @@ pub async fn get(State(pool): State<PgPool>, layout: Layout) -> Result<Response>
ul {
@for feed in feeds {
@let title = feed.title.unwrap_or_else(|| "Untitled Feed".to_string());
li { (title) }
@let feed_url = format!("/feed/{}", Base62Uuid::from(feed.feed_id));
li { a href=(feed_url) { (title) } }
}
}
}))