mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
Welcome screen for new users
This commit is contained in:
parent
c66a935cb1
commit
84f4c3b3aa
5 changed files with 48 additions and 14 deletions
|
@ -34,6 +34,12 @@ get '/?' do
|
||||||
erb :index, layout: false
|
erb :index, layout: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
get '/welcome' do
|
||||||
|
require_login
|
||||||
|
redirect '/' if current_site.plan_type != 'free'
|
||||||
|
erb :'welcome'
|
||||||
|
end
|
||||||
|
|
||||||
get '/tutorials' do
|
get '/tutorials' do
|
||||||
erb :'tutorials'
|
erb :'tutorials'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
require_relative './environment.rb'
|
require_relative './environment.rb'
|
||||||
|
|
||||||
|
Capybara.register_driver :poltergeist do |app|
|
||||||
|
Capybara::Poltergeist::Driver.new(app, js_errors: false)
|
||||||
|
end
|
||||||
|
|
||||||
describe 'signup' do
|
describe 'signup' do
|
||||||
include Capybara::DSL
|
include Capybara::DSL
|
||||||
|
|
||||||
|
@ -15,7 +19,7 @@ describe 'signup' do
|
||||||
end
|
end
|
||||||
|
|
||||||
def site_created?
|
def site_created?
|
||||||
page.must_have_content 'Your Feed'
|
page.must_have_content 'Welcome to Neocities'
|
||||||
end
|
end
|
||||||
|
|
||||||
def visit_signup
|
def visit_signup
|
||||||
|
@ -33,7 +37,6 @@ describe 'signup' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'succeeds with valid data' do
|
it 'succeeds with valid data' do
|
||||||
Capybara.default_driver = :poltergeist
|
|
||||||
fill_in_valid
|
fill_in_valid
|
||||||
click_signup_button
|
click_signup_button
|
||||||
site_created?.must_equal true
|
site_created?.must_equal true
|
||||||
|
@ -52,7 +55,7 @@ describe 'signup' do
|
||||||
it 'fails to create for existing site' do
|
it 'fails to create for existing site' do
|
||||||
fill_in_valid
|
fill_in_valid
|
||||||
click_signup_button
|
click_signup_button
|
||||||
page.must_have_content 'Your Feed'
|
page.must_have_content 'Welcome to Neocities'
|
||||||
Capybara.reset_sessions!
|
Capybara.reset_sessions!
|
||||||
visit_signup
|
visit_signup
|
||||||
fill_in 'username', with: @site[:username]
|
fill_in 'username', with: @site[:username]
|
||||||
|
|
|
@ -408,7 +408,7 @@
|
||||||
$.post('/create_validate_all', $(obj.target).serialize(), function(errors) {
|
$.post('/create_validate_all', $(obj.target).serialize(), function(errors) {
|
||||||
if(errors.length == 0) {
|
if(errors.length == 0) {
|
||||||
$.post('/create', $('#createSiteForm').serialize(), function(res) {
|
$.post('/create', $('#createSiteForm').serialize(), function(res) {
|
||||||
location.reload()
|
window.location.href = '/welcome'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
for(var i=0; i<errors.length;i++) {
|
for(var i=0; i<errors.length;i++) {
|
||||||
|
|
|
@ -5,25 +5,41 @@
|
||||||
if !parent_site
|
if !parent_site
|
||||||
%{<a href="/#new" class="btn-Action">Sign Up</a>}
|
%{<a href="/#new" class="btn-Action">Sign Up</a>}
|
||||||
elsif parent_site && parent_site.plan_type == plan_type
|
elsif parent_site && parent_site.plan_type == plan_type
|
||||||
|
if request.path.match /\/welcome/
|
||||||
|
%{<a href="/" class="btn-Action">Get Started</a>}
|
||||||
|
else
|
||||||
%{<div class="current-plan">Current Plan</div>}
|
%{<div class="current-plan">Current Plan</div>}
|
||||||
|
end
|
||||||
else
|
else
|
||||||
#if plan_type == 'supporter'
|
#if plan_type == 'supporter'
|
||||||
# plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]*12}, once per year"
|
# plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]*12}, once per year"
|
||||||
#else
|
#else
|
||||||
plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]}, monthly"
|
plan_price = "$#{Site::PLAN_FEATURES[plan_type.to_sym][:price]}, monthly"
|
||||||
#end
|
#end
|
||||||
%{<a data-plan_name="#{Site::PLAN_FEATURES[plan_type.to_sym][:name]}" data-plan_type="#{plan_type}" data-plan_price="#{plan_price}" onclick="return false" class="btn-Action planPricingButton">#{parent_site.plan_type == 'free' ? 'Upgrade' : 'Change'}</a>}
|
|
||||||
|
if request.path.match /\/welcome/
|
||||||
|
button_title = 'Get Started'
|
||||||
|
else
|
||||||
|
button_title = parent_site.plan_type == 'free' ? 'Upgrade' : 'Change'
|
||||||
|
end
|
||||||
|
|
||||||
|
%{<a data-plan_name="#{Site::PLAN_FEATURES[plan_type.to_sym][:name]}" data-plan_type="#{plan_type}" data-plan_price="#{plan_price}" onclick="card = new Skeuocard($('#skeuocard')); return false" class="btn-Action planPricingButton">#{button_title}</a>}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<section class="section plans">
|
<section class="section plans">
|
||||||
|
<% if request.path.match /\/welcome/ %>
|
||||||
|
<div class="txt-Center"><img src="/img/heartcat.png"></div>
|
||||||
|
<% end %>
|
||||||
<h2>
|
<h2>
|
||||||
<% if request.path == '/' %>
|
<% if request.path == '/' %>
|
||||||
Need more space? We’ve got you covered.
|
Need more space? We’ve got you covered.
|
||||||
<br>
|
<br>
|
||||||
Upgrading gives you more space, bandwidth, features, <strong>and helps us stay independent and keep the free sites free.</strong>
|
Upgrading gives you more space, bandwidth, features, <strong>and helps us stay independent and keep the free sites free.</strong>
|
||||||
<% elsif request.path.match /\/plan/ %>
|
<% elsif request.path.match /\/welcome/ %>
|
||||||
|
Welcome to Neocities!
|
||||||
|
<% else %>
|
||||||
Support Us
|
Support Us
|
||||||
<% end %>
|
<% end %>
|
||||||
</h2>
|
</h2>
|
||||||
|
@ -36,6 +52,18 @@
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% elsif request.path.match /\/welcome/ %>
|
||||||
|
<div class="row" style="margin-top: 0px">
|
||||||
|
<div class="col-75" style="margin-left: auto; margin-right: auto;">
|
||||||
|
<h3 class="subtitle">
|
||||||
|
Welcome, and thanks for signing up! We can't wait to see your web site!
|
||||||
|
<br>
|
||||||
|
Neocities does not put advertising on your site, <strong>and we never will</strong>.
|
||||||
|
<br>
|
||||||
|
Instead, Neocities is powered by supporters like you. If you'd like to help us out, we'd love your support. Thank you!
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="plan-overview">
|
<div class="plan-overview">
|
||||||
|
@ -65,7 +93,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col col-25 supporter">
|
<div class="col col-25 supporter">
|
||||||
<div class="plan-image" data-original-title="Pick me!"></div>
|
<div class="plan-image" data-original-title="Meow!"></div>
|
||||||
<h3>Supporter</h3>
|
<h3>Supporter</h3>
|
||||||
<% if parent_site && parent_site.legacy_supporter? %>
|
<% if parent_site && parent_site.legacy_supporter? %>
|
||||||
<div class="price">$<%= Site::LEGACY_SUPPORTER_PRICES[parent_site[:plan_type].to_sym] %></div>
|
<div class="price">$<%= Site::LEGACY_SUPPORTER_PRICES[parent_site[:plan_type].to_sym] %></div>
|
||||||
|
@ -374,16 +402,12 @@
|
||||||
<% if current_site %>
|
<% if current_site %>
|
||||||
<link rel="stylesheet" href="/css/skeuocard.reset.css" />
|
<link rel="stylesheet" href="/css/skeuocard.reset.css" />
|
||||||
<link rel="stylesheet" href="/css/skeuocard.css" />
|
<link rel="stylesheet" href="/css/skeuocard.css" />
|
||||||
<script src="/js/skeuocard.min.js"></script>
|
|
||||||
<script src="/js/cssua.min.js"></script>
|
<script src="/js/cssua.min.js"></script>
|
||||||
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
|
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
Stripe.setPublishableKey('<%= $config['stripe_publishable_key'] %>')
|
Stripe.setPublishableKey('<%= $config['stripe_publishable_key'] %>')
|
||||||
|
|
||||||
$(function() {
|
|
||||||
card = new Skeuocard($("#skeuocard"))
|
|
||||||
})
|
|
||||||
|
|
||||||
$('#upgradeForm').submit(function(event) {
|
$('#upgradeForm').submit(function(event) {
|
||||||
if($('#stripe_token').val() != '')
|
if($('#stripe_token').val() != '')
|
||||||
|
@ -427,5 +451,5 @@
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script src="/js/skeuocard.min.js"></script>
|
||||||
<% end %>
|
<% end %>
|
1
views/welcome.erb
Normal file
1
views/welcome.erb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<%== erb :'plan/_pricing' %>
|
Loading…
Add table
Reference in a new issue