summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-10-01 15:59:44 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-10-02 16:11:32 +0200
commitb09e40624b9fc6a7b4a7b38f174bc66d996e3fd5 (patch)
tree5bbe4e8da4966bbdbc30e6ab7bcfa50caff1c29b /app/helpers
parentdf73116f75d4a7545fb4a7684aa76624efede7d0 (diff)
downloadgitlab-ce-b09e40624b9fc6a7b4a7b38f174bc66d996e3fd5.tar.gz
Show the commit-sha for pre-release versions
The pre-release tags are set at the beginning of a release, so it would be impossible to figure out which version was running if we're running nightlies. In that case it's better to still link to the SHA. These versions don't get deployed to .com.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/version_check_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/version_check_helper.rb b/app/helpers/version_check_helper.rb
index 75637eb0676..ab77b149072 100644
--- a/app/helpers/version_check_helper.rb
+++ b/app/helpers/version_check_helper.rb
@@ -9,4 +9,17 @@ module VersionCheckHelper
image_url = VersionCheck.new.url
image_tag image_url, class: 'js-version-status-badge'
end
+
+ def link_to_version
+ if Gitlab.pre_release?
+ commit_link = link_to(Gitlab.revision, Gitlab::COM_URL + namespace_project_commits_path('gitlab-org', source_code_project, Gitlab.revision))
+ [Gitlab::VERSION, content_tag(:small, commit_link)].join(' ').html_safe
+ else
+ link_to Gitlab::VERSION, Gitlab::COM_URL + namespace_project_tag_path('gitlab-org', source_code_project, "v#{Gitlab::VERSION}")
+ end
+ end
+
+ def source_code_project
+ 'gitlab-ce'
+ end
end