summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2014-09-19 10:33:13 +0200
committerJochen Topf <jochen@topf.org>2014-09-19 10:33:13 +0200
commit47f60085e9ed997e7f8b2b9d829094c94e26eb25 (patch)
treebb7710a5da7f7b24511907d12b123602a7f1dbb2 /web
parent5077b329d6e1c90ca7735c17f8ab49d43808f20e (diff)
downloadtaginfo-47f60085e9ed997e7f8b2b9d829094c94e26eb25.tar
taginfo-47f60085e9ed997e7f8b2b9d829094c94e26eb25.tar.gz
Make it easier to get at version of taginfo running on a site.
Diffstat (limited to 'web')
-rw-r--r--web/lib/ui/taginfo.rb13
-rw-r--r--web/views/taginfo/index.erb2
2 files changed, 13 insertions, 2 deletions
diff --git a/web/lib/ui/taginfo.rb b/web/lib/ui/taginfo.rb
index f0fb8f7..0f09122 100644
--- a/web/lib/ui/taginfo.rb
+++ b/web/lib/ui/taginfo.rb
@@ -34,15 +34,26 @@ class Taginfo < Sinatra::Base
out
end
- get '/taginfo' do
+ def get_commit
begin
@commit = `git rev-parse HEAD`.chop
+ @commit_date = Time.parse(`git show -s --format=%ci HEAD`.chop).utc.iso8601
rescue
@commit = 'unknown'
+ @commit_date = 'unknown'
end
+ end
+
+ get '/taginfo' do
+ get_commit
erb :'taginfo/index'
end
+ get '/taginfo/version' do
+ get_commit
+ "#{@commit} #{@commit_date}"
+ end
+
get '/taginfo/status' do
content_type 'text/plain'
age_in_days = DateTime.now() - DateTime.parse(@data_until)
diff --git a/web/views/taginfo/index.erb b/web/views/taginfo/index.erb
index 3139642..62099f6 100644
--- a/web/views/taginfo/index.erb
+++ b/web/views/taginfo/index.erb
@@ -12,7 +12,7 @@
<li><a href="/taginfo/projects">Projects</a></li>
</ul>
<h2>Software Version</h2>
- <p><%= @commit %></p>
+ <p><%= @commit_date %> (<a href="https://github.com/joto/taginfo/commit/<%= @commit %>"><%= @commit[0, 10] %></a>)</p>
<h2>Config Settings</h2>
<table class="list">
<tr><th class="tl">Variable</th><th class="tl">Setting</th></tr>