From 7b068b08727198d5161df7f4cbf22d39eae9d11e Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Fri, 7 Jul 2017 10:51:14 -0700 Subject: [PATCH] remove trump plan --- app/index.rb | 32 ------------ app/supporter.rb | 6 +-- models/site.rb | 8 --- views/site.erb | 2 +- views/welcome.erb | 123 +++++++++------------------------------------- 5 files changed, 26 insertions(+), 145 deletions(-) diff --git a/app/index.rb b/app/index.rb index b13d8dc3..9856b506 100644 --- a/app/index.rb +++ b/app/index.rb @@ -72,42 +72,10 @@ get '/?' do @blog_feed_html = SimpleCache.get :blog_feed_html end - if params[:trumpplan] - flash[:is_trump_plan] = true - end - erb :index, layout: :index_layout end -def trump_plan_eligible? - trumpplan_path = File.join 'files', 'trumpplan.txt' - - ranges = [] - - if File.exist? trumpplan_path - parsed_ip = IPAddress.parse request.ip - return false if parsed_ip.ipv6? # NOT EXCLUSIVE ENOUGH - - File.readlines(trumpplan_path).each do |range| - ranges << IPAddress.parse(range.strip) - end - - matched_ip = false - ranges.each do |range| - if range.include? parsed_ip - matched_ip = true - end - end - return matched_ip - end - false -end - get '/welcome' do - if params[:trumpplan] || flash[:is_trump_plan] || trump_plan_eligible? - @is_trump_plan = true - end - require_login redirect '/' if current_site.supporter? erb :'welcome', locals: {site: current_site} diff --git a/app/supporter.rb b/app/supporter.rb index bf67ac5d..cc259344 100644 --- a/app/supporter.rb +++ b/app/supporter.rb @@ -15,11 +15,7 @@ end post '/supporter/update' do require_login - if params[:plan_type] == 'trumpplan' - plan_type = 'trumpplan' - else - plan_type = 'supporter' - end + plan_type = 'supporter' if is_special_upgrade require_admin diff --git a/models/site.rb b/models/site.rb index 33ea6666..b009d81d 100644 --- a/models/site.rb +++ b/models/site.rb @@ -113,14 +113,6 @@ class Site < Sequel::Model maximum_site_files: 100_000 } - PLAN_FEATURES[:trumpplan] = PLAN_FEATURES[:supporter].merge( - name: 'Trump Plan', - price: 100, - space: Filesize.from('2MB').to_i, - no_file_restrictions: false, - bandwidth: Filesize.from('604800KB').to_i - ) - PLAN_FEATURES[:free] = PLAN_FEATURES[:supporter].merge( name: 'Free', space: Filesize.from('1GB').to_i, diff --git a/views/site.erb b/views/site.erb index ac57c59e..caa1c0c2 100644 --- a/views/site.erb +++ b/views/site.erb @@ -19,7 +19,7 @@
-

<%= site.title %> <% if site.supporter? %> <% end %> <% if site.plan_type == 'trumpplan' %>FAT CAT
FAT CAT SUPPORTER
Tips really well at Sarge's Deli<% end %>

+

<%= site.title %> <% if site.supporter? %> <% end %>

<%= site.host %>