diff --git a/CHANGELOG b/CHANGELOG index aab2416a09b06ebe4f6a7a7a46706ce878344ba8..811089bbc61d34a48f191e1a124db3d8ad26e9be 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -53,6 +53,7 @@ v 8.0.0 (unreleased) - Add FogBugz project import (Jared Szechy) - Sort users autocomplete lists by user (Allister Antosik) - Webhook for issue now contains repository field (Jungkook Park) + - Add ability to add custom text to the help page (Jeroen van Baarsen) v 7.14.3 - No changes diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index f38e07af84b1a9a83f6440f10c432f42fc5e43ef..7c134d2ec9b7f30c28bf957e9d9f235d0ebefde2 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -46,6 +46,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :gravatar_enabled, :twitter_sharing_enabled, :sign_in_text, + :help_page_text, :home_page_url, :after_sign_out_path, :max_attachment_size, diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 330b8bbf9d2c42905d9bf84995669de41eb946a6..a36ae0b766c5b2988f96ceba9b58470fb97ae369 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -118,6 +118,11 @@ .col-sm-10 = f.text_area :sign_in_text, class: 'form-control', rows: 4 .help-block Markdown enabled + .form-group + = f.label :help_page_text, class: 'control-label col-sm-2' + .col-sm-10 + = f.text_area :help_page_text, class: 'form-control', rows: 4 + .help-block Markdown enabled .form-actions = f.submit 'Save', class: 'btn btn-primary' diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index bf4b7234b21376bc9597c9a36d771a5208d807f9..f492aaf4c0a6bfbc84d3ace29d0aea399e059a97 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -17,6 +17,9 @@ Used by more than 100,000 organizations, GitLab is the most popular solution to manage git repositories on-premises. %br Read more about GitLab at #{link_to promo_host, promo_url, target: '_blank'}. + - if current_application_settings.help_page_text.present? + %hr + = markdown(current_application_settings.help_page_text) %hr diff --git a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb new file mode 100644 index 0000000000000000000000000000000000000000..37a27f11935c39640fb8a8ffffddff9831a05894 --- /dev/null +++ b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb @@ -0,0 +1,5 @@ +class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration + def change + add_column :application_settings, :help_page_text, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 151f34e1965aefd5f4afdb3d5ef5d9bc8fd9f7e2..bf5a88f10e82c84bf722b3a71e82080cd5c687b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -45,6 +45,7 @@ ActiveRecord::Schema.define(version: 20150916145038) do t.string "after_sign_out_path" t.integer "session_expire_delay", default: 10080, null: false t.text "import_sources" + t.text "help_page_text" end create_table "audit_events", force: true do |t| diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index 7a6aec23af827d0a7f05b722b38e304f329869bf..6acbf46eb209dc7e633b0f1fd4c9656b4d508a81 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -7,6 +7,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps step 'I modify settings and save form' do uncheck 'Gravatar enabled' fill_in 'Home page URL', with: 'https://about.gitlab.com/' + fill_in 'Help page text', with: 'Example text' click_button 'Save' end