diff --git a/app.rb b/app.rb index 2c68f3d5..1a79a5b6 100644 --- a/app.rb +++ b/app.rb @@ -30,7 +30,7 @@ before do content_type :json elsif request.path.match /^\/webhooks\// # Skips the CSRF/validation check for stripe web hooks - elsif email_not_validated? && !(request.path =~ /^\/site\/.+\/confirm_email|^\/settings\/change_email|^\/signout|^\/welcome|^\/plan/) + elsif email_not_validated? && !(request.path =~ /^\/site\/.+\/confirm_email|^\/settings\/change_email|^\/signout|^\/welcome|^\/supporter/) redirect "/site/#{current_site.username}/confirm_email" else content_type :html, 'charset' => 'utf-8' diff --git a/app/index.rb b/app/index.rb index a047a56f..32bc5857 100644 --- a/app/index.rb +++ b/app/index.rb @@ -41,7 +41,7 @@ end get '/welcome' do require_login - redirect '/' if current_site.plan_type != 'free' + redirect '/' if current_site.supporter? erb :'welcome', locals: {site: current_site} end diff --git a/app/plan.rb b/app/plan.rb index b75c6825..17eebed2 100644 --- a/app/plan.rb +++ b/app/plan.rb @@ -1,202 +1,3 @@ get '/plan/?' do - @title = 'Support Us' - - if parent_site && parent_site.unconverted_legacy_supporter? - customer = Stripe::Customer.retrieve(parent_site.stripe_customer_id) - subscription = customer.subscriptions.first - - # Subscription was deleted, add to free plan. - if subscription.nil? - subscription = customer.subscriptions.create plan: 'free' - end - - parent_site.stripe_subscription_id = subscription.id - parent_site.plan_type = subscription.plan.id - parent_site.save_changes - end - - erb :'plan/index' -end - -def is_special_upgrade - params[:username] && params[:plan_type] == 'special' -end - -post '/plan/update' do - require_login - - if is_special_upgrade - require_admin - site = Site[username: params[:username]] - - if site.nil? - flash[:error] = 'Cannot find the requested user.' - redirect '/admin' - end - end - - site ||= parent_site - - DB.transaction do - if site.stripe_subscription_id - customer = Stripe::Customer.retrieve site.stripe_customer_id - subscription = customer.subscriptions.retrieve site.stripe_subscription_id - subscription.plan = params[:plan_type] - subscription.save - - site.update( - plan_ended: false, - plan_type: params[:plan_type] - ) - else - customer = Stripe::Customer.create( - card: params[:stripe_token], - description: "#{site.username} - #{site.id}", - email: site.email, - plan: params[:plan_type] - ) - - site.update( - stripe_customer_id: customer.id, - stripe_subscription_id: customer.subscriptions.first.id, - plan_ended: false, - plan_type: params[:plan_type] - ) - end - end - - if site.email - if is_special_upgrade - site.send_email( - subject: "[Neocities] Your site has been upgraded to supporter!", - body: Tilt.new('./views/templates/email/supporter_upgrade.erb', pretty: true).render(self) - ) - - redirect '/admin' - else - site.send_email( - subject: "[Neocities] You've become a supporter!", - body: Tilt.new('./views/templates/email_subscription.erb', pretty: true).render( - self, { - username: site.username, - plan_name: Site::PLAN_FEATURES[params[:plan_type].to_sym][:name], - plan_space: Site::PLAN_FEATURES[params[:plan_type].to_sym][:space].to_space_pretty, - plan_bw: Site::PLAN_FEATURES[params[:plan_type].to_sym][:bandwidth].to_space_pretty - }) - ) - end - end - - if is_special_upgrade - flash[:success] = "#{site.username} has been upgraded to supporter." - redirect '/admin' - end - - redirect params[:plan_type] == 'free' ? '/plan' : '/plan/thanks' -end - -get '/plan/thanks' do - require_login - erb :'plan/thanks' -end - -get '/plan/bitcoin/?' do - erb :'plan/bitcoin' -end - -get '/plan/alternate/?' do - redirect '/plan/bitcoin' -end - -def paypal_recurring_hash - { - ipn_url: "https://neocities.org/webhooks/paypal", - description: 'Neocities Supporter - Monthly', - amount: Site::PLAN_FEATURES[:supporter][:price].to_s, - currency: 'USD' - } -end - -def paypal_recurring_authorization_hash - paypal_recurring_hash.merge( - return_url: "https://neocities.org/plan/paypal/return", - cancel_url: "https://neocities.org/plan", - ipn_url: "https://neocities.org/webhooks/paypal" - ) -end - -get '/plan/paypal' do - require_login - redirect '/plan' if parent_site.supporter? - - hash = paypal_recurring_authorization_hash - - if current_site.paypal_token - hash.merge! token: current_site.paypal_token - end - - ppr = PayPal::Recurring.new hash - - paypal_response = ppr.checkout - - redirect paypal_response.checkout_url if paypal_response.valid? -end - -get '/plan/paypal/return' do - require_login - - if params[:token].nil? || params[:PayerID].nil? - flash[:error] = 'Unknown error, could not complete the request. Please contact Neocities support.' - end - - ppr = PayPal::Recurring.new(paypal_recurring_hash.merge( - token: params[:token], - payer_id: params[:PayerID] - )) - - paypal_response = ppr.request_payment - unless paypal_response.approved? && paypal_response.completed? - flash[:error] = 'Unknown error, could not complete the request. Please contact Neocities support.' - redirect '/plan' - end - - ppr = PayPal::Recurring.new(paypal_recurring_authorization_hash.merge( - frequency: 1, - token: params[:token], - period: :monthly, - reference: current_site.id.to_s, - payer_id: params[:PayerID], - start_at: 1.month.from_now, - failed: 3, - outstanding: :next_billing - )) - - paypal_response = ppr.create_recurring_profile - - current_site.paypal_token = params[:token] - current_site.paypal_profile_id = paypal_response.profile_id - current_site.paypal_active = true - current_site.plan_type = 'supporter' - current_site.save_changes validate: false - - redirect '/plan/thanks-paypal' -end - -get '/plan/thanks-paypal' do - require_login - erb :'plan/thanks-paypal' -end - -get '/plan/paypal/cancel' do - require_login - redirect '/plan' unless parent_site.paypal_active - ppr = PayPal::Recurring.new profile_id: parent_site.paypal_profile_id - ppr.cancel - - parent_site.plan_type = nil - parent_site.paypal_active = false - parent_site.paypal_profile_id = nil - parent_site.paypal_token = nil - parent_site.save_changes validate: false - redirect '/plan' + redirect '/supporter' end diff --git a/app/settings.rb b/app/settings.rb index f623e6cf..653ac8e8 100644 --- a/app/settings.rb +++ b/app/settings.rb @@ -32,15 +32,6 @@ post '/settings/:username/delete' do redirect "/settings/#{@site.username}#delete" end - if @site.parent? && @site.stripe_customer_id - customer = Stripe::Customer.retrieve @site.stripe_customer_id - subscription = customer.subscriptions.retrieve @site.stripe_subscription_id - subscription.plan = 'free' - subscription.save - @site.plan_type = 'free' - @site.save_changes validate: false - end - @site.deleted_reason = params[:deleted_reason] @site.save validate: false @site.destroy diff --git a/app/site_files.rb b/app/site_files.rb index 432eb9fe..d63fd90a 100644 --- a/app/site_files.rb +++ b/app/site_files.rb @@ -114,7 +114,7 @@ post '/site_files/upload' do file_upload_response "#{file[:filename]} is too large, upload cancelled." end if !current_site.okay_to_upload? file - file_upload_response %{#{file[:filename]}: file type (or content in file) is only supported by supporter accounts. Why We Do This} + file_upload_response %{#{file[:filename]}: file type (or content in file) is only supported by supporter accounts. Why We Do This} end end diff --git a/app/supporter.rb b/app/supporter.rb new file mode 100644 index 00000000..6eabd53e --- /dev/null +++ b/app/supporter.rb @@ -0,0 +1,186 @@ +get '/supporter/?' do + @title = 'Become a Supporter' + erb :'welcome' +end + +post '/supporter/end' do + require_login + redirect '/' unless parent_site.paying_supporter? + parent_site.end_supporter_membership! + + flash[:success] = "Your supporter membership has been cancelled. We're sorry to see you go, but thanks again for your support! Remember, you can always become a supporter again in the future." + redirect '/supporter' +end + +post '/supporter/update' do + require_login + + plan_type = 'supporter' + + if is_special_upgrade + require_admin + site = Site[username: params[:username]] + + plan_type = 'special' + + if site.nil? + flash[:error] = 'Cannot find the requested user.' + redirect '/admin' + end + end + + site ||= parent_site + + DB.transaction do + if site.stripe_customer_id + customer = Stripe::Customer.retrieve site.stripe_customer_id + customer.cards.each {|card| card.delete} + + if !params[:stripe_token].blank? + customer.sources.create source: params[:stripe_token] + end + + subscription = customer.subscriptions.create plan: plan_type + + site.plan_ended = false + site.plan_type = plan_type + site.stripe_subscription_id = subscription.id + site.save_changes validate: false + else + customer = Stripe::Customer.create( + card: params[:stripe_token], + description: "#{site.username} - #{site.id}", + email: site.email, + plan: plan_type + ) + + site.update( + stripe_customer_id: customer.id, + stripe_subscription_id: customer.subscriptions.first.id, + plan_ended: false, + plan_type: plan_type + ) + end + end + + if site.email + if is_special_upgrade + site.send_email( + subject: "[Neocities] Your site has been upgraded to supporter!", + body: Tilt.new('./views/templates/email/supporter_upgrade.erb', pretty: true).render(self) + ) + + redirect '/admin' + end + + site.send_email( + subject: "[Neocities] You've become a supporter!", + body: Tilt.new('./views/templates/email_subscription.erb', pretty: true).render( + self, { + username: site.username, + plan_name: Site::PLAN_FEATURES[params[:plan_type].to_sym][:name], + plan_space: Site::PLAN_FEATURES[params[:plan_type].to_sym][:space].to_space_pretty, + plan_bw: Site::PLAN_FEATURES[params[:plan_type].to_sym][:bandwidth].to_space_pretty + }) + ) + end + + if is_special_upgrade + flash[:success] = "#{site.username} has been upgraded to supporter." + redirect '/admin' + end + + redirect '/supporter/thanks' +end + +get '/supporter/thanks' do + require_login + erb :'supporter/thanks' +end + +get '/supporter/bitcoin/?' do + erb :'supporter/bitcoin' +end + +get '/supporter/paypal' do + require_login + redirect '/supporter' if parent_site.supporter? + + hash = paypal_recurring_authorization_hash + + if parent_site.paypal_token + hash.merge! token: parent_site.paypal_token + end + + ppr = PayPal::Recurring.new hash + + paypal_response = ppr.checkout + + if !paypal_response.valid? + flash[:error] = 'There was an issue connecting to Paypal, please contact support.' + redirect '/supporter' + end + + redirect paypal_response.checkout_url +end + +get '/supporter/paypal/return' do + require_login + + if params[:token].nil? || params[:PayerID].nil? + flash[:error] = 'Unknown error, could not complete the request. Please contact Neocities support.' + end + + ppr = PayPal::Recurring.new(paypal_recurring_hash.merge( + token: params[:token], + payer_id: params[:PayerID] + )) + + paypal_response = ppr.request_payment + unless paypal_response.approved? && paypal_response.completed? + flash[:error] = 'Unknown error, could not complete the request. Please contact Neocities support.' + redirect '/supporter' + end + + ppr = PayPal::Recurring.new(paypal_recurring_authorization_hash.merge( + frequency: 1, + token: params[:token], + period: :monthly, + reference: current_site.id.to_s, + payer_id: params[:PayerID], + start_at: 1.month.from_now, + failed: 3, + outstanding: :next_billing + )) + + paypal_response = ppr.create_recurring_profile + + current_site.paypal_token = params[:token] + current_site.paypal_profile_id = paypal_response.profile_id + current_site.paypal_active = true + current_site.plan_type = 'supporter' + current_site.save_changes validate: false + + redirect '/supporter/thanks-paypal' +end + +def paypal_recurring_hash + { + ipn_url: "https://neocities.org/webhooks/paypal", + description: 'Neocities Supporter - Monthly', + amount: Site::PLAN_FEATURES[:supporter][:price].to_s, + currency: 'USD' + } +end + +def paypal_recurring_authorization_hash + paypal_recurring_hash.merge( + return_url: "https://neocities.org/supporter/paypal/return", + cancel_url: "https://neocities.org/supporter", + ipn_url: "https://neocities.org/webhooks/paypal" + ) +end + +def is_special_upgrade + params[:username] && params[:plan_type] == 'special' +end diff --git a/app/webhooks.rb b/app/webhooks.rb index 695be1c7..fcf9b60c 100644 --- a/app/webhooks.rb +++ b/app/webhooks.rb @@ -40,6 +40,7 @@ post '/webhooks/stripe' do site = stripe_get_site_from_event event site.stripe_subscription_id = nil site.plan_type = nil + site.plan_ended = true site.save_changes validate: false EmailWorker.perform_async({ diff --git a/app_helpers.rb b/app_helpers.rb index 706addf1..54f99a46 100644 --- a/app_helpers.rb +++ b/app_helpers.rb @@ -88,38 +88,6 @@ def send_confirmation_email(site=current_site) }) end -def plan_pricing_button(plan_type) - plan_type = plan_type.to_s - - if !parent_site - %{Sign Up} - elsif parent_site && parent_site.plan_type == plan_type - if request.path.match /\/welcome/ - %{Get Started} - else - %{
Current Plan
} - end - else - #if plan_type == 'supporter' - # plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]*12}, once per year" - #else - plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]}, monthly" - #end - - if request.path.match /\/welcome/ - button_title = 'Get Started' - else - button_title = parent_site.plan_type == 'free' ? 'Upgrade' : 'Change' - end - - if button_title == 'Change' && parent_site && parent_site.paypal_active - return %{Change} - end - - %{#{button_title}} - end -end - def dont_browser_cache headers['Cache-Control'] = 'private, no-store, max-age=0, no-cache, must-revalidate, post-check=0, pre-check=0' headers['Pragma'] = 'no-cache' diff --git a/models/site.rb b/models/site.rb index 84976098..810de209 100644 --- a/models/site.rb +++ b/models/site.rb @@ -426,6 +426,8 @@ class Site < Sequel::Model def before_destroy DB.transaction { + owner.end_supporter_membership! if parent? + if !Dir.exist? DELETED_SITES_ROOT FileUtils.mkdir DELETED_SITES_ROOT end @@ -447,18 +449,10 @@ class Site < Sequel::Model end return if is_banned == true - - DB.transaction { - self.is_banned = true - self.banned_at = Time.now - save(validate: false) - - if !Dir.exist? BANNED_SITES_ROOT - FileUtils.mkdir BANNED_SITES_ROOT - end - - FileUtils.mv files_path, File.join(BANNED_SITES_ROOT, username) - } + self.is_banned = true + self.banned_at = Time.now + save validate: false + destroy site_files.each do |site_file| delete_cache site_file.path @@ -999,7 +993,7 @@ class Site < Sequel::Model def current_base_files_path(name=username) raise 'username missing' if name.nil? || name.empty? - return File.join BANNED_SITES_ROOT, name if is_banned + return File.join DELETED_SITES_ROOT, name if is_deleted base_files_path name end @@ -1114,7 +1108,43 @@ class Site < Sequel::Model end def stripe_paying_supporter? - stripe_customer_id && !plan_ended && values[:plan_type].match(/free|special/).nil? + owner.stripe_customer_id && !owner.plan_ended && owner.values[:plan_type] && owner.values[:plan_type].match(/free|special/).nil? + end + + def paypal_paying_supporter? + owner.paypal_active && owner.paypal_profile_id + end + + def paying_supporter? + return true if stripe_paying_supporter? || owner.values[:paypal_active] == true + end + + def end_supporter_membership! + owner.end_supporter_membership! unless parent? + + if stripe_paying_supporter? + customer = Stripe::Customer.retrieve stripe_customer_id + subscription = customer.subscriptions.retrieve stripe_subscription_id + subscription.delete + + self.plan_type = nil + self.stripe_subscription_id = nil + self.plan_ended = true + elsif paypal_paying_supporter? + ppr = PayPal::Recurring.new profile_id: paypal_profile_id + ppr.cancel + + self.plan_type = nil + self.paypal_active = false + self.paypal_profile_id = nil + self.paypal_token = nil + self.plan_ended = true + else + return false + end + + save_changes validate: false + true end def unconverted_legacy_supporter? diff --git a/tests/acceptance/settings/site_tests.rb b/tests/acceptance/settings/site_tests.rb index ad797303..665d56c5 100644 --- a/tests/acceptance/settings/site_tests.rb +++ b/tests/acceptance/settings/site_tests.rb @@ -312,12 +312,10 @@ describe 'delete' do fill_in 'deleted_reason', with: 'derp' click_button 'Delete Site' - subscription = Stripe::Customer.retrieve(@site.stripe_customer_id).subscriptions.first - - subscription.plan.id.must_equal 'free' + Stripe::Customer.retrieve(@site.stripe_customer_id).subscriptions.count.must_equal 0 @site.reload + @site.stripe_subscription_id.must_equal nil @site.is_deleted.must_equal true - @site.plan_type.must_equal 'free' end it 'should fail unless owned by current user' do diff --git a/tests/acceptance/plan_tests.rb b/tests/acceptance/supporter_tests.rb similarity index 87% rename from tests/acceptance/plan_tests.rb rename to tests/acceptance/supporter_tests.rb index 77a7f70d..42fe8f7b 100644 --- a/tests/acceptance/plan_tests.rb +++ b/tests/acceptance/supporter_tests.rb @@ -1,6 +1,6 @@ require_relative './environment.rb' -describe '/plan' do +describe '/supporter' do include Capybara::DSL before do @@ -24,16 +24,16 @@ describe '/plan' do end it 'should work for fresh signup' do - visit '/plan' + visit '/supporter' fill_in 'Card Number', with: '4242424242424242' fill_in 'Expiration Month', with: '01' fill_in 'Expiration Year', with: Date.today.next_year fill_in 'Cardholder\'s Name', with: 'Penelope' fill_in 'Card Validation Code', with: '123' find('#stripe_token').set @stripe_helper.generate_card_token - find('#upgradePlanType').set 'supporter' - click_button 'Upgrade' - page.current_path.must_equal '/plan/thanks' + #find('#upgradePlanType').set 'supporter' + click_link 'Upgrade for' + page.current_path.must_equal '/supporter/thanks' page.body.must_match /You now have the Supporter plan./ @site.reload @site.stripe_customer_id.wont_be_nil diff --git a/tests/site_tests.rb b/tests/site_tests.rb index 5cf387cb..2dbf3770 100644 --- a/tests/site_tests.rb +++ b/tests/site_tests.rb @@ -10,7 +10,7 @@ describe Site do site = Fabricate :site site.ban! File.exist?(site.current_files_path('index.html')).must_equal true - site.current_files_path('index.html').must_equal File.join(Site::BANNED_SITES_ROOT, site.username, 'index.html') + site.current_files_path('index.html').must_equal File.join(Site::DELETED_SITES_ROOT, site.username, 'index.html') end end diff --git a/views/_header_links.erb b/views/_header_links.erb index 7a1ce4a3..c61a8d4f 100644 --- a/views/_header_links.erb +++ b/views/_header_links.erb @@ -15,7 +15,7 @@ Learn
  • - + <% if signed_in? %> <% unless current_site.supporter? %> Upgrade to Supporter diff --git a/views/about.erb b/views/about.erb index 52f9f848..b7744d48 100644 --- a/views/about.erb +++ b/views/about.erb @@ -47,7 +47,7 @@

    - If you share our values, we would love your support. Spread the word! We also have a supporter plan to help pay for the site, and we accept donations through multiple options (including Bitcoin... and Dogecoin). + If you share our values, we would love your support. Spread the word! We also have a supporter plan to help pay for the site, and we accept donations through multiple options (including Bitcoin... and Dogecoin).

    <%== erb :'_team', layout: false %> diff --git a/views/admin.erb b/views/admin.erb index 578485a0..5efcd038 100644 --- a/views/admin.erb +++ b/views/admin.erb @@ -56,7 +56,7 @@

    Upgrade to Supporter

    -
    + <%== csrf_token_input_html %>

    This site will be upgraded to the supporter plan.

    diff --git a/views/contact.erb b/views/contact.erb index 380c98cd..5c1738d8 100644 --- a/views/contact.erb +++ b/views/contact.erb @@ -77,7 +77,7 @@

    - Our API allows you to very easily write a script to upload content if you need. We also have WebDAV available for supporter accounts, which allows you to mount your Neocities site as a disk on your computer. + Our API allows you to very easily write a script to upload content if you need. We also have WebDAV available for supporter accounts, which allows you to mount your Neocities site as a disk on your computer.

    diff --git a/views/dashboard.erb b/views/dashboard.erb index c925734f..437ff38c 100644 --- a/views/dashboard.erb +++ b/views/dashboard.erb @@ -38,7 +38,7 @@ <% end %>
  • Using <%= current_site.space_percentage_used %>% (<%= current_site.total_space_used.to_space_pretty %>) of your <%= current_site.maximum_space.to_space_pretty %>.
    - <% unless current_site.is_education || current_site.supporter? %>Need more space? Become a Supporter!<% end %>
  • + <% unless current_site.is_education || current_site.supporter? %>Need more space? Become a Supporter!<% end %>
  • <%= current_site.views.format_large_number %> views
  • diff --git a/views/education.erb b/views/education.erb index 6359b25f..03a55985 100644 --- a/views/education.erb +++ b/views/education.erb @@ -187,7 +187,7 @@

    Support Us

    -

    Neocities is funded directly by our community through supporter plans and donations. We will never sell users' personal data or embed advertising on member sites. Your support allows us to pay for server costs and continue working on Neocities full-time. You can support us by making a one-time donation or by subscribing for $5/month.

    +

    Neocities is funded directly by our community through supporter plans and donations. We will never sell users' personal data or embed advertising on member sites. Your support allows us to pay for server costs and continue working on Neocities full-time. You can support us by making a one-time donation or by subscribing for $5/month.

    @@ -202,7 +202,7 @@

    Support Us

    - Neocities is funded by supporters and donations. If you’d like to contribute, you can help us pay our server costs using credit card, Bitcoin, or PayPal. + Neocities is funded by supporters and donations. If you’d like to contribute, you can help us pay our server costs using credit card, Bitcoin, or PayPal.

    Donate Today diff --git a/views/home_mockup.erb b/views/home_mockup.erb deleted file mode 100644 index ae182b90..00000000 --- a/views/home_mockup.erb +++ /dev/null @@ -1,287 +0,0 @@ -
    -
    - -
    -

    My Website

    - Edit Site -
    -
    -
    - -
    -
    -
    - <% if false %> -
    -

    Welcome to your Neocities news feed!

    -

    You aren't following any websites yet! Once you do, updates will show up here and you can like and comment on them. Here are some website suggestions based on your tags, or check out all the sites on Neocities!

    -
    - - - - - - - - - - - - - <% end %> - - - - - -
    -
    -
    - New sites in games3h -
    - -
    - - - -
    -
    -
    - You tipped Derp's website: Wow, great work here! Please keep updating :)Apr 23 -
    -
    - -
    - -
    - - - -
    -
    -
    - Derp made an update Apr 7 -
    -
    -
    - - - -
    - -
    - -
    - -
    -
    - -
    -
    -
    - Derpie - Apr 7 -
    Your site is amazing. Very helpful information. Would love to see more updates if you have time. Your site is amazing. Very helpful information. Would love to see more updates if you have time.
    -
    -
    - -
    -
    - - victoria Indeed, it's great!Apr 7 - -
    -
    -
    -
    - -
    - -
    - - - -
    -
    -
    - victoria tipped you .01 BTC - Apr 7 -
    Hey, this looks great!
    -
    - -
    -
    - -
    -

    http://<%= current_site.username %>.neocities.org

    -
    -
    Last updated
    <%= current_site.updated_at ? current_site.updated_at.ago : '' %>
    -
    -
    <%= current_site.hits.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse %> hits
    -
    24 followers
    -
    3 tips ($13.55)
    -
    -
    - - - -

    Following

    -
    - - - - - - - - - - - - - - -
    - -

    Tags

    - Games - Anime - Art - Cooking - Games - Anime - Art - Cooking -
    -
    -
    diff --git a/views/index.erb b/views/index.erb index 958509c9..8e68058b 100644 --- a/views/index.erb +++ b/views/index.erb @@ -228,21 +228,21 @@ Zero advertising

    - Neocities will never sell your personal data or embed advertising on your site. Instead, we are funded directly by our community through supporter plans and donations. This allows us to base all our decisions on making the best possible web building experience for you, rather than on appeasing ad companies. + Neocities will never sell your personal data or embed advertising on your site. Instead, we are funded directly by our community through supporters and donations. This allows us to base all our decisions on making the best possible web building experience for you, rather than on appeasing ad companies.

    More space, speed, and security

    -

    Neocities now uses distributed, globally-cached web servers in datacenters all over the world to serve your site. Whether it’s your personal home page or a busy professional site, your site loads fast. And if you need more space, we've got you covered. We also provide Snowden-grade SSL cryptography on all sites, preventing snoops from seeing what you browse.

    +

    Neocities now uses distributed, globally-cached web servers in datacenters all over the world to serve your site. Whether it’s your personal home page or a busy professional site, your site loads fast. And if you need more space, we've got you covered. We also provide Snowden-grade SSL cryptography on all sites, preventing snoops from seeing what you browse.

    Developer tools

    -

    Our fast static hosting comes with a great in-browser HTML editor, easy file uploading, RSS feeds for every site, powerful APIs for building developer applications, and much more! Upgrade to a supporter plan to get support for custom domains and WebDAV publishing.

    +

    Our fast static hosting comes with a great in-browser HTML editor, easy file uploading, RSS feeds for every site, powerful APIs for building developer applications, and much more! Upgrade to a supporter plan to get support for custom domains and WebDAV publishing.

    @@ -296,7 +296,7 @@

    Support Us

    - Neocities is funded by supporters and donations. If you’d like to contribute, you can help us pay our server costs using credit card, Bitcoin, or PayPal. + Neocities is funded by supporters and donations. If you’d like to contribute, you can help us pay our server costs using credit card, Bitcoin, or PayPal.

    Donate Today
    diff --git a/views/plan/_pricing.erb b/views/plan/_pricing.erb deleted file mode 100644 index db4b9bc8..00000000 --- a/views/plan/_pricing.erb +++ /dev/null @@ -1,230 +0,0 @@ -
    - <% if request.path.match /\/welcome/ %> -
    - <% end %> -

    - <% if request.path == '/' %> - Need more space? We’ve got you covered. -
    - Upgrading gives you more space, bandwidth, features, and helps us stay independent and keep the free sites free. - <% elsif request.path.match /\/welcome/ %> - Welcome to Neocities! - <% else %> - Support Us - <% end %> -

    - - <% if request.path.match /\/plan/ %> -
    -
    -

    - The Neocities Supporter Plan is a way to help sustain the site. When you become a supporter, you are directly helping our quest to bring back the creative, independent web, and to continue to improve Neocities for everyone. -

    -
    -
    - <% elsif request.path.match /\/welcome/ %> -
    -
    -

    - Welcome, and thanks for signing up! We can't wait to see your web site! -
    - Neocities does not put advertising on your site, and we never will. -
    - Instead, Neocities is powered by supporters like you. If you'd like to help us out, we'd love your support. Thank you! -

    -
    -
    - <% end %> - -
    -
    -
    - Free -
    -
    - Supporter -
    -
    - -
    -
    -
    -
    -

    Free

    -
    $<%= Site::PLAN_FEATURES[:free][:price] %>
    -
    per month
    - <%== plan_pricing_button :free %> -
      -
    • <%= Site::PLAN_FEATURES[:free][:space].to_space_pretty %> storage
    • -
    • <%= Site::PLAN_FEATURES[:free][:bandwidth].to_space_pretty %> bandwidth
    • -
    -
      -
    -
    - -
    -
    -

    Supporter

    - <% if parent_site && parent_site.legacy_supporter? %> -
    $<%= Site::LEGACY_SUPPORTER_PRICES[parent_site[:plan_type].to_sym] %>
    -
    per month, billed annually
    - <% else %> -
    $<%= Site::PLAN_FEATURES[:supporter][:price] %>
    -
    per month
    - <% end %> - - <% if parent_site && parent_site.legacy_supporter? %> -
    Current Plan
    - <% else %> - <%== plan_pricing_button :supporter %> - <% end %> -
      -
    • <%= Site::PLAN_FEATURES[:supporter][:space].to_space_pretty %> storage
    • -
    • <%= Site::PLAN_FEATURES[:supporter][:bandwidth].to_space_pretty %> bandwidth
    • -
    -
      -
    • Lots of Web Space
    • -
    • No File Upload Type Restrictions
    • -
    • Multiple Site Creation
    • -
    • Custom Domains (yoursite.com)
    • -
    • SSL Certs Included
    • -
    • Remote Filesystem Support
    • -
    -
    - -
    -
    - - <%== erb :'plan/_compare', layout: false %> - - <% if request.path.match /\/plan/ %> -
    -
    -

    Why become a Supporter?

    -
    -
    - -
    -
    -
      -
    • - You get more space! Right now supporter plans get up to <%= Site::PLAN_FEATURES[:supporter][:space].to_space_pretty %>. -
    • -
    • - It helps your site. Funding helps us make your site faster globally, and provide more features. -
    • -
    • - It helps us build. It supports our goal to work on improving Neocities full-time, without worrying about bills. -
    • -
    • - It helps the web. The web needs more independent, creative web sites. -
    • -
    • - It's Open Source. Neocities is an Open Company, our site is completely open source, and we share code with the community. -
    • -
    • - No lock-in. Redirecting your site is easy, free site downloads, and support for custom domains. -
    • -
    • No ads, ever. We'll never put ads or watermarks on sites, and we don't sell user data.
    • -
    • - It's safe. We use Stripe for payments, and never store your credit card information directly. -
    • -
    • - It's affordable. Only $<%= Site::PLAN_FEATURES[:supporter][:price] %> per month. -
    • -
    • - You can cancel or change plans anytime. If you do, we'll refund or credit the amount you didn't use. -
    • -
    -
    -
    - <% end %> -
    - - - - - -<% if current_site %> - <%== erb :'plan/_signupcode', layout: false %> -<% end %> diff --git a/views/plan/thanks-paypal.erb b/views/plan/thanks-paypal.erb deleted file mode 100644 index bb9c8032..00000000 --- a/views/plan/thanks-paypal.erb +++ /dev/null @@ -1,31 +0,0 @@ -
    -
    -

    Thank You!

    -

    Your support means a lot to us.

    -
    -
    - -
    -
    -
    - -

    You signed up for the Supporter Plan.
    Thank you for your support!

    - -

    - Your support allows Neocities to continue our project to bring back the creative web. We will do our best to ensure that the site remains a great place for people to express themselves - one web page at a time. -

    - -

    - If you need anything, please don't hesitate to contact us! -

    - -

    - On behalf of Penelope (the Neocities' cat) and everyone else at Neocities, thank you. -

    - -

    - Get Started -

    -
    - <%== erb :'_team', layout: false %> -
    diff --git a/views/profile_mockup.erb b/views/profile_mockup.erb deleted file mode 100644 index 415b53bb..00000000 --- a/views/profile_mockup.erb +++ /dev/null @@ -1,192 +0,0 @@ -
    -
    - -
    -

    Derp's Website

    -

    http://<%= site.username %>.neocities.org

    -
    -
    23.5K visitors
    -
    342 followers
    -
    7 tips
    -
    -
    - - Tip - -
    -
    -
    -
    - -
    -
    -
    - -
    - - Post -
    - - - -
    - -
    - -
    - -
    - - - -
    -
    -
    - Derp made an update Apr 7 -
    -
    -
    - - - -
    - -
    - -
    - -
    -
    - -
    -
    -
    - Foo - Apr 7 -
    Your site is amazing. Very helpful information. Would love to see more updates if you have time. Your site is amazing. Very helpful information. Would love to see more updates if you have time.
    -
    -
    - -
    -
    - - victoria Indeed, it's great!Apr 7 - -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    - victoria tipped .01 BTC - Apr 7 -
    Hey, this looks great!
    -
    - -
    - -
    - -
    -

    Website Stats

    -
    -
    - Last updated - - <% if site.updated_at.nil? %> - Just Created - <% else %> - <%= site.updated_at.ago.downcase %> - <% end %> - -
    -
    Total updates<%= site.changed_count %>
    -
    Created<%= site.created_at.strftime('%B %-d, %Y') %>
    -
    - -

    Archives

    -
    - - - - - See all versions -
    - -

    Following

    -
    - - - - - - - - - - - - - - -
    - -

    Tags

    - Games - Anime - Art - Cooking - Games - Anime - Art - Cooking - -
    - Report | Block -
    -
    -
    -
    \ No newline at end of file diff --git a/views/settings/account.erb b/views/settings/account.erb index 0558abe2..5b93074a 100644 --- a/views/settings/account.erb +++ b/views/settings/account.erb @@ -23,21 +23,22 @@
    -
    - <%== erb :'settings/account/plan' %> -
    -
    +
    <%== erb :'settings/account/sites' %>
    +
    + <%== erb :'settings/account/supporter' %> +
    <%== erb :'settings/account/password' %>
    diff --git a/views/settings/account/billing.erb b/views/settings/account/billing.erb index a9378954..4c68aebc 100644 --- a/views/settings/account/billing.erb +++ b/views/settings/account/billing.erb @@ -38,7 +38,7 @@ Update Card
    -<%== erb :'plan/_signupcode', layout: false %> +<%== erb :'supporter/_signupcode', layout: false %>