From 5acca0ddb7a558d48836eac94e6b56943fb8e756 Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Mon, 6 Nov 2017 15:58:16 +0100 Subject: [PATCH] Add links to the article before and after diff --- src/resources/diff_resource.rs | 4 ++++ templates/diff.html | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resources/diff_resource.rs b/src/resources/diff_resource.rs index 36b24d8..bdc7db9 100644 --- a/src/resources/diff_resource.rs +++ b/src/resources/diff_resource.rs @@ -102,6 +102,8 @@ impl Resource for DiffResource { consecutive: bool, article_id: u32, article_history_link: &'a str, + from_link: &'a str, + to_link: &'a str, title: &'a [Diff], lines: &'a [Diff<&'a str>], } @@ -130,6 +132,8 @@ impl Resource for DiffResource { .pagination(Pagination::After(self.from.revision)) .into_link() ), + from_link: &format!("_revisions/{}/{}", self.from.article_id, self.from.revision), + to_link: &format!("_revisions/{}/{}", self.to.article_id, self.to.revision), title: &diff::chars(&self.from.title, &self.to.title) .into_iter() .map(|x| match x { diff --git a/templates/diff.html b/templates/diff.html index aec2e35..d450bdb 100644 --- a/templates/diff.html +++ b/templates/diff.html @@ -7,7 +7,8 @@

- See the list of all changes to this article. + See also the list of all changes to this article + or the article as it was before and after this change.