diff --git a/Gemfile b/Gemfile index 104a6e8f43..c808b66827 100644 --- a/Gemfile +++ b/Gemfile @@ -114,6 +114,7 @@ gem 'recaptcha', '~> 5.15.0', require: 'recaptcha/rails' gem 'matrix', '~> 0.4.2' gem 'mini_magick', '~> 4.12.0' gem 'net-protocol', '~> 0.1.3' +gem 'redcarpet', '~> 3.6.0' gem 'redis', '~> 4.8.1' gem 'rolify', '~> 6.0.1' gem 'ruby-msg', '~> 1.5.0', git: 'https://github.com/mysociety/ruby-msg.git', branch: 'ascii-encoding' diff --git a/Gemfile.lock b/Gemfile.lock index e4fdcf8c60..9671e813a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -420,6 +420,7 @@ GEM rainbow (3.1.1) rake (13.0.6) recaptcha (5.15.0) + redcarpet (3.6.0) redis (4.8.1) redlock (1.3.2) redis (>= 3.0.0, < 6.0) @@ -627,6 +628,7 @@ DEPENDENCIES rails-controller-testing rails-i18n (~> 7.0.5) recaptcha (~> 5.15.0) + redcarpet (~> 3.6.0) redis (~> 4.8.1) rolify (~> 6.0.1) routing-filter (~> 0.7.0) diff --git a/app/controllers/admin/changelog_controller.rb b/app/controllers/admin/changelog_controller.rb new file mode 100644 index 0000000000..6a897f1f7e --- /dev/null +++ b/app/controllers/admin/changelog_controller.rb @@ -0,0 +1,9 @@ +# Controller to render the changelog notes in a more human-friendly way within +# the admin interface. +class Admin::ChangelogController < AdminController + def index + markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new) + text = File.read(Rails.root + 'doc/CHANGES.md') + @changelog = markdown.render(text).html_safe + end +end diff --git a/app/views/admin/changelog/index.html.erb b/app/views/admin/changelog/index.html.erb new file mode 100644 index 0000000000..4c57a74983 --- /dev/null +++ b/app/views/admin/changelog/index.html.erb @@ -0,0 +1,17 @@ +<% @title = 'Alaveteli Changelog' %> + +
+ The changelog documents the features and upgrade notes for each versioned + release of Alaveteli. Here you will see the changelog for the version of + Alaveteli you have installed. You can check GitHub for + newer releases of + Alaveteli and preview upcoming changes in the + + development version of the changelog. +
+ +