1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-26 00:01: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,
};
use leptos::*;
use crate::frontend::extract_domain;
#[component]
pub fn ArticleHistory() -> impl IntoView {
@ -19,7 +20,7 @@ pub fn ArticleHistory() -> impl IntoView {
<h1>{article_title(&article.article)}</h1>
{
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());
view! {<li><a href={path}>{label}</a>" by "{user_link(&edit.creator)}</li> }
}).collect::<Vec<_>>()