From 9d51444479cec02d0b250ae65a91d36beb5f6b1b Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 22 Jan 2021 14:45:15 +0100 Subject: Link to current source code version (per AGPL-3.0) --- app/helpers/application_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e39da5f..89b3b6d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -23,6 +23,17 @@ module ApplicationHelper ).to_html.html_safe, class: 'markdown') end + # Display current application version + def version_string + version = begin + IO.read('.app-version')&.strip + rescue + 'HEAD' + end + + tag.div(link_to(version, INCOMMON.repo_url(version), title: 'Read source code'), class: 'app-version') + end + private # CommonMarker extensions -- cgit v1.2.3