Commit ae3fba6c authored by Douwe Maan's avatar Douwe Maan

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
parents 4bf1e85c 45824aab
module VersionCheckHelper module VersionCheckHelper
def version_status_badge def version_status_badge
if Rails.env.production? if Rails.env.production? && current_application_settings.version_check_enabled
image_tag VersionCheck.new.url image_tag VersionCheck.new.url
end end
end end
......
%div %div
%h1 %h1
GitLab GitLab
%span= Gitlab::VERSION Community Edition
%small= Gitlab::REVISION - if user_signed_in?
- if current_application_settings.version_check_enabled %span= Gitlab::VERSION
%small= Gitlab::REVISION
= version_status_badge = version_status_badge
%p.slead %p.slead
GitLab is open source software to collaborate on code. GitLab is open source software to collaborate on code.
%br %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 %br
Perform code reviews and enhance collaboration with merge requests. Perform code reviews and enhance collaboration with merge requests.
%br %br
...@@ -33,19 +34,8 @@ ...@@ -33,19 +34,8 @@
.panel-heading .panel-heading
Quick help Quick help
%ul.well-list %ul.well-list
%li %li= link_to 'See our website for getting help', promo_url + '/getting-help/'
See our website for %li= link_to 'Use the search bar on the top of this page', '#', onclick: 'Shortcuts.focusSearch(event)'
= link_to 'getting help', promo_url + '/getting-help/' %li= link_to 'Use shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
%li %li= link_to 'Get a support subscription', 'https://about.gitlab.com/pricing/'
Use the %li= link_to 'Compare GitLab editions', 'https://about.gitlab.com/features/#compare'
= 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
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