summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-06-08 15:43:06 +0200
committerToon Claes <toon@gitlab.com>2017-06-09 10:35:42 +0200
commit7188b4d83989dcfcc672f88e19d1ddb550b4917a (patch)
tree2a98da2b57e9d167c1aa137070b7856924f67f8a
parent4a22895492fd7e9111f11b6659c31b509995721c (diff)
downloadgitlab-ce-7188b4d83989dcfcc672f88e19d1ddb550b4917a.tar.gz
Make the revision on the `/help` page clickabletc-link-to-commit-on-help-page
For quicker access, add hyperlink to the gitlab.com commits page for the current REVISION of GitLab.
-rw-r--r--app/views/help/index.html.haml2
-rw-r--r--changelogs/unreleased/tc-link-to-commit-on-help-page.yml4
-rw-r--r--lib/gitlab.rb4
-rw-r--r--spec/views/help/index.html.haml_spec.rb2
4 files changed, 9 insertions, 3 deletions
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index b20e3a22133..31d0e589c26 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -4,7 +4,7 @@
Community Edition
- if user_signed_in?
%span= Gitlab::VERSION
- %small= Gitlab::REVISION
+ %small= link_to Gitlab::REVISION, Gitlab::COM_URL + namespace_project_commits_path('gitlab-org', 'gitlab-ce', Gitlab::REVISION)
= version_status_badge
%p.slead
GitLab is open source software to collaborate on code.
diff --git a/changelogs/unreleased/tc-link-to-commit-on-help-page.yml b/changelogs/unreleased/tc-link-to-commit-on-help-page.yml
new file mode 100644
index 00000000000..3d11ba43d1f
--- /dev/null
+++ b/changelogs/unreleased/tc-link-to-commit-on-help-page.yml
@@ -0,0 +1,4 @@
+---
+title: Make the revision on the `/help` page clickable
+merge_request: 12016
+author:
diff --git a/lib/gitlab.rb b/lib/gitlab.rb
index c3064163e07..11f7c8b9510 100644
--- a/lib/gitlab.rb
+++ b/lib/gitlab.rb
@@ -1,9 +1,11 @@
require_dependency 'gitlab/git'
module Gitlab
+ COM_URL = 'https://gitlab.com'.freeze
+
def self.com?
# Check `staging?` as well to keep parity with gitlab.com
- Gitlab.config.gitlab.url == 'https://gitlab.com' || staging?
+ Gitlab.config.gitlab.url == COM_URL || staging?
end
def self.staging?
diff --git a/spec/views/help/index.html.haml_spec.rb b/spec/views/help/index.html.haml_spec.rb
index 6b07fcfc987..1f8261cc46b 100644
--- a/spec/views/help/index.html.haml_spec.rb
+++ b/spec/views/help/index.html.haml_spec.rb
@@ -21,7 +21,7 @@ describe 'help/index' do
render
expect(rendered).to match '8.0.2'
- expect(rendered).to match 'abcdefg'
+ expect(rendered).to have_link('abcdefg', 'https://gitlab.com/gitlab-org/gitlab-ce/commits/abcdefg')
end
end