Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

WIP: Display wiki history diff instead of journal diff

Mir Bhatia006023a896f2
diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb
index 15b3d09b7f4..0b373d83374 100644
--- a/app/models/wiki_content.rb
+++ b/app/models/wiki_content.rb
@@ -35,7 +35,7 @@ class WikiContent < ApplicationRecord
acts_as_journalized
- # register_journal_formatted_fields(:diff, 'text')
+ register_journal_formatted_fields(:diff, 'text')
acts_as_event type: 'wiki-page',
title: Proc.new { |o|
diff --git a/lib/open_project/journal_formatter/diff.rb b/lib/open_project/journal_formatter/diff.rb
index 2d9f691fca7..e65c278698e 100644
--- a/lib/open_project/journal_formatter/diff.rb
+++ b/lib/open_project/journal_formatter/diff.rb
@@ -77,6 +77,18 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base
activity_page: options[:activity_page])
.compact
+ # Condition needed
+
+ # binding.pry
+ # url_attr = default_attributes(options)
+ # .merge(controller: '/wiki',
+ # action: 'diff',
+ # project_id: @journal.journable.project.identifier,
+ # id: @journal.journable.page.slug,
+ # version: @journal.version-1,
+ # version_from: @journal.version)
+ # .compact
+
if options[:html]
link_to(I18n.t(:label_details),
url_attr,
@@ -86,6 +98,9 @@ class OpenProject::JournalFormatter::Diff < JournalFormatter::Base
end
end
+
+
+
def default_attributes(options)
if options[:only_path]
{ only_path: options[:only_path],