Merge pull request #3921 from Ruxton/feature/changelog_url
Add a changelog_url helper
This commit is contained in:
commit
3f3b8f0d28
4 changed files with 26 additions and 2 deletions
|
|
@ -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).
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue