From c932a0920c7f1b82c7e3e0998d09e1e96985dc23 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 29 Aug 2013 13:48:54 +0000 Subject: [PATCH] * VRFS-586 - adding version info to jam-admin (not hidden like it is in jam-web --- app/assets/stylesheets/custom.css.scss | 4 ++++ app/helpers/meta_helper.rb | 7 +++++++ app/views/layouts/application.html.erb | 1 + build | 7 +++++++ config/application.rb | 2 +- config/initializers/active_admin.rb | 10 ++++++++++ lib/jam_admin/version.rb | 3 +++ 7 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/custom.css.scss create mode 100644 app/helpers/meta_helper.rb create mode 100644 lib/jam_admin/version.rb diff --git a/app/assets/stylesheets/custom.css.scss b/app/assets/stylesheets/custom.css.scss new file mode 100644 index 000000000..bbaf0546b --- /dev/null +++ b/app/assets/stylesheets/custom.css.scss @@ -0,0 +1,4 @@ +.version-info { + font-size:small; + color:lightgray; +} \ No newline at end of file diff --git a/app/helpers/meta_helper.rb b/app/helpers/meta_helper.rb new file mode 100644 index 000000000..9024d451b --- /dev/null +++ b/app/helpers/meta_helper.rb @@ -0,0 +1,7 @@ +module MetaHelper + + def version() + "web=#{::JamAdmin::VERSION} lib=#{JamRuby::VERSION} db=#{JamDb::VERSION}" + end + +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b19a0b0c8..ad1c7afbd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,5 +12,6 @@

<%= alert %>

<%= yield %> +
<%= version %>
diff --git a/build b/build index c60445a4d..06993f7ef 100755 --- a/build +++ b/build @@ -41,6 +41,13 @@ if [ -n "$PACKAGE" ]; then exit 1 fi + cat > lib/jam_web/version.rb << EOF +module JamWeb + VERSION = "0.1.$BUILD_NUMBER" +end +EOF + + type -P dpkg-architecture > /dev/null diff --git a/config/application.rb b/config/application.rb index 82b6a9bf8..5b76766e9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,7 +24,7 @@ module JamAdmin # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) + config.autoload_paths += %W(#{config.root}/lib) # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. diff --git a/config/initializers/active_admin.rb b/config/initializers/active_admin.rb index df2ef1086..1b7899669 100644 --- a/config/initializers/active_admin.rb +++ b/config/initializers/active_admin.rb @@ -1,3 +1,11 @@ +class Footer < ActiveAdmin::Component + def build + super(id: "footer") + para "version info: web=#{::JamAdmin::VERSION} lib=#{JamRuby::VERSION} db=#{JamDb::VERSION}" + end +end + + ActiveAdmin.setup do |config| # == Site Title @@ -149,4 +157,6 @@ ActiveAdmin.setup do |config| # # Set the CSV builder options (default is {}) # config.csv_options = {} + + config.view_factory.footer = Footer end diff --git a/lib/jam_admin/version.rb b/lib/jam_admin/version.rb new file mode 100644 index 000000000..f74617447 --- /dev/null +++ b/lib/jam_admin/version.rb @@ -0,0 +1,3 @@ +module JamAdmin + VERSION = "0.0.1" +end \ No newline at end of file