diff --git a/TODO b/TODO index 0b6d2e97..f67d6884 100644 --- a/TODO +++ b/TODO @@ -59,7 +59,6 @@ refactors: miscellaneous: - endless pager should include information about page number - add log engine and log everything that should be logged - - add version on homepage that reads version from package.json and git hash - add README - apache2 has good README: http://svn.apache.org/repos/asf/httpd/httpd/trunk/README - add spinner to forms such as registration, user query, login, settings diff --git a/gruntfile.js b/gruntfile.js index 398349dc..431efc3f 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -40,8 +40,10 @@ function readTemplates(grunt) { module.exports = function(grunt) { + var pkg = grunt.file.readJSON('package.json'); + grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), + pkg: pkg, phpCheckStyleConfigPath: phpCheckStyleConfigPath, phpSourcesDir: phpSourcesDir, @@ -114,6 +116,7 @@ module.exports = function(grunt) { processhtml: { options: { data: { + version: pkg.version + '@' + exec('git rev-parse --short HEAD', {silent: true}).output.trim(), customFaviconUrl: config.misc.customFaviconUrl, serviceName: config.basic.serviceName, templates: readTemplates(grunt), diff --git a/package.json b/package.json index 32ddd549..0fef077e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "szuru2", - "version": "0.0.0", + "name": "szurubooru", + "version": "0.9.0", "dependencies": { "jquery.cookie": "1.4.1", "jquery": "~2.1.1", diff --git a/public_html/css/home.css b/public_html/css/home.css index ffc3224a..27bfd3e6 100644 --- a/public_html/css/home.css +++ b/public_html/css/home.css @@ -32,3 +32,8 @@ #home .post-footer img { margin-left: 0.5em; } + +#home .version { + opacity: .4; + font-size: 12px; +} diff --git a/public_html/index.html b/public_html/index.html index 74d44068..92ff4ee1 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1,6 +1,11 @@ - + + + + diff --git a/public_html/js/Presenters/HomePresenter.js b/public_html/js/Presenters/HomePresenter.js index f344abcc..6e1e1a95 100644 --- a/public_html/js/Presenters/HomePresenter.js +++ b/public_html/js/Presenters/HomePresenter.js @@ -53,6 +53,8 @@ App.Presenters.HomePresenter = function( canViewPosts: auth.hasPrivilege(auth.privileges.viewPosts), formatRelativeTime: util.formatRelativeTime, formatFileSize: util.formatFileSize, + version: jQuery('head').attr('data-version'), + buildTime: jQuery('head').attr('data-build-time'), })); } diff --git a/public_html/templates/home.tpl b/public_html/templates/home.tpl index 7cb95d68..242b6d47 100644 --- a/public_html/templates/home.tpl +++ b/public_html/templates/home.tpl @@ -49,4 +49,8 @@ <% } %> + +

+ Version: <%= version %> (built <%= formatRelativeTime(buildTime) %>) +