From a2c01e91dddc4ef197e39246a06e8171addc3d83 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sat, 20 Dec 2014 17:51:50 -0800 Subject: [PATCH] finishing touches --- app/plan.rb | 4 + app/stats.rb | 4 +- models/site.rb | 46 ++++---- views/contact.erb | 2 +- views/donate.erb | 1 + views/plan/_pricing.erb | 154 +++++++------------------- views/press.erb | 2 + views/settings/site/custom_domain.erb | 50 ++++++--- 8 files changed, 102 insertions(+), 161 deletions(-) diff --git a/app/plan.rb b/app/plan.rb index 468baa0f..71902ef6 100644 --- a/app/plan.rb +++ b/app/plan.rb @@ -59,4 +59,8 @@ end get '/plan/thanks' do require_login erb :'plan/thanks' +end + +get '/plan/alternate' do + erb :'/plan/alternate' end \ No newline at end of file diff --git a/app/stats.rb b/app/stats.rb index 0706e2ab..390a294e 100644 --- a/app/stats.rb +++ b/app/stats.rb @@ -21,9 +21,9 @@ get '/stats/?' do monthly_stats = [] - now = Time.now + now = Date.today - until runner.year == now.year && runner.month == now.month+1 + until runner.to_time > now.next_month.to_time monthly_stats.push( date: runner, sites_created: Site.where(created_at: runner..runner.next_month).count, diff --git a/models/site.rb b/models/site.rb index ffa28e8c..bfe5fc81 100644 --- a/models/site.rb +++ b/models/site.rb @@ -79,46 +79,38 @@ class Site < Sequel::Model IP_CREATE_LIMIT = 50 TOTAL_IP_CREATE_LIMIT = 300 - PLAN_FEATURES = { - fatcat: { - name: 'Fat Cat', - space: Filesize.from('20GB').to_i, - bandwidth: Filesize.from('3TB').to_i, - price: 10, - unlimited_site_creation: true, - custom_ssl_certificates: true, - no_file_restrictions: true - } - } + PLAN_FEATURES = {} - PLAN_FEATURES[:catbus] = PLAN_FEATURES[:fatcat].merge( - name: 'Cat Bus', + PLAN_FEATURES[:supporter] = { + name: 'Supporter', space: Filesize.from('5GB').to_i, bandwidth: Filesize.from('1TB').to_i, price: 5, - ) - - PLAN_FEATURES[:supporter] = PLAN_FEATURES[:catbus].merge( - name: 'Supporter', - space: Filesize.from('1GB').to_i, - bandwidth: Filesize.from('0.5TB').to_i, - price: 2, - custom_ssl_certificates: false, - no_file_restrictions: false - ) + unlimited_site_creation: true, + custom_ssl_certificates: true, + no_file_restrictions: true, + custom_domains: true + } PLAN_FEATURES[:free] = PLAN_FEATURES[:supporter].merge( name: 'Free', - space: Filesize.from('30MB').to_i, - bandwidth: Filesize.from('100GB').to_i, + space: Filesize.from('50MB').to_i, + bandwidth: Filesize.from('50GB').to_i, price: 0, - unlimited_site_creation: false + unlimited_site_creation: false, + custom_ssl_certificates: false, + no_file_restrictions: false, + custom_domains: false ) def plan_feature(key) PLAN_FEATURES[plan_type.to_sym][key.to_sym] end + def custom_domain_available? + owner.plan_feature(:custom_domains) == true || !domain.nil? + end + LEGACY_SUPPORTER_PRICES = { plan_one: 1, plan_two: 2, @@ -464,7 +456,7 @@ class Site < Sequel::Model end def okay_to_upload?(uploaded_file) - return true if [:catbus, :fatcat].include?(plan_type.to_sym) + return true if [:supporter].include?(plan_type.to_sym) self.class.valid_file_type?(uploaded_file) end diff --git a/views/contact.erb b/views/contact.erb index 72d706ca..dc724eb7 100644 --- a/views/contact.erb +++ b/views/contact.erb @@ -27,7 +27,7 @@ For security reasons, we cannot reset your password if you did not enter an e-mail for your site. You will have to make a new site (don't worry, it's free!). If you didn't get an e-mail from the password reset form, you didn't enter an e-mail (or it's in your spam folder). Again you will have to make a new site, we cannot help you for security reasons.
  • - We do not support FTP or GIT uploading, and have no plans to. SFTP possibly, if we can find the time. + We do not support SFTP or GIT uploading, though we may in the future. Instead, we currently support WebDAV.
  • diff --git a/views/donate.erb b/views/donate.erb index 1ce5aee9..6c8fceeb 100644 --- a/views/donate.erb +++ b/views/donate.erb @@ -13,6 +13,7 @@

    How to Donate

    +

    If you send a donation and want to become a supporter, send us an email and we'll take care of it. Thanks!

    Gratipay:

    diff --git a/views/plan/_pricing.erb b/views/plan/_pricing.erb index f0aa1e37..f8078d0e 100644 --- a/views/plan/_pricing.erb +++ b/views/plan/_pricing.erb @@ -7,11 +7,11 @@ elsif parent_site && parent_site.plan_type == plan_type %{
    Current Plan
    } else - if plan_type == 'supporter' - plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]*12}, once per year" - 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 + #end %{#{parent_site.plan_type == 'free' ? 'Upgrade' : 'Change'}} end end @@ -20,7 +20,7 @@

    <% if request.path == '/' %> - Need more space? We’ve got you covered. + 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 /\/plan/ %> @@ -32,7 +32,7 @@

    - The Neocities Supporter Plans are a way to help sustain the site. When you join a Supporter Plan, you are directly helping our quest to bring back the creative, independent web, and to continue to improve Neocities for everyone. + 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.

    @@ -40,17 +40,17 @@
    -
    +
    Free
    -
    +
    Supporter
    -
    +

    Free

    $<%= Site::PLAN_FEATURES[:free][:price] %>
    @@ -65,14 +65,14 @@
    -
    +

    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, billed annually
    +
    per month
    <% end %> <% if parent_site && parent_site.legacy_supporter? %> @@ -82,55 +82,23 @@ <% end %>
    • <%= Site::PLAN_FEATURES[:supporter][:space].to_space_pretty %> storage
    • -
    • <%= Site::PLAN_FEATURES[:supporter][:bandwidth].to_space_pretty %> bandwidth
    • +
    • 1000 GB bandwidth
      -
    • Unlimited Sites
    • -
    • More space
    • +
    • Lots of Web Space
    • +
    • No File Upload Type Restrictions
    • +
    • Unlimited Site Creation
    • +
    • Custom Domains (yoursite.com)
    • +
    • Remote Filesystem Support
    • +
    • Custom SSL Certs (coming soon!)
    -
    - -
    -

    Cat Bus

    -
    $<%= Site::PLAN_FEATURES[:catbus][:price] %>
    -
    per month
    - <%== plan_pricing_button :catbus %> -
      -
    • <%= Site::PLAN_FEATURES[:catbus][:space].to_space_pretty %> storage
    • -
    • <%= Site::PLAN_FEATURES[:catbus][:bandwidth].to_space_pretty %> bandwidth
    • -
    -
      -
    • Unlimited Sites
    • -
    • Custom SSL Certificates (coming soon)
    • -
    • No upload type restrictions
    • -
    • Even more space
    • -
    -
    - -
    -
    -

    Fat Cat

    -
    $<%= Site::PLAN_FEATURES[:fatcat][:price] %>
    -
    per month
    - <%== plan_pricing_button :fatcat %> -
      -
    • <%= Site::PLAN_FEATURES[:fatcat][:space].to_space_pretty %> storage
    • -
    • <%= Site::PLAN_FEATURES[:fatcat][:bandwidth].to_space_pretty %> bandwidth
    • -
    -
      -
    • Unlimited Sites
    • -
    • Custom SSL Certificates (coming soon)
    • -
    • No upload type restrictions
    • -
    • A lot more space!
    • -
    -
    -

    Compare Plans

    +

    Compare

    @@ -149,16 +117,6 @@ <%== plan_pricing_button :supporter %> <% end %> - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - @@ -309,8 +235,6 @@ No File Upload Type Restrictions - -
    -

    Cat Bus

    -

    $<%= Site::PLAN_FEATURES[:catbus][:price] %>/mo

    - <%== plan_pricing_button :catbus %> -
    -

    Fat Cat

    -

    $<%= Site::PLAN_FEATURES[:fatcat][:price] %>/mo

    - <%== plan_pricing_button :fatcat %> -
    @@ -166,17 +124,13 @@ <%= Site::PLAN_FEATURES[:free][:space].to_bytes_pretty %> <%= Site::PLAN_FEATURES[:supporter][:space].to_bytes_pretty %><%= Site::PLAN_FEATURES[:catbus][:space].to_bytes_pretty %><%= Site::PLAN_FEATURES[:fatcat][:space].to_bytes_pretty %>
    Bandwidth <%= Site::PLAN_FEATURES[:free][:bandwidth].to_bytes_pretty %><%= Site::PLAN_FEATURES[:supporter][:bandwidth].to_bytes_pretty %><%= Site::PLAN_FEATURES[:catbus][:bandwidth].to_bytes_pretty %><%= Site::PLAN_FEATURES[:fatcat][:bandwidth].to_bytes_pretty %>1000 GB
    @@ -184,8 +138,6 @@
    @@ -193,8 +145,6 @@
    @@ -202,26 +152,6 @@
    - Custom Domains -
    - WebDAV Uploading -
    @@ -229,8 +159,6 @@
    @@ -238,8 +166,6 @@
    @@ -247,8 +173,6 @@
    @@ -256,8 +180,6 @@
    @@ -265,8 +187,6 @@
    @@ -274,34 +194,40 @@
    + WebDAV Uploading +
    + Custom Domains +
    Unlimited Site Creation
    Custom SSL Certs (soon)
    @@ -318,7 +242,7 @@ <% if request.path.match /\/plan/ %>
    -

    Why get a Supporter Plan?

    +

    Why become a Supporter?

    @@ -326,7 +250,7 @@
    • - You get more space! Right now supporter plans get up to <%= Site::PLAN_FEATURES[:fatcat][:space].to_space_pretty %>. + 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. @@ -335,10 +259,10 @@ It helps us build. It supports our goal to work on Neocities full-time, without worrying about bills.
    • - It helps the web. The web needs more independent, creative sites. Neocities is leading the way. + It helps the web. The web needs more independent, creative sites.
    • - It's Open Source. Neocities is completely open source, and we share code with the community. + 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. @@ -436,7 +360,7 @@ <% unless params[:stripe_token] || (current_site && parent_site.stripe_customer_id) %>

      - Don't have a Credit Card? We support Bitcoin and Paypal! Click here for more information. + Don't have a Credit/Debit Card? We support Bitcoin and Paypal! Click here for more information.

      <% end %>
    diff --git a/views/press.erb b/views/press.erb index 6b7f5b39..62027f50 100644 --- a/views/press.erb +++ b/views/press.erb @@ -40,6 +40,8 @@

    Download: SVG

    + +

    There are no creative restrictions on the use of these images. Go nuts.

    diff --git a/views/settings/site/custom_domain.erb b/views/settings/site/custom_domain.erb index 49bbe8fe..d22174d4 100644 --- a/views/settings/site/custom_domain.erb +++ b/views/settings/site/custom_domain.erb @@ -1,30 +1,48 @@

    Custom Domain

    -

    Add your own domain name to your Neocities site!

    +

    Add your own domain name to your Neocities site

    - Adding a custom domain allows you to have a domain name attached to your web site. So if you had a domain like catsknitting.com, you could have it point to your Neocities site! + Adding a custom domain allows you to have a domain name attached to your web site. So if you had a domain like catsknitting.com, you could have it point to your Neocities site.

    - You will have to purchase a domain name from a registrar like Namecheap, and then add an A record to point your domain (catsknitting.com) to the following IP address: + You will have to purchase a domain name from a registrar like Namecheap first. We are working on providing domain purchasing from Neocities in the future, but in general it is best if you own the domain, because then you control your site.

    -

    198.27.81.179

    +<% if current_site.custom_domain_available? %> +

    + We will be using catsknitting.com for the examples below. +

    -

    - If you want to add a www subdomain, or use a wildcard that will answer to everything (*), you will have to make a CNAME pointing to catsknitting.com for www and/or *. -

    -

    - After that, you can add the domain to the box below (just the catsknitting.com, don't add any subdomains), and your domain should come online within 5 minutes: -

    +

    Step 1

    +

    + First, you need to add an "A record" to point your root domain (catsknitting.com) to the following IP address: +

    -
    - <%== csrf_token_input_html %> - -
    - -
    +

    54.68.34.66

    + +

    Step 2

    + +

    + Next, you need to add a CNAME record which points www.catsknitting.com to proxy.neocitiesops.net. +

    + +

    Step 3

    + +

    + Add the domain name to the box below (just the catsknitting.com, don't add any subdomains), and your domain should come online within 5 minutes: +

    + +
    + <%== csrf_token_input_html %> + +
    + +
    +<% else %> + Custom domains require a Supporter account. Upgrade now. +<% end %>

    Add SSL Certificate