mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
remove trump plan
This commit is contained in:
parent
3ff6f420a4
commit
7b068b0872
5 changed files with 26 additions and 145 deletions
32
app/index.rb
32
app/index.rb
|
@ -72,42 +72,10 @@ get '/?' do
|
||||||
@blog_feed_html = SimpleCache.get :blog_feed_html
|
@blog_feed_html = SimpleCache.get :blog_feed_html
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:trumpplan]
|
|
||||||
flash[:is_trump_plan] = true
|
|
||||||
end
|
|
||||||
|
|
||||||
erb :index, layout: :index_layout
|
erb :index, layout: :index_layout
|
||||||
end
|
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
|
get '/welcome' do
|
||||||
if params[:trumpplan] || flash[:is_trump_plan] || trump_plan_eligible?
|
|
||||||
@is_trump_plan = true
|
|
||||||
end
|
|
||||||
|
|
||||||
require_login
|
require_login
|
||||||
redirect '/' if current_site.supporter?
|
redirect '/' if current_site.supporter?
|
||||||
erb :'welcome', locals: {site: current_site}
|
erb :'welcome', locals: {site: current_site}
|
||||||
|
|
|
@ -15,11 +15,7 @@ end
|
||||||
post '/supporter/update' do
|
post '/supporter/update' do
|
||||||
require_login
|
require_login
|
||||||
|
|
||||||
if params[:plan_type] == 'trumpplan'
|
|
||||||
plan_type = 'trumpplan'
|
|
||||||
else
|
|
||||||
plan_type = 'supporter'
|
plan_type = 'supporter'
|
||||||
end
|
|
||||||
|
|
||||||
if is_special_upgrade
|
if is_special_upgrade
|
||||||
require_admin
|
require_admin
|
||||||
|
|
|
@ -113,14 +113,6 @@ class Site < Sequel::Model
|
||||||
maximum_site_files: 100_000
|
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(
|
PLAN_FEATURES[:free] = PLAN_FEATURES[:supporter].merge(
|
||||||
name: 'Free',
|
name: 'Free',
|
||||||
space: Filesize.from('1GB').to_i,
|
space: Filesize.from('1GB').to_i,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col col-50 profile-info">
|
<div class="col col-50 profile-info">
|
||||||
<h2 class="eps title-with-badge"><span><%= site.title %></span> <% if site.supporter? %><a href="/supporter" class="supporter-badge" title="Neocities Supporter"></a> <% end %> <% if site.plan_type == 'trumpplan' %><img src="/img/fatcat.png" alt="FAT CAT"><BR>FAT CAT SUPPORTER<br><small>Tips <i>really</i> well at Sarge's Deli</i><% end %></h2>
|
<h2 class="eps title-with-badge"><span><%= site.title %></span> <% if site.supporter? %><a href="/supporter" class="supporter-badge" title="Neocities Supporter"></a> <% end %></h2>
|
||||||
<p class="site-url"><a href="<%= site.uri %>"><%= site.host %></a></p>
|
<p class="site-url"><a href="<%= site.uri %>"><%= site.host %></a></p>
|
||||||
<!--
|
<!--
|
||||||
<% if site.latest_archive %>
|
<% if site.latest_archive %>
|
||||||
|
|
|
@ -35,82 +35,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row content txt-Center">
|
<div class="row content txt-Center">
|
||||||
<% if request.path == '/welcome' %>
|
<% if request.path == '/welcome' %>
|
||||||
<% if @is_trump_plan %>
|
|
||||||
<b>Sorry!</b><br><small style="text-align: left">Not available for Trump Hotel / FCC / US Senate / White House guests.<br><br>Thank you for opposing Net Neutrality, it was suppressing our freedom to do this.</small>
|
|
||||||
<% else %>
|
|
||||||
<a href="/tutorial" class="btn-Action">Continue</a>
|
<a href="/tutorial" class="btn-Action">Continue</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @is_trump_plan %>
|
|
||||||
<div class="col supporter">
|
|
||||||
<div class="row content">
|
|
||||||
<div class="col col-33">
|
|
||||||
<img src="/img/trumpplan.png" width="200px;">
|
|
||||||
<br>
|
|
||||||
<p>Trump Hotel / FCC / US Senate / White House guests: Introducing this exclusive offer just for you! Bathe in the luxury of a superior quality web site hosting experience that has been tailor-made by the finest artisans for the choicest tastes of your demanding lifestyle.</p>
|
|
||||||
<div class="plan-image supporter" style="background-image: url(/img/fatcat.png);">
|
|
||||||
</div>
|
|
||||||
<div class="price" style="color: green">$100</div>
|
|
||||||
<div class="interval">per month</div>
|
|
||||||
|
|
||||||
<ul class="main-features">
|
|
||||||
<li><strong>2 MB</strong> <span data-original-title="Your internet bill after Net Neutrality is gutted is going to be big, folks. Really big.">storage bigness</span></li>
|
|
||||||
<li><strong>604,800 KB</strong> <span data-original-title="The exact amount of bandwidth a 56K modem can download at theoretical perfect speeds in one day. The extra cost creates jobs!">ultra-premium bandwidth</span></li>
|
|
||||||
<li><strong>INCLUDED </strong> <span data-original-title="Be the talk of Upper East Side with this exclusive badge showing how wealthy you are!">"Fat Cat" Site Profile Badge</span> <small><strong><a href="/img/fatcatbadgeexample.png">(sample)</a></strong></small></li>
|
|
||||||
<li><strong>INCLUDED</strong> <span data-original-title="The finest of 18th century late-baroque faux-luxury and other miscellaneous Veblen Goods">tacky gold-plated Rococo garbage</span></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col col-66">
|
|
||||||
<p class="instructions">Just enter your credit card info to upgrade to the pinnacle of luxury:</p>
|
|
||||||
<div>
|
|
||||||
<div id="plan_error" class="alert alert-block alert-error" style="display:none"></div>
|
|
||||||
<form id="upgradeForm" method="POST" action="/supporter/update">
|
|
||||||
<%== csrf_token_input_html %>
|
|
||||||
<input type="hidden" value="trumpplan" name="plan_type">
|
|
||||||
<input id="stripe_token" name="stripe_token" type="hidden" value="<%= params[:stripe_token] %>">
|
|
||||||
|
|
||||||
<div class="credit-card-input no-js" id="skeuocard" style="margin-left: auto; margin-right: auto; margin-bottom: 20px">
|
|
||||||
<p class="no-support-warning"></p>
|
|
||||||
<label for="cc_type">Card Type</label>
|
|
||||||
<select name="cc_type">
|
|
||||||
<option value="">...</option>
|
|
||||||
<option value="visa">Visa</option>
|
|
||||||
<option value="discover">Discover</option>
|
|
||||||
<option value="mastercard">MasterCard</option>
|
|
||||||
<option value="maestro">Maestro</option>
|
|
||||||
<option value="jcb">JCB</option>
|
|
||||||
<option value="unionpay">China UnionPay</option>
|
|
||||||
<option value="amex">American Express</option>
|
|
||||||
<option value="dinersclubintl">Diners Club</option>
|
|
||||||
</select>
|
|
||||||
<label for="cc_number">Card Number</label>
|
|
||||||
<input type="text" name="cc_number" id="cc_number" placeholder="XXXX XXXX XXXX XXXX" maxlength="19" size="19">
|
|
||||||
<label for="cc_exp_month">Expiration Month</label>
|
|
||||||
<input type="text" name="cc_exp_month" id="cc_exp_month" placeholder="00">
|
|
||||||
<label for="cc_exp_year">Expiration Year</label>
|
|
||||||
<input type="text" name="cc_exp_year" id="cc_exp_year" placeholder="00">
|
|
||||||
<label for="cc_name">Cardholder's Name</label>
|
|
||||||
<input type="text" name="cc_name" id="cc_name" placeholder="John Doe">
|
|
||||||
<label for="cc_cvc">Card Validation Code</label>
|
|
||||||
<input type="text" name="cc_cvc" id="cc_cvc" placeholder="123" maxlength="3" size="3">
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row content txt-Center">
|
|
||||||
<a id="upgradeLink" href="/" class="btn-Action" onclick="$('#upgradeForm').submit(); return false">
|
|
||||||
Begin the lifestyle you've always dreamed of for only $100
|
|
||||||
</a><br>
|
|
||||||
or pay with <a href="/supporter/bitcoin">E-Gold</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% else %>
|
|
||||||
<div class="col supporter">
|
<div class="col supporter">
|
||||||
<div class="row content">
|
<div class="row content">
|
||||||
<div class="col col-33">
|
<div class="col col-33">
|
||||||
|
@ -184,7 +113,6 @@
|
||||||
or pay with <a href="/supporter/paypal">PayPal</a> or <a href="/supporter/bitcoin">Bitcoin</a>
|
or pay with <a href="/supporter/paypal">PayPal</a> or <a href="/supporter/bitcoin">Bitcoin</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -219,13 +147,10 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<% unless @is_trump_plan %>
|
|
||||||
<section class="section" style="padding-top: 0;">
|
<section class="section" style="padding-top: 0;">
|
||||||
<%== erb :'supporter/_compare', layout: false %>
|
<%== erb :'supporter/_compare', layout: false %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%== erb :'supporter/_signupcode', layout: false %>
|
<%== erb :'supporter/_signupcode', layout: false %>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue