Display whitelist information in about/more

This also limits the number of federated instances to the actual whitelist count.
master
James 2017-04-08 19:49:49 +00:00 committed by Noiob
parent 4255cf0e1e
commit 556e1080a0
2 changed files with 12 additions and 4 deletions

View File

@ -25,8 +25,16 @@ class InstancePresenter
Rails.cache.fetch('local_status_count') { Account.local.sum(:statuses_count) }
end
def whitelist
Rails.cache.fetch('whitelist') { DomainWhitelist.all }
end
def domain_count
Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
if DomainWhitelist.enabled?
whitelist.length
else
Rails.cache.fetch('distinct_domain_count') { Account.distinct.count(:domain) }
end
end
def version_number

View File

@ -62,7 +62,7 @@
%span= t 'about.status_count_after'
.row__mascot
.landing-page__mascot
= image_tag asset_pack_path('elephant_ui_plane.svg')
= image_tag asset_pack_path('awoospacefrontart-small.png')
- else
.column-2.non-preview
@ -94,7 +94,7 @@
%span= t 'about.status_count_after'
.row__mascot
.landing-page__mascot
= image_tag asset_pack_path('elephant_ui_plane.svg')
= image_tag asset_pack_path('awoospacefrontart-small.png')
- if Setting.timeline_preview
.column-3
@ -142,4 +142,4 @@
= link_to t('about.source_code'), @instance_presenter.source_url
= " (#{@instance_presenter.version_number})"
#modal-container
#modal-container