-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render the changelog in the admin interface
Make it easier for admins to read about new features that have been added to Alaveteli from within Alaveteli itself.
- Loading branch information
1 parent
deb0b4e
commit 4f33923
Showing
7 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<% @title = 'Alaveteli Changelog' %> | ||
|
||
<h1><%= @title %></h1> | ||
|
||
<p> | ||
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 | ||
<a href="https://github.com/mysociety/alaveteli/releases">newer releases of | ||
Alaveteli</a> and preview upcoming changes in the | ||
<a href="https://github.com/mysociety/alaveteli/blob/develop/doc/CHANGES.md"> | ||
development version of the changelog</a>. | ||
</p> | ||
|
||
<hr /> | ||
|
||
<%= @changelog %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe Admin::ChangelogController do | ||
describe 'GET index' do | ||
render_views | ||
|
||
before do | ||
get :index | ||
end | ||
|
||
it 'renders the changelog as HTML' do | ||
expect(response.body).to match('<h2>Highlighted Features</h2>') | ||
end | ||
end | ||
end |