mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
tipping: only show tipping sites with paypal/btc input
This commit is contained in:
parent
42b3f25b11
commit
3dc38bfc5a
3 changed files with 6 additions and 1 deletions
|
@ -85,6 +85,7 @@ def browse_sites_dataset
|
||||||
site_dataset.order!(:site_updated_at.desc, :views.desc)
|
site_dataset.order!(:site_updated_at.desc, :views.desc)
|
||||||
when 'tipping_enabled'
|
when 'tipping_enabled'
|
||||||
site_dataset.where! tipping_enabled: true
|
site_dataset.where! tipping_enabled: true
|
||||||
|
site_dataset.where!("(tipping_paypal is not null and tipping_paypal != '') or (tipping_bitcoin is not null and tipping_bitcoin != '')")
|
||||||
site_dataset = site_dataset.association_left_join :follows
|
site_dataset = site_dataset.association_left_join :follows
|
||||||
site_dataset.select_all! :sites
|
site_dataset.select_all! :sites
|
||||||
site_dataset.select_append! Sequel.lit("count(follows.site_id) AS follow_count")
|
site_dataset.select_append! Sequel.lit("count(follows.site_id) AS follow_count")
|
||||||
|
|
|
@ -1356,6 +1356,10 @@ class Site < Sequel::Model
|
||||||
!site_files_dataset.where(path: /^\/?index.html$/).where(sha1_hash: EMPTY_FILE_HASH).first.nil?
|
!site_files_dataset.where(path: /^\/?index.html$/).where(sha1_hash: EMPTY_FILE_HASH).first.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tipping_enabled?
|
||||||
|
tipping_enabled && (!tipping_paypal.blank? || !tipping_bitcoin.blank?)
|
||||||
|
end
|
||||||
|
|
||||||
def classify(path)
|
def classify(path)
|
||||||
return nil unless classification_allowed? path
|
return nil unless classification_allowed? path
|
||||||
#$classifier.classify process_for_classification(path)
|
#$classifier.classify process_for_classification(path)
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
<a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: site} %>'><i class="fa fa-share-alt"></i> <span>Share</span></a>
|
<a href="#" id="shareButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'_share', layout: false, locals: {site: site} %>'><i class="fa fa-share-alt"></i> <span>Share</span></a>
|
||||||
|
|
||||||
<% if site.tipping_enabled && (!site.tipping_paypal.blank? || !site.tipping_bitcoin.blank?) %>
|
<% if site.tipping_enabled? %>
|
||||||
<a href="#" id="tipButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'site/_tip', layout: false, locals: {site: site} %>'><i class="fa fa-usd"></i> <span>Send a Tip</span></a>
|
<a href="#" id="tipButton" class="btn-Action" data-container="body" data-toggle="popover" data-placement="bottom" data-content='<%== erb :'site/_tip', layout: false, locals: {site: site} %>'><i class="fa fa-usd"></i> <span>Send a Tip</span></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue