Commit 55d77110 authored by Douwe Maan's avatar Douwe Maan Committed by Robert Speicher

Merge branch 'rs-help-page' into 'master'

Help page improvements

- Only signed-in users can see version information
- Add "Community Edition" text so the header is
  less barren when version information is hidden
- Minor copy edits
- Make all "Quick help" link text the entire body
  of the link. Prior, it wasn't obvious which part
  of each item was an actual link.

Closes #2721 

See merge request !1415
parent ae51989e
module VersionCheckHelper
def version_status_badge
if Rails.env.production?
if Rails.env.production? && current_application_settings.version_check_enabled
image_tag VersionCheck.new.url
end
end
......
%div
%h1
GitLab
%span= Gitlab::VERSION
%small= Gitlab::REVISION
- if current_application_settings.version_check_enabled
Community Edition
- if user_signed_in?
%span= Gitlab::VERSION
%small= Gitlab::REVISION
= version_status_badge
%p.slead
GitLab is open source software to collaborate on code.
%br
Manage git repositories with fine grained access controls that keep your code secure.
Manage git repositories with fine-grained access controls that keep your code secure.
%br
Perform code reviews and enhance collaboration with merge requests.
%br
......@@ -33,19 +34,8 @@
.panel-heading
Quick help
%ul.well-list
%li
See our website for
= link_to 'getting help', promo_url + '/getting-help/'
%li
Use the
= link_to 'search bar', '#', onclick: 'Shortcuts.focusSearch(event)'
on the top of this page
%li
Use
= link_to 'shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
%li
Get a support
= link_to 'subscription', 'https://about.gitlab.com/pricing/'
%li
= link_to 'Compare', 'https://about.gitlab.com/features/#compare'
GitLab editions
%li= link_to 'See our website for getting help', promo_url + '/getting-help/'
%li= link_to 'Use the search bar on the top of this page', '#', onclick: 'Shortcuts.focusSearch(event)'
%li= link_to 'Use shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
%li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/'
%li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare'
require 'rails_helper'
describe 'help/index' do
describe 'version information' do
it 'is hidden from guests' do
stub_user(nil)
stub_version('8.0.2', 'abcdefg')
stub_helpers
render
expect(rendered).not_to match '8.0.2'
expect(rendered).not_to match 'abcdefg'
end
it 'is shown to users' do
stub_user
stub_version('8.0.2', 'abcdefg')
stub_helpers
render
expect(rendered).to match '8.0.2'
expect(rendered).to match 'abcdefg'
end
end
def stub_user(user = double)
allow(view).to receive(:user_signed_in?).and_return(user)
end
def stub_version(version, revision)
stub_const('Gitlab::VERSION', version)
stub_const('Gitlab::REVISION', revision)
end
def stub_helpers
allow(view).to receive(:markdown).and_return('')
allow(view).to receive(:version_status_badge).and_return('')
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment