diff --git a/app/index.rb b/app/index.rb index 3fca82f0..f621b986 100644 --- a/app/index.rb +++ b/app/index.rb @@ -34,6 +34,12 @@ get '/?' do erb :index, layout: false end +get '/welcome' do + require_login + redirect '/' if current_site.plan_type != 'free' + erb :'welcome' +end + get '/tutorials' do erb :'tutorials' end diff --git a/tests/acceptance/signup_tests.rb b/tests/acceptance/signup_tests.rb index b0ad9ed6..11192a07 100644 --- a/tests/acceptance/signup_tests.rb +++ b/tests/acceptance/signup_tests.rb @@ -1,5 +1,9 @@ require_relative './environment.rb' +Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, js_errors: false) +end + describe 'signup' do include Capybara::DSL @@ -15,7 +19,7 @@ describe 'signup' do end def site_created? - page.must_have_content 'Your Feed' + page.must_have_content 'Welcome to Neocities' end def visit_signup @@ -33,7 +37,6 @@ describe 'signup' do end it 'succeeds with valid data' do - Capybara.default_driver = :poltergeist fill_in_valid click_signup_button site_created?.must_equal true @@ -52,7 +55,7 @@ describe 'signup' do it 'fails to create for existing site' do fill_in_valid click_signup_button - page.must_have_content 'Your Feed' + page.must_have_content 'Welcome to Neocities' Capybara.reset_sessions! visit_signup fill_in 'username', with: @site[:username] diff --git a/views/index.erb b/views/index.erb index 0f4c5f7d..9b575028 100644 --- a/views/index.erb +++ b/views/index.erb @@ -396,7 +396,7 @@ - <%== erb :'_footer', layout: false%> + <%== erb :'_footer', layout: false %> @@ -408,7 +408,7 @@ $.post('/create_validate_all', $(obj.target).serialize(), function(errors) { if(errors.length == 0) { $.post('/create', $('#createSiteForm').serialize(), function(res) { - location.reload() + window.location.href = '/welcome' }) } else { for(var i=0; iSign Up} elsif parent_site && parent_site.plan_type == plan_type - %{
Current Plan
} + 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 - %{#{parent_site.plan_type == 'free' ? 'Upgrade' : 'Change'}} + + if request.path.match /\/welcome/ + button_title = 'Get Started' + else + button_title = parent_site.plan_type == 'free' ? 'Upgrade' : 'Change' + end + + %{#{button_title}} end end %>
+ <% 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 /\/plan/ %> + <% elsif request.path.match /\/welcome/ %> + Welcome to Neocities! + <% else %> Support Us <% end %>

@@ -36,6 +52,18 @@ + <% 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 %>
@@ -65,7 +93,7 @@
-
+

Supporter

<% if parent_site && parent_site.legacy_supporter? %>
$<%= Site::LEGACY_SUPPORTER_PRICES[parent_site[:plan_type].to_sym] %>
@@ -374,16 +402,12 @@ <% if current_site %> - - + <% end %> \ No newline at end of file diff --git a/views/welcome.erb b/views/welcome.erb new file mode 100644 index 00000000..8ca9203e --- /dev/null +++ b/views/welcome.erb @@ -0,0 +1 @@ +<%== erb :'plan/_pricing' %> \ No newline at end of file