Add Mastodon::Source.url (#4643)
* Add Mastodon::Source.url * Update spec * Refactor Move things frmo Mastodon::Source to Mastodon::Version
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							5927b43c0f
						
					
				
				
					commit
					696c2c6f2f
				
			@@ -31,4 +31,8 @@ class InstancePresenter
 | 
			
		||||
  def version_number
 | 
			
		||||
    Mastodon::Version
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def source_url
 | 
			
		||||
    Mastodon::Version.source_url
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -63,5 +63,5 @@
 | 
			
		||||
  .footer-links
 | 
			
		||||
    .container
 | 
			
		||||
      %p
 | 
			
		||||
        = link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon'
 | 
			
		||||
        = " (#{@instance_presenter.version_number})"
 | 
			
		||||
        = link_to t('about.source_code'), @instance_presenter.source_url
 | 
			
		||||
        = " (#{@instance_presenter.version_number})"
 | 
			
		||||
 
 | 
			
		||||
@@ -76,5 +76,5 @@
 | 
			
		||||
  .footer-links
 | 
			
		||||
    .container
 | 
			
		||||
      %p
 | 
			
		||||
        = link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon'
 | 
			
		||||
        = " (#{@instance_presenter.version_number})"
 | 
			
		||||
        = link_to t('about.source_code'), @instance_presenter.source_url
 | 
			
		||||
        = " (#{@instance_presenter.version_number})"
 | 
			
		||||
 
 | 
			
		||||
@@ -31,5 +31,22 @@ module Mastodon
 | 
			
		||||
    def to_s
 | 
			
		||||
      [to_a.join('.'), flags].join
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def source_base_url
 | 
			
		||||
      'https://github.com/tootsuite/mastodon'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # specify git tag or commit hash here
 | 
			
		||||
    def source_tag
 | 
			
		||||
      nil
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def source_url
 | 
			
		||||
      if source_tag
 | 
			
		||||
        "#{source_base_url}/tree/#{source_tag}"
 | 
			
		||||
      else
 | 
			
		||||
        source_base_url
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,7 @@ describe 'about/show.html.haml', without_verify_partial_doubles: true do
 | 
			
		||||
                                site_title: 'something',
 | 
			
		||||
                                site_description: 'something',
 | 
			
		||||
                                version_number: '1.0',
 | 
			
		||||
                                source_url: 'https://github.com/tootsuite/mastodon',
 | 
			
		||||
                                open_registrations: false,
 | 
			
		||||
                                closed_registrations_message: 'yes')
 | 
			
		||||
    assign(:instance_presenter, instance_presenter)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user