1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-22 21:41:09 +00:00

Include domain when generating diff link (fixes #23)

This commit is contained in:
Felix Ableitner 2024-03-14 10:25:16 +01:00
parent 7c7068b619
commit 8188296b88

View file

@ -5,6 +5,7 @@ use crate::frontend::{
user_link, user_link,
}; };
use leptos::*; use leptos::*;
use crate::frontend::extract_domain;
#[component] #[component]
pub fn ArticleHistory() -> impl IntoView { pub fn ArticleHistory() -> impl IntoView {
@ -19,7 +20,7 @@ pub fn ArticleHistory() -> impl IntoView {
<h1>{article_title(&article.article)}</h1> <h1>{article_title(&article.article)}</h1>
{ {
article.edits.into_iter().rev().map(|edit| { article.edits.into_iter().rev().map(|edit| {
let path = format!("/article/{}/diff/{}", article.article.title, edit.edit.hash.0); let path = format!("/article/{}@{}/diff/{}", article.article.title, extract_domain(&article.article.ap_id), edit.edit.hash.0);
let label = format!("{} ({})", edit.edit.summary, edit.edit.created.to_rfc2822()); let label = format!("{} ({})", edit.edit.summary, edit.edit.created.to_rfc2822());
view! {<li><a href={path}>{label}</a>" by "{user_link(&edit.creator)}</li> } view! {<li><a href={path}>{label}</a>" by "{user_link(&edit.creator)}</li> }
}).collect::<Vec<_>>() }).collect::<Vec<_>>()