diff options
author | hellekin <hellekin@cepheide.org> | 2021-01-22 14:45:15 +0100 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2021-01-22 14:46:50 +0100 |
commit | 9d51444479cec02d0b250ae65a91d36beb5f6b1b (patch) | |
tree | 71475d4157eaa2f65207e43cec433a18304d1a50 /app/helpers/application_helper.rb | |
parent | 97bfc3f6012027077077ea4a6b5f2f709c76158e (diff) | |
download | incommon-map-9d51444479cec02d0b250ae65a91d36beb5f6b1b.tar.gz |
Link to current source code version (per AGPL-3.0)
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |