From ac3b2bc99f4921d8b985b7b09df1f571a3cf23f2 Mon Sep 17 00:00:00 2001 From: Diaspora Europe Date: Wed, 9 Jan 2013 11:53:32 +0100 Subject: [PATCH] pod version in footer and updated link to changelog #3705 --- Changelog.md | 1 + app/helpers/application_helper.rb | 4 ++++ app/views/shared/_footer.html.haml | 6 +++--- spec/helpers/application_helper_spec.rb | 10 ++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9ef272a70..b4110747b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -25,6 +25,7 @@ * Add flash-notice when sending messages to non-contacts. [#3723](https://github.com/diaspora/diaspora/pull/3723) * Re-add hovercards [#3802](https://github.com/diaspora/diaspora/pull/3802) * Add images to notifications [#3821](https://github.com/diaspora/diaspora/pull/3821) +* Show pod version in footer and updated the link to the changelog [#3822](https://github.com/diaspora/diaspora/pull/3822) ## Bug Fixes diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index eed4447b9..9bc77d32b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,6 +7,10 @@ module ApplicationHelper AppConfig.settings.pod_name.present? ? AppConfig.settings.pod_name : "DIASPORA*" end + def pod_version + AppConfig.version.number.present? ? AppConfig.version.number : "" + end + def how_long_ago(obj) timeago(obj.created_at) end diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index 1e52630d9..b4d5de99d 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -4,8 +4,8 @@ %li= link_to '@joindiaspora', "http://twitter.com/joindiaspora" %li= link_to 'github', "https://github.com/diaspora/diaspora" %li= link_to t('layouts.header.blog'), "http://blog.joindiaspora.com" - %li= link_to t('layouts.application.whats_new'), 'https://github.com/diaspora/diaspora/wiki/Changelog' + %li= link_to t('layouts.application.whats_new'), 'https://github.com/diaspora/diaspora/blob/master/Changelog.md' %li.separator= "|" - %li= link_to(t('layouts.header.code'), "#{root_path.chomp('/')}/source.tar.gz", {:title => t('layouts.application.source_package')}) unless request.url.match(/joindiaspora.com/) + %li= link_to(t('layouts.header.code')+ " " + pod_version, "#{root_path.chomp('/')}/source.tar.gz", {:title => t('layouts.application.source_package')}) unless request.url.match(/joindiaspora.com/) %li= link_to(t('layouts.application.toggle'), toggle_mobile_path) - = image_tag 'branding/powered_by_diaspora.png', :height => "11px", :width => "145px" \ No newline at end of file + = image_tag 'branding/powered_by_diaspora.png', :height => "11px", :width => "145px" diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 9980a48e6..a33832750 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -101,4 +101,14 @@ describe ApplicationHelper do AppConfig.settings.pod_name = old_name end end + + describe '#pod_version' do + + it 'displays the supplied pod_version if it is set' do + old_version = AppConfig.version.number.get + AppConfig.version.number = "0.0.1.0" + pod_version.should == "0.0.1.0" + AppConfig.version.number = old_version + end + end end