mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-25 23:51:09 +00:00
Include domain when generating diff link (fixes #23)
This commit is contained in:
parent
7c7068b619
commit
8188296b88
1 changed files with 2 additions and 1 deletions
|
@ -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<_>>()
|
||||||
|
|
Loading…
Reference in a new issue