diff --git a/app/assets/javascripts/sitewide/about_modal.js b/app/assets/javascripts/sitewide/about_modal.js
new file mode 100644
index 000000000..ca558059a
--- /dev/null
+++ b/app/assets/javascripts/sitewide/about_modal.js
@@ -0,0 +1,9 @@
+(function() {
+ 'use strict';
+
+ $(document).ready(function() {
+ $("[data-trigger='about-modal']").on('click', function() {
+ $('[data-role=about-modal]').modal('show');
+ });
+ });
+})();
diff --git a/app/helpers/addons_helper.rb b/app/helpers/addons_helper.rb
new file mode 100644
index 000000000..150af4976
--- /dev/null
+++ b/app/helpers/addons_helper.rb
@@ -0,0 +1,8 @@
+module AddonsHelper
+ def list_all_addons
+ Rails::Engine
+ .subclasses
+ .select { |c| c.name.start_with?('Scinote') }
+ .map(&:parent)
+ end
+end
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 4b7027acf..a508c5f48 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -45,6 +45,9 @@
+
+ <%= render "shared/about_modal" %>
+
<%= render "shared/navigation" %>
diff --git a/app/views/shared/_about_modal.html.erb b/app/views/shared/_about_modal.html.erb
new file mode 100644
index 000000000..3d2deeb92
--- /dev/null
+++ b/app/views/shared/_about_modal.html.erb
@@ -0,0 +1,28 @@
+
+
+
+
+
+
<%= t('about.core_version') %>
+
+ <%= Scinote::Application::VERSION %>
+
+
+
+ <%= t('about.addon_versions') %>
+
+ <% list_all_addons.each do |addon| %>
+ <%= "#{addon.name}:" %>
+
+ <%= addon::VERSION %>
+
+
+ <% end %>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/shared/_navigation.html.erb b/app/views/shared/_navigation.html.erb
index 1c9affa91..17f3a5281 100644
--- a/app/views/shared/_navigation.html.erb
+++ b/app/views/shared/_navigation.html.erb
@@ -234,6 +234,12 @@
<%= link_to t('nav.help.contact'),
Constants::CONTACT_URL,
target: "_blank" %>
+
+
+ <%= link_to '#', data: { trigger: 'about-modal' } do %>
+ <%= t('nav.help.about') %>
+ <% end %>
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6dce7f8ec..fa31517ed 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -72,6 +72,7 @@ en:
support: "Customer support"
premium: "Premium"
contact: "Contact us"
+ about: "About sciNote"
activities:
none: "No activities!"
label:
@@ -87,6 +88,11 @@ en:
info: "Info"
account: "Account"
+ about:
+ modal_title: "About sciNote"
+ core_version: "sciNote core version"
+ addon_versions: "Addon versions"
+
sidebar:
title: "Navigation"
no_module_group: "No workflow"
diff --git a/lib/generators/addon/addon_generator.rb b/lib/generators/addon/addon_generator.rb
index 5ef5a0892..8b4c51376 100644
--- a/lib/generators/addon/addon_generator.rb
+++ b/lib/generators/addon/addon_generator.rb
@@ -114,12 +114,16 @@ class AddonGenerator < Rails::Generators::NamedBase
gsub_file(file_path, '${ADDON_NAME}', @addon_name)
# lib/.../version.rb
+ dots = @modules.map { '/..' }.join
create_file(
"addons/#{@addon_name}/lib/" \
"#{@folders_path}/version.rb"
) do
embed_into_modules do
- "VERSION = '0.0.1'.freeze\n"
+ "VERSION =\n" \
+ " File.read(\n" \
+ " \"\#{File.dirname(__FILE__)}#{dots}/../VERSION\"\n" \
+ " ).strip.freeze\n"
end
end
@@ -182,6 +186,7 @@ class AddonGenerator < Rails::Generators::NamedBase
gsub_file(file_path, '${FULL_UNDERSCORE_NAME}', @full_underscore_name)
gsub_file(file_path, '${NAME}', name)
gsub_file(file_path, '${FOLDERS_PATH}', @folders_path)
+ create_file("addons/#{@addon_name}/VERSION") { '0.0.1' }
# Rakefile
file_path = "addons/#{@addon_name}/Rakefile"