diff --git a/Changelog.md b/Changelog.md index 9bdc9323d55c018f8cbfe262eb05d7d1000d0d57..82070323f65b6fae97717c431e0691a57c25c3d3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -30,8 +30,9 @@ * 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) +* Footer links moved to sidebar [#3827](https://github.com/diaspora/diaspora/pull/3827) +* Changelog now points to correct revision if possible [#3921](https://github.com/diaspora/diaspora/pull/3921) * User interface enhancements [#3832](https://github.com/diaspora/diaspora/pull/3832), [#3839](https://github.com/diaspora/diaspora/pull/3839), [#3834](https://github.com/diaspora/diaspora/pull/3834), [#3840](https://github.com/diaspora/diaspora/issues/3840), [#3846](https://github.com/diaspora/diaspora/issues/3846), [#3851](https://github.com/diaspora/diaspora/issues/3851), [#3828](https://github.com/diaspora/diaspora/issues/3828), [#3874](https://github.com/diaspora/diaspora/issues/3874), [#3806](https://github.com/diaspora/diaspora/issues/3806), [#3906](https://github.com/diaspora/diaspora/issues/3906). -* Show links in sidebar [#3827](https://github.com/diaspora/diaspora/pull/3827) * Add settings web mobile. [#3701](https://github.com/diaspora/diaspora/pull/3701) * Stream form on profile page [#3910](https://github.com/diaspora/diaspora/issues/3910). * Add Add Getting_Started page mobile. [#3949](https://github.com/diaspora/diaspora/issues/3949). diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9bc77d32bb4a5f033f2747ab090961ca3714e88d..985f506f8f4da55d9b78dfb8b28f642f6d168e24 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,6 +11,12 @@ module ApplicationHelper AppConfig.version.number.present? ? AppConfig.version.number : "" end + def changelog_url + url = "https://github.com/diaspora/diaspora/blob/master/Changelog.md" + url.sub!('/master/', "/#{AppConfig.git_revision}/") if AppConfig.git_revision.present? + url + end + def how_long_ago(obj) timeago(obj.created_at) end diff --git a/app/views/shared/_links.haml b/app/views/shared/_links.haml index 12d52198c79687f353a43653d834e3080262edb2..074ec453d2961d8ce5482afbe8a4472357a8d48e 100644 --- a/app/views/shared/_links.haml +++ b/app/views/shared/_links.haml @@ -1,6 +1,6 @@ %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.diasporafoundation.org/" -%li= link_to t('layouts.application.whats_new'), 'https://github.com/diaspora/diaspora/blob/master/Changelog.md' +%li= link_to t('layouts.application.whats_new'), changelog_url %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) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index e58d1bcc2d7166e3049383345e990fdd61807cba..249914f5b6d4ff2a86d81df2c130bf29c077f36c 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -89,6 +89,23 @@ describe ApplicationHelper do end end + describe '#changelog_url' do + it 'defaults to master branch changleog' do + old_revision = AppConfig.git_revision + AppConfig.git_revision = nil + changelog_url.should == 'https://github.com/diaspora/diaspora/blob/master/Changelog.md' + AppConfig.git_revision = old_revision + end + + it 'displays the changelog for the current git revision if set' do + old_revision = AppConfig.git_revision + AppConfig.git_revision = '123' + changelog_url.should == 'https://github.com/diaspora/diaspora/blob/123/Changelog.md' + AppConfig.git_revision = old_revision + end + + end + describe '#pod_name' do it 'defaults to Diaspora*' do pod_name.should match /DIASPORA/i