From 345fd545bf6d5f161686a09c4583a1e7488fd9c6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 12 Feb 2015 20:31:55 -0800 Subject: Add version check badge to admin area --- app/helpers/version_check_helper.rb | 5 +++++ app/views/admin/dashboard/index.html.haml | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/helpers/version_check_helper.rb (limited to 'app') diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb new file mode 100644 index 00000000000..63d8eaeb2bd --- /dev/null +++ b/app/helpers/version_check_helper.rb @@ -0,0 +1,5 @@ +module VersionCheckHelper + def version_status_badge + image_tag VersionCheck.new.url + end +end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index d1c586328a2..6b4ff4b330d 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -56,7 +56,11 @@ %span.light.pull-right = boolean_to_icon Gitlab.config.omniauth.enabled .col-md-4 - %h4 Components + %h4 + Components + .pull-right + = version_status_badge + %hr %p GitLab -- cgit v1.2.1 From deb384a73bf92444ba5e64d3147409faca8b8d7a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 23 Feb 2015 21:48:02 -0800 Subject: Prevent crash if file does not exists --- app/helpers/version_check_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index 63d8eaeb2bd..df0e25b9f6e 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -1,5 +1,7 @@ module VersionCheckHelper def version_status_badge - image_tag VersionCheck.new.url + if File.exists?(Rails.root.join('safe', 'public.pem')) + image_tag VersionCheck.new.url + end end end -- cgit v1.2.1 From 73179685b0517dcdebe696b5987b47822b9bf6ed Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 9 Mar 2015 21:03:24 -0700 Subject: Add version check to help page too --- app/views/help/index.html.haml | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index af39dfeac5b..e2276260189 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -3,6 +3,7 @@ GitLab %span= Gitlab::VERSION %small= Gitlab::REVISION + = version_status_badge %p.slead GitLab is open source software to collaborate on code. %br -- cgit v1.2.1 From 100d750bc5ec4c6c5be11eb6f4100fe38b4ddee7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 10 Mar 2015 12:51:46 -0700 Subject: Add feature to disable version check --- app/controllers/admin/application_settings_controller.rb | 3 ++- app/views/admin/application_settings/_form.html.haml | 6 ++++++ app/views/admin/dashboard/index.html.haml | 5 +++-- app/views/help/index.html.haml | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 2b0c500e97a..5973af71267 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -28,7 +28,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :gravatar_enabled, :twitter_sharing_enabled, :sign_in_text, - :home_page_url + :home_page_url, + :version_check_enabled ) end end diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index ac64d26f9aa..cab5688a499 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -24,6 +24,12 @@ .col-sm-10 = f.check_box :twitter_sharing_enabled, class: 'checkbox form-control', :'aria-describedby' => 'twitter_help_block' %span.help-block#twitter_help_block Show users a button to share their newly created public or internal projects on twitter + .form-group + .col-sm-offset-2.col-sm-10 + .checkbox + = f.label :version_check_enabled do + = f.check_box :version_check_enabled + Version check enabled %fieldset %legend Misc .form-group diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 6b4ff4b330d..3732ff847b9 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -58,8 +58,9 @@ .col-md-4 %h4 Components - .pull-right - = version_status_badge + - if current_application_settings.version_check_enabled + .pull-right + = version_status_badge %hr %p diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index e2276260189..bf4b7234b21 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -3,7 +3,8 @@ GitLab %span= Gitlab::VERSION %small= Gitlab::REVISION - = version_status_badge + - if current_application_settings.version_check_enabled + = version_status_badge %p.slead GitLab is open source software to collaborate on code. %br -- cgit v1.2.1 From f38ce01bc3b5a894d527550ca6a782567dfd19f9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 8 May 2015 15:14:56 +0300 Subject: Remove encryption Signed-off-by: Dmitriy Zaporozhets --- app/helpers/version_check_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app') diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb index df0e25b9f6e..63d8eaeb2bd 100644 --- a/app/helpers/version_check_helper.rb +++ b/app/helpers/version_check_helper.rb @@ -1,7 +1,5 @@ module VersionCheckHelper def version_status_badge - if File.exists?(Rails.root.join('safe', 'public.pem')) - image_tag VersionCheck.new.url - end + image_tag VersionCheck.new.url end end -- cgit v1.2.1