Permalink
Browse files

Added a GIT 'last modified date' to the bottom of pages.

  • Loading branch information...
1 parent d100fdb commit 6abe0e49e8c0614e6426c43cb897da9b0fc73411 @njh committed May 20, 2012
Showing with 22 additions and 10 deletions.
  1. +1 −0 Gemfile
  2. +7 −0 Gemfile.lock
  3. +3 −1 dbpedialite.rb
  4. +8 −9 public/css/dbpedialite.css
  5. +3 −0 views/layout.erb
View
@@ -8,6 +8,7 @@ gem 'json_pure', :require => 'json'
gem 'nokogiri'
gem 'rdiscount'
gem 'doodle'
+gem 'grit'
gem 'rdf', ">=0.3.1"
gem 'rdf-json', :require => 'rdf/json'
View
@@ -9,13 +9,19 @@ GEM
equivalent-xml (0.2.9)
nokogiri (>= 1.4.3)
fakeweb (1.3.0)
+ grit (2.5.0)
+ diff-lcs (~> 1.1)
+ mime-types (~> 1.15)
+ posix-spawn (~> 0.3.6)
haml (3.1.4)
htmlentities (4.3.1)
json_pure (1.7.0)
metaclass (0.0.1)
+ mime-types (1.17.2)
mocha (0.11.4)
metaclass (~> 0.0.1)
nokogiri (1.5.2)
+ posix-spawn (0.3.6)
rack (1.4.1)
rack-protection (1.2.0)
rack
@@ -70,6 +76,7 @@ DEPENDENCIES
emk-sinatra-url-for
equivalent-xml
fakeweb
+ grit
json_pure
mocha
nokogiri
View
@@ -6,9 +6,11 @@
class DbpediaLite < Sinatra::Base
- set :public_folder, File.join(File.dirname(__FILE__), 'public')
+ set :public_folder, File.join(root, 'public')
DEFAULT_HOST = 'dbpedialite.org'
+ GIT_REPO_PATH = File.join(root, '.git')
+ GIT_LAST_COMMIT = Grit::Repo.new(GIT_REPO_PATH).commits.first
def self.extract_vocabularies(graph)
vocabs = {}
@@ -170,23 +170,22 @@ a img { border: none; padding: 0; margin: 0; }
#lastmodified
{
- margin: 3em 0 0 0;
- font-family: helvetica, arial, sans-serif;
- font-size: 8pt;
- font-style: oblique;
- font-variant: normal;
- font-weight: lighter;
+ margin: 3em 0 0 0;
+ font-family: helvetica, arial, sans-serif;
+ font-size: 8pt;
+ font-style: oblique;
+ font-variant: normal;
+ font-weight: lighter;
}
/*--------------------------------------------------------------
Footer
--------------------------------------------------------------*/
-#footer
-{
+#footer {
height: 40px;
margin: 10px 0 0;
- padding: 10px 0 0;
+ padding: 10px 0 10px 0;
clear: both;
border-top: 1px solid #ccc;
font-size: 90%;
View
@@ -45,6 +45,9 @@
<div class="links">
Source code: <%= link_to('http://github.com/njh/dbpedialite') %>
</div>
+ <div class="links">
+ Last updated: <%= link_to(GIT_LAST_COMMIT.authored_date, 'http://github.com/njh/dbpedialite/tree/' + GIT_LAST_COMMIT.id) %>
+ </div>
</div>
</body>

0 comments on commit 6abe0e4

Please sign in to comment.