summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-09-16 13:51:42 +0200
committerJeroen van Baarsen <jeroenvanbaarsen@gmail.com>2015-09-18 10:15:40 +0200
commitfe17a236e37c2d7504925a474a716f714f160b2d (patch)
tree83950682d2756f8ef76c555ddbcd050a266fca90
parent0aec0d53b10078613b66b0d41424ee4264ae6406 (diff)
downloadgitlab-ce-fe17a236e37c2d7504925a474a716f714f160b2d.tar.gz
Allow custom info to be added to Help page
Fixes #2536 Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
-rw-r--r--CHANGELOG1
-rw-r--r--app/controllers/admin/application_settings_controller.rb1
-rw-r--r--app/views/admin/application_settings/_form.html.haml5
-rw-r--r--app/views/help/index.html.haml3
-rw-r--r--db/migrate/20150916114643_add_help_page_text_to_application_settings.rb5
-rw-r--r--db/schema.rb1
-rw-r--r--features/steps/admin/settings.rb1
7 files changed, 17 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index aab2416a09b..811089bbc61 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 f38e07af84b..7c134d2ec9b 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 330b8bbf9d2..a36ae0b766c 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 bf4b7234b21..f492aaf4c0a 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 00000000000..37a27f11935
--- /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 151f34e1965..bf5a88f10e8 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 7a6aec23af8..6acbf46eb20 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