diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 2b0c500e97a084bd5e460870f31711fd031c0022..5973af7126778163d82c7915c87a990e6a97b028 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 ac64d26f9aacee5c5e341d085f8ac4db810343b1..cab5688a499a6a7c6f85e7855f5edfe111e5a4df 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 6b4ff4b330de256d8a02086f5adce7a44f1de7a2..3732ff847b93261012037e9b6e08789f01953320 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 e22762601890de8df7025a05ac22f7345c5067be..bf4b7234b21376bc9597c9a36d771a5208d807f9 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 diff --git a/db/migrate/20150310194358_add_version_check_to_application_settings.rb b/db/migrate/20150310194358_add_version_check_to_application_settings.rb new file mode 100644 index 0000000000000000000000000000000000000000..e9d42c1e749732a763ff9d69f40cbc73d05327ca --- /dev/null +++ b/db/migrate/20150310194358_add_version_check_to_application_settings.rb @@ -0,0 +1,5 @@ +class AddVersionCheckToApplicationSettings < ActiveRecord::Migration + def change + add_column :application_settings, :version_check_enabled, :boolean, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index a686bb4b3cd07fd7d0a7f4a2c47b4f2bf71a3b93..d63e1bc17a957d3b40476e93a4c7572016459dc7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150225065047) do +ActiveRecord::Schema.define(version: 20150310194358) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -27,6 +27,7 @@ ActiveRecord::Schema.define(version: 20150225065047) do t.string "home_page_url" t.integer "default_branch_protection", default: 2 t.boolean "twitter_sharing_enabled", default: true + t.boolean "version_check_enabled", default: true end create_table "broadcast_messages", force: true do |t|