mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
merge conflict fix
This commit is contained in:
commit
071300df2f
18 changed files with 300 additions and 51 deletions
1
Gemfile
1
Gemfile
|
@ -18,6 +18,7 @@ gem 'mail'
|
|||
gem 'google-api-client', require: 'google/api_client'
|
||||
gem 'tilt'
|
||||
gem 'erubis'
|
||||
gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby'
|
||||
|
||||
platform :mri do
|
||||
gem 'magic' # sudo apt-get install file, For OSX: brew install libmagic
|
||||
|
|
13
Gemfile.lock
13
Gemfile.lock
|
@ -1,3 +1,12 @@
|
|||
GIT
|
||||
remote: https://github.com/stripe/stripe-ruby
|
||||
revision: 48f76057f425ab5c3bb147f3d71c3d36d951159f
|
||||
specs:
|
||||
stripe (1.11.0)
|
||||
json (~> 1.8.1)
|
||||
mime-types (~> 1.25)
|
||||
rest-client (~> 1.4)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
|
@ -121,11 +130,12 @@ GEM
|
|||
redis (3.0.7)
|
||||
redis-namespace (1.4.1)
|
||||
redis (~> 3.0.4)
|
||||
rest-client (1.6.7)
|
||||
mime-types (>= 1.16)
|
||||
retriable (1.4.1)
|
||||
rmagick (2.13.2)
|
||||
rubyzip (1.1.2)
|
||||
safe_yaml (1.0.1)
|
||||
sass (3.3.5)
|
||||
selenium-webdriver (2.40.0)
|
||||
childprocess (>= 0.5.0)
|
||||
multi_json (~> 1.0)
|
||||
|
@ -230,5 +240,6 @@ DEPENDENCIES
|
|||
sinatra-flash
|
||||
sinatra-xsendfile
|
||||
slim
|
||||
stripe!
|
||||
tilt
|
||||
webmock
|
||||
|
|
54
app.rb
54
app.rb
|
@ -74,6 +74,12 @@ get '/?' do
|
|||
erb :index, layout: false
|
||||
end
|
||||
|
||||
get '/site/:username/tip' do |username|
|
||||
@site = Site[username: username]
|
||||
@title = "Tip #{@site.title}"
|
||||
erb :'tip'
|
||||
end
|
||||
|
||||
get '/browse' do
|
||||
@current_page = params[:current_page]
|
||||
@current_page = @current_page.to_i
|
||||
|
@ -128,22 +134,7 @@ get '/new' do
|
|||
dashboard_if_signed_in
|
||||
@site = Site.new
|
||||
@site.username = params[:username] unless params[:username].nil?
|
||||
slim :'new'
|
||||
end
|
||||
|
||||
get '/dashboard' do
|
||||
require_login
|
||||
erb :'dashboard'
|
||||
end
|
||||
|
||||
get '/signin' do
|
||||
dashboard_if_signed_in
|
||||
slim :'signin'
|
||||
end
|
||||
|
||||
get '/settings' do
|
||||
require_login
|
||||
slim :'settings'
|
||||
erb :'new'
|
||||
end
|
||||
|
||||
post '/create' do
|
||||
|
@ -160,17 +151,44 @@ post '/create' do
|
|||
recaptcha_is_valid = ENV['RACK_ENV'] == 'test' || recaptcha_valid?
|
||||
|
||||
if @site.valid? && recaptcha_is_valid
|
||||
@site.save
|
||||
DB.transaction do
|
||||
if !params[:stripe_token].nil? && params[:stripe_token] != ''
|
||||
customer = Stripe::Customer.create(
|
||||
card: params[:stripe_token],
|
||||
description: @site.username,
|
||||
email: @site.email,
|
||||
plan: params[:selected_plan]
|
||||
)
|
||||
@site.stripe_customer_id = customer.id
|
||||
end
|
||||
|
||||
@site.save
|
||||
end
|
||||
|
||||
session[:id] = @site.id
|
||||
redirect '/dashboard'
|
||||
else
|
||||
@site.errors.add :captcha, 'You must type in the two words correctly! Try again.' if !recaptcha_is_valid
|
||||
|
||||
slim :'/new'
|
||||
erb :'/new'
|
||||
end
|
||||
end
|
||||
|
||||
get '/dashboard' do
|
||||
require_login
|
||||
erb :'dashboard'
|
||||
end
|
||||
|
||||
get '/signin' do
|
||||
dashboard_if_signed_in
|
||||
slim :'signin'
|
||||
end
|
||||
|
||||
get '/settings' do
|
||||
require_login
|
||||
slim :'settings'
|
||||
end
|
||||
|
||||
post '/signin' do
|
||||
dashboard_if_signed_in
|
||||
|
||||
|
|
|
@ -7,4 +7,18 @@ development:
|
|||
sidekiq_user: ENTER USER HERE
|
||||
sidekiq_pass: ENTER PASS HERE
|
||||
phantomjs_url:
|
||||
- http://localhost:8910
|
||||
- http://localhost:8910
|
||||
stripe_publishable_key: fillout
|
||||
stripe_api_key: fillout
|
||||
test:
|
||||
database: 'postgres://neocities@127.0.0.1/neocities_test'
|
||||
database_pool: 1
|
||||
session_secret: SECRET GOES HERE
|
||||
recaptcha_public_key: ENTER PUBLIC KEY HERE
|
||||
recaptcha_private_key: ENTER PRIVATE KEY HERE
|
||||
sidekiq_user: ENTER USER HERE
|
||||
sidekiq_pass: ENTER PASS HERE
|
||||
phantomjs_url:
|
||||
- http://localhost:8910
|
||||
stripe_publishable_key: fillout
|
||||
stripe_api_key: fillout
|
|
@ -58,6 +58,8 @@ Sequel::Model.plugin :defaults_setter
|
|||
Sequel.default_timezone = 'UTC'
|
||||
Sequel::Migrator.apply DB, './migrations'
|
||||
|
||||
Stripe.api_key = $config['stripe_api_key']
|
||||
|
||||
Dir.glob('models/*.rb').each {|m| require File.join(DIR_ROOT, "#{m}") }
|
||||
DB.loggers << Logger.new(STDOUT) if ENV['RACK_ENV'] == 'development'
|
||||
|
||||
|
|
11
migrations/019_add_stripe_customer_id.rb
Normal file
11
migrations/019_add_stripe_customer_id.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
Sequel.migration do
|
||||
up {
|
||||
DB.drop_column :sites, :stripe_token
|
||||
DB.add_column :sites, :stripe_customer_id, :text, default: nil
|
||||
}
|
||||
|
||||
down {
|
||||
DB.drop_column :sites, :stripe_customer_id
|
||||
DB.add_column :sites, :stripe_token, :text, default: nil
|
||||
}
|
||||
end
|
|
@ -311,4 +311,8 @@ class Site < Sequel::Model
|
|||
def available_space_in_megabytes
|
||||
(available_space.to_f / 2**20).round(2)
|
||||
end
|
||||
|
||||
def title
|
||||
values[:title] || values[:username]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
}
|
||||
}
|
||||
.content, .footer-Content {
|
||||
padding: 20px 6%;
|
||||
padding: 20px 3%;
|
||||
}
|
||||
.single-Col{
|
||||
max-width:800px;
|
||||
|
@ -23,6 +23,31 @@
|
|||
// About page
|
||||
.twitter-tweet.twitter-tweet-rendered{margin:0 auto 30px!important}
|
||||
|
||||
// Interior pages
|
||||
|
||||
.interior .header-Outro {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.interior .header-Outro .row.content {
|
||||
|
||||
}
|
||||
.interior .header-Outro .subtitle {
|
||||
font-size: 1em;
|
||||
margin-top: -15px;
|
||||
}
|
||||
.content.misc-page {
|
||||
background: #FAF6F1;
|
||||
-moz-box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.10);
|
||||
-webkit-box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.10);
|
||||
box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.10);
|
||||
padding: 25px 3% 40px 3%;
|
||||
}
|
||||
.content.misc-page h3 {
|
||||
font-size: 1.6px;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
// Dashboard
|
||||
.interior .header-Outro .col.col-50.signup-Area {padding-left: 0;}
|
||||
.interior .header-Outro a {color:#E93250}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
.constant-Nav{margin-left:-88px;-moz-transition:all 0.35s;-ms-transition:all 0.35s;-o-transition:all 0.35s;-webkit-transition:all 0.35s;transition:all 0.35s}@media (max-device-width: 480px), screen and (max-width: 800px){.constant-Nav{margin-left:0}}.constant-Nav.in-View{margin-left:0;padding-left:70px}@media (max-device-width: 480px), screen and (max-width: 800px){.constant-Nav.in-View{padding-left:0}}
|
||||
.add-Stripe{border-bottom:6px solid #E93250}@media (max-device-width: 480px), screen and (max-width: 800px){.add-Stripe{border:0}}
|
||||
.interior .page{padding-top:22px}.interior .signup-Form{top:0}.interior .header-Base{left:0;overflow:visible;position:fixed;top:0;width:100%;z-index:9}.int-Logo{left:0;position:absolute;top:0;width:70px;z-index:9}.interior .header-Nav{padding-left:70px}@media (max-device-width: 480px), screen and (max-width: 800px){.interior .header-Nav{width:100%}}
|
||||
.interior .constant-Nav{margin:0}.content-Base{background:#f6f0e6;min-height:500px;padding-bottom:50px;padding-top:10px}.content-Base h1,.content-Base h2,.content-Base h3,.content-Base h4,.content-Base h5,.content-Base h6{color:#e93250}.content,.footer-Content,.footer-Content{padding:20px 6%}.single-Col{max-width:800px}.twitter-tweet.twitter-tweet-rendered{margin:0 auto 30px !important}.interior .header-Outro .col.col-50.signup-Area{padding-left:0}.interior .header-Outro a{color:#E93250}.interior .signup-Area{min-height:164px}.interior .signup-Area img{-moz-box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1);-webkit-box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1);box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1)}.interior .header-Outro .screenshot{width:235px;height:141px}.interior .header-Outro ul{margin:0;padding:0}.interior .header-Outro ul li{list-style:none;font-size:80%;margin-bottom:2px}.interior .signup-Form fieldset{padding:20px}.interior .header-Outro h2{margin-top:12px}.welcome{background:#daeea5 url(../img/heartcat.png) no-repeat 20px 23px;background-size:77px 81px;padding:20px 20px 20px 108px;margin-bottom:30px}.welcome h4{font-size:1.2em;margin-bottom:4px}.welcome .close-button{float:right;background:url(../img/welcome-close.png) no-repeat;width:19px;height:19px}.files{float:left;background:#E4D8CB;width:100%}.files .header{background:#5E95A1;color:#fff;float:left;width:100%;padding:10px 20px}.files .breadcrumbs{float:left;font-weight:bold;margin-top:4px}.files .actions{float:right}.files .btn-Action{margin-left:8px}.btn-Action span{background-repeat:no-repeat}.btn-Action.new-Page span{background-image:url(../img/new-page.png);background-position-y:1px;padding-left:30px}.btn-Action.new-Folder span{background-image:url(../img/new-folder.png);padding-left:26px}.btn-Action.upload span{background-image:url(../img/upload.png);padding-left:26px}.files .list{padding:20px}.files .list .upload-Boundary{float:left;border:3px dashed #F6F0E6;width:100%;margin:20px 0;padding:20px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;min-height:300px}.files .list .upload-Boundary.with-instruction{background:url(../img/drag-drop.png) no-repeat center center}.file{float:left;padding:5px;margin-right:10px;margin-bottom:10px;width:125px;text-align:center;display:block;position:relative}.file .title{font-weight:bold;font-size:12px;color:#666;text-decoration:none}.html-thumbnail{font-size:11px;margin-top:5px;margin-left:10px;display:block;position:relative;width:105px;height:63px}.html-thumbnail.html img{width:105px;height:63px;-webkit-box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3);-moz-box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3);box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3)}.html-thumbnail.image img{max-width:105px;max-height:63px;width:auto;height:auto}.html-thumbnail.misc{width:63px;height:63px;margin-left:auto;margin-right:auto}.misc-icon{background:url(../img/misc-file.png) no-repeat -1px -1px;width:67px;height:67px;display:block;padding-top:35px;font-size:14px;color:#bbb;font-weight:bold;margin-left:auto;margin-right:auto}.overlay a{color:white;text-decoration:none;font-size:14px;display:block}.overlay i{font-weight:bold}.overlay{position:absolute;top:0;width:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);display:none}.link-overlay{display:block;position:absolute;bottom:0px;left:0px;width:123px;height:30px}.file>.overlay{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;padding-top:15px;background-color:rgba(0,0,0,0.15)}.filehover:hover .overlay,.fileimagehover:hover .overlay{display:block}.site-actions{float:left;margin-top:20px;font-size:90%}.site-actions a{color:#666}.footer-Base{color:#5e5b56}.footer-Base h1,.footer-Base h2,.footer-Base h3,.footer-Base h4{color:#8b9a7a}.footer-Intro{background:#daeea5;border-top:1px solid #cedbab;-moz-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);-webkit-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);position:relative}.footer-Intro .footer-Content{padding-top:40px;padding-bottom:40px}.f-Col{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;min-height:125px;padding-bottom:28px;position:relative}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col{min-height:2px;padding-left:15px !important;padding-right:100px !important}}.f-Col .action-Link{bottom:0;position:absolute;right:12px}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col .action-Link{position:static}}
|
||||
.interior .constant-Nav{margin:0}.content-Base{background:#f6f0e6;min-height:500px;padding-bottom:50px;padding-top:10px}.content-Base h1,.content-Base h2,.content-Base h3,.content-Base h4,.content-Base h5,.content-Base h6{color:#e93250}.content,.footer-Content,.footer-Content{padding:20px 3%}.single-Col{max-width:800px}.twitter-tweet.twitter-tweet-rendered{margin:0 auto 30px !important}.interior .header-Outro{padding-top:30px}.interior .header-Outro .subtitle{font-size:1em;margin-top:-15px}.content.misc-page,.misc-page.footer-Content{background:#FAF6F1;-moz-box-shadow:1px 1px 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:1px 1px 1px 1px rgba(0,0,0,0.1);box-shadow:1px 1px 1px 1px rgba(0,0,0,0.1);padding:25px 3% 40px 3%}.content.misc-page h3,.misc-page.footer-Content h3{font-size:1.6px;margin-top:2em}.interior .header-Outro .col.col-50.signup-Area{padding-left:0}.interior .header-Outro a{color:#E93250}.interior .signup-Area{min-height:164px}.interior .signup-Area img{-moz-box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1);-webkit-box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1);box-shadow:1px 2px 5px 2px rgba(0,0,0,0.1)}.interior .header-Outro .screenshot{width:235px;height:141px}.interior .header-Outro ul{margin:0;padding:0}.interior .header-Outro ul li{list-style:none;font-size:80%;margin-bottom:2px}.interior .signup-Form fieldset{padding:20px}.interior .header-Outro h2{margin-top:12px}.welcome{background:#daeea5 url(../img/heartcat.png) no-repeat 20px 23px;background-size:77px 81px;padding:20px 20px 20px 108px;margin-bottom:30px}.welcome h4{font-size:1.2em;margin-bottom:4px}.welcome .close-button{float:right;background:url(../img/welcome-close.png) no-repeat;width:19px;height:19px}.files{float:left;background:#E4D8CB;width:100%}.files .header{background:#5E95A1;color:#fff;float:left;width:100%;padding:10px 20px}.files .breadcrumbs{float:left;font-weight:bold;margin-top:4px}.files .actions{float:right}.files .btn-Action{margin-left:8px}.btn-Action span{background-repeat:no-repeat}.btn-Action.new-Page span{background-image:url(../img/new-page.png);background-position-y:1px;padding-left:30px}.btn-Action.new-Folder span{background-image:url(../img/new-folder.png);padding-left:26px}.btn-Action.upload span{background-image:url(../img/upload.png);padding-left:26px}.files .list{padding:20px}.files .list .upload-Boundary{float:left;border:3px dashed #F6F0E6;width:100%;margin:20px 0;padding:20px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;min-height:300px}.files .list .upload-Boundary.with-instruction{background:url(../img/drag-drop.png) no-repeat center center}.file{float:left;padding:5px;margin-right:10px;margin-bottom:10px;width:125px;text-align:center;display:block;position:relative}.file .title{font-weight:bold;font-size:12px;color:#666;text-decoration:none}.html-thumbnail{font-size:11px;margin-top:5px;margin-left:10px;display:block;position:relative;width:105px;height:63px}.html-thumbnail.html img{width:105px;height:63px;-webkit-box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3);-moz-box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3);box-shadow:0px 1px 4px 0px rgba(0,0,0,0.3)}.html-thumbnail.image img{max-width:105px;max-height:63px;width:auto;height:auto}.html-thumbnail.misc{width:63px;height:63px;margin-left:auto;margin-right:auto}.misc-icon{background:url(../img/misc-file.png) no-repeat -1px -1px;width:67px;height:67px;display:block;padding-top:35px;font-size:14px;color:#bbb;font-weight:bold;margin-left:auto;margin-right:auto}.overlay a{color:white;text-decoration:none;font-size:14px;display:block}.overlay i{font-weight:bold}.overlay{position:absolute;top:0;width:0;width:100%;height:100%;background-color:rgba(0,0,0,0.5);display:none}.link-overlay{display:block;position:absolute;bottom:0px;left:0px;width:123px;height:30px}.file>.overlay{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;padding-top:15px;background-color:rgba(0,0,0,0.15)}.filehover:hover .overlay,.fileimagehover:hover .overlay{display:block}.site-actions{float:left;margin-top:20px;font-size:90%}.site-actions a{color:#666}.footer-Base{color:#5e5b56}.footer-Base h1,.footer-Base h2,.footer-Base h3,.footer-Base h4{color:#8b9a7a}.footer-Intro{background:#daeea5;border-top:1px solid #cedbab;-moz-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);-webkit-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);position:relative}.footer-Intro .footer-Content{padding-top:40px;padding-bottom:40px}.f-Col{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;min-height:125px;padding-bottom:28px;position:relative}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col{min-height:2px;padding-left:15px !important;padding-right:100px !important}}.f-Col .action-Link{bottom:0;position:absolute;right:12px}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col .action-Link{position:static}}
|
||||
.footer-icon{background-repeat:no-repeat;position:absolute;right:0;top:-70px}@media (max-device-width: 480px), screen and (max-width: 800px){.footer-icon{-moz-background-size:100%;-ms-background-size:100%;-o-background-size:100%;-webkit-background-size:100%;background-size:100%;height:90px !important;top:0;width:77px !important}}
|
||||
.f-Col-1{padding-right:12px}.f-Col-1 .footer-icon{background-image:url(../img/support-us.png);height:104px;right:5px;width:92px}.f-Col-2{padding-left:15px;padding-right:6px;position:relative}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col-2{border-bottom:1px solid rgba(0,0,0,0.1);border-top:1px solid rgba(0,0,0,0.1);margin:20px 0;overflow:hidden;padding:20px 0}.f-Col-2 .footer-icon{top:14px}}.f-Col-2:before,.f-Col-2:after{background:url("../img/border.png") no-repeat 0 -20px;content:"";height:200px;opacity:0.2;position:absolute;top:0;width:1px}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col-2:before,.f-Col-2:after{display:none}}.f-Col-2:before{left:-14px}.f-Col-2:after{right:-14px}.f-Col-2 .footer-icon{background-image:url(../img/about-neocities.png);width:100px;height:106px}.f-Col-3{padding-left:20px}@media (max-device-width: 480px), screen and (max-width: 800px){.f-Col-3{padding-left:0}}.f-Col-3 .footer-icon{background-image:url(../img/latest-news.png);height:103px;width:134px}.footer-Outro{background:#ccdf9b;border-top:1px solid #b3c388;overflow:hidden}.footer-Outro a{color:#5e5b56}.credits{margin-bottom:0}.footer-Nav{text-transform:uppercase}.footer-Nav .h-Nav,.footer-Nav .bread{float:right}@media (max-device-width: 480px), screen and (max-width: 800px){.footer-Nav .h-Nav,.footer-Nav .bread{float:none;margin-top:15px}.footer-Nav .h-Nav li:first-child a,.footer-Nav .bread li:first-child a{padding-left:0}}.footer-Nav .h-Nav a,.footer-Nav .bread a{padding:0 8px}.footer-Nav .h-Nav li:last-child a,.footer-Nav .bread li:last-child a{padding-right:0}.alert{background-color:#F39C12;color:#fff}.website-Gallery{list-style:none;padding:10px 0}.website-Gallery li{float:left;margin-bottom:8px}@media (max-device-width: 480px), screen and (max-width: 800px){.website-Gallery li{width:50%}}.website-Gallery a{padding:0 8px;display:block}.website-Gallery.int-Gall li{border:1px solid #ccc;margin:0 .5% 12px;width:24%}@media (max-device-width: 480px), screen and (max-width: 800px){.website-Gallery.int-Gall li{width:49%}}.website-Gallery.int-Gall li a{padding:8px}.neo-SS,.neo-Screen-Shot{background:#fff;-moz-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);-webkit-box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);box-shadow:0 8px 8px -8px rgba(0,0,0,0.2);display:block;height:auto !important;padding:8px;position:relative;width:100%}.img-Holder{-moz-background-size:cover !important;-webkit-background-size:cover !important;background-size:cover !important;display:block}.hp-Gallery img,.neo-Screen-Shot img{width:100%}
|
||||
|
|
4
public/assets/scripts/jquery-1.11.0.min.js
vendored
Normal file
4
public/assets/scripts/jquery-1.11.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
public/img/yafagrillmenu.jpg
Normal file
BIN
public/img/yafagrillmenu.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 367 KiB |
|
@ -1,12 +1,11 @@
|
|||
<div class="content single-Col">
|
||||
<div class="header-Outro">
|
||||
<div class="row content single-Col">
|
||||
<h2 class="beta">Neocities Developers API</h2>
|
||||
<h3 class="subtitle">Make changes to your site remotely with programming languages!</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="alpha">Neocities Developers API</h2>
|
||||
|
||||
<p><img src="/assets/img/cat-larger.png"></p>
|
||||
|
||||
<p>
|
||||
<strong>Our Developers API allows you to make changes to your site remotely with programming languages!</strong>
|
||||
</p>
|
||||
<div class="content single-Col misc-page">
|
||||
<h3>Ideas</h3>
|
||||
<p>
|
||||
<ul>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<h2>Contact Us</h2>
|
||||
<h6>Please Note Before Contacting:</h6>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</script>
|
||||
|
||||
<div class="header-Outro" style="overflow: hidden;">
|
||||
<div class="row header-Content content" style="padding-top: 40px;">
|
||||
<div class="row content" style="padding-top: 10px">
|
||||
|
||||
<div class="col col-50 signup-Area" style="width: 289px;">
|
||||
<div class="signup-Form" style="top: 0; text-align: center">
|
||||
|
|
|
@ -322,21 +322,8 @@
|
|||
<%== erb :'_footer', layout: false%>
|
||||
</footer>
|
||||
|
||||
</div> <!-- end .page -->
|
||||
|
||||
<!-- scripts -->
|
||||
<script src="assets/scripts/jquery-1.10.1.min.js"></script>
|
||||
|
||||
<script src="assets/scripts/app.min.js"></script> <!-- Script block allowing child pages to inject their own scripts -->
|
||||
|
||||
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID.
|
||||
<script type="text/javascript>
|
||||
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
|
||||
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
g.src='//www.google-analytics.com/ga.js';
|
||||
s.parentNode.insertBefore(g,s)}(document,'script'));
|
||||
</script>
|
||||
-->
|
||||
|
||||
</div>
|
||||
<script src="/assets/scripts/jquery-1.11.0.min.js"></script>
|
||||
<script src="/assets/scripts/app.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<script>
|
||||
var RecaptchaOptions = {theme: 'clean'}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body class="interior">
|
||||
|
@ -46,8 +50,8 @@
|
|||
<%== erb :'_footer', layout: false %>
|
||||
</footer>
|
||||
|
||||
<script src="assets/scripts/jquery-1.10.1.min.js"></script>
|
||||
<script src="assets/scripts/nav.min.js"></script>
|
||||
<script src="/assets/scripts/jquery-1.11.0.min.js"></script>
|
||||
<script src="/assets/scripts/nav.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,7 +12,7 @@ html
|
|||
meta property="og:title" content="NeoCities"
|
||||
meta property="og:description" content="NeoCities is the new Geocities. Create your own free home page, and do whatever you want with it."
|
||||
meta name="csrf-token" content="#{csrf_token}"
|
||||
script src="/js/jquery.min.js"
|
||||
script src="/assets/scripts/jquery-1.11.0.min.js"
|
||||
link href="/assets/css/neo.css" rel="stylesheet" type="text/css" media="all"
|
||||
script src="/assets/scripts/nav.min.js"
|
||||
|
||||
|
|
170
views/new.erb
Normal file
170
views/new.erb
Normal file
|
@ -0,0 +1,170 @@
|
|||
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
|
||||
<script type="text/javascript">
|
||||
Stripe.setPublishableKey('<%= $config['stripe_publishable_key'] %>');
|
||||
</script>
|
||||
|
||||
<main class="content-Base">
|
||||
<div class="row content">
|
||||
<div class="col col-100">
|
||||
<form method="POST" action="/create" id="signupform">
|
||||
<input name="csrf_token" type="hidden" value="<%= csrf_token %>">
|
||||
|
||||
<h2 class="txt-Center">Create a New Home Page</h2>
|
||||
|
||||
<div class="col col-50" style="margin:0 auto; float:none">
|
||||
<% if !@site.errors.empty? %>
|
||||
<div class="row content">
|
||||
<div class="col col-100 txt-Center">
|
||||
<div class="alert alert-block alert-error">
|
||||
<p>There were errors creating your home page:</p>
|
||||
<% @site.errors.each do |error| %>
|
||||
<p class="tiny"><%= error.last.first %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
<p class="tiny">
|
||||
First, enter a username. This will also be used as your site name.<br><b>Do not forget this, it will be used to sign in to and manage your home page.</b> It can only contain letters, numbers, underscores and hyphens, and can only be 32 characters long.
|
||||
</p>
|
||||
<h5>Username</h5>
|
||||
<p class="tiny">
|
||||
<input class="input-Area" name="username" type="text" placeholder="yourusername" value="<%= @site.username %>" autocapitalize="off" autocorrect="off">.neocities.org
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tiny">
|
||||
Next, enter a password. This will be used to allow you to login. Minimum 5 characters. If you don't make it a good password, Dade Murphy from the movie Hackers will come in and steal your "garbage files".
|
||||
</p>
|
||||
<h5>Password</h5>
|
||||
<input class="input-Area" name="password" type="password">
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tiny">
|
||||
Now you can enter an e-mail address. Your e-mail address is private and we will not show it to anyone for any reason. You don't have to provide one, but <b>we will not be able to reset your password without it, so don't lose your username and password if you leave this blank!</b>
|
||||
</p>
|
||||
<h5>Email</h5>
|
||||
<input class="input-Area" name="email" type="email" placeholder="youremail@example.com" value="<%= @site.email %>">
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tiny">You can optionally enter some tags! Tags will allow others to find your site based on your interests, or your site's theme. <b>Separate multiple tags with commas</b>. Don't think too hard about this, you can change them later. You can have a maximum of ten tags, and there is a two word per tag maximum (extra words in a tag will be removed).</p>
|
||||
|
||||
<h5>Tags</h5>
|
||||
<input class="input-Area" name="tags" type="text" style="width: 400px; max-width:100%" placeholder="pokemon, video games, bulbasaur" value="<%= params[:tags] %>" autocapitalize="off" autocorrect="off">
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tiny"><strong>The site you are creating will be free, forever.</strong> We will never charge you for your free web site.</p>
|
||||
<p class="tiny"><a href="/donate" target="_blank">Neocities has to pay the bills though</a>, and we like the idea of being able to work on the site full-time someday. So if you would like to help us reach this goal, we have created the <strong>Supporter Plan</strong>!
|
||||
|
||||
<p class="tiny">Right now, the <strong>Supporter Plan</strong> is the same as the free plan, except that <strong>Supporter Plan members get 200MB</strong> of web space. You will also be listed as a supporter on our contributors page, and on your site profile page.</p>
|
||||
<p class="tiny">The base plan is $12 per year ($1/mo) paid annually, which is the cost of <a href="/img/yafagrillmenu.jpg" target="_blank">a delicious Yafa Combo with a lousy tip</a>. If you ever decide to cancel, you get to keep the extra space.</p>
|
||||
|
||||
<div>
|
||||
<input type="radio" name="plan" value="free" <%= params[:plan].nil? || params[:plan] == 'free' ? 'checked' : '' %>>
|
||||
<span><strong>Free Plan (10MB)</strong></span>
|
||||
</div>
|
||||
<a name="plan_error_link"></a>
|
||||
<div>
|
||||
<input id="supporter" type="radio" name="plan" value="supporter" <%= params[:plan] == 'supporter' ? 'checked' : '' %>>
|
||||
<span><strong>Supporter Plan (200MB)</strong></span>
|
||||
</div>
|
||||
|
||||
<div id="plan_container" style="margin-top:20px; display: none">
|
||||
<input id="stripe_token" name="stripe_token" type="hidden" value="<%= params[:stripe_token] %>">
|
||||
|
||||
<div id="plan_error" class="alert alert-block alert-error" style="display:none"></div>
|
||||
|
||||
<p class="tiny">
|
||||
Plan type:
|
||||
<select name="selected_plan" style="width: 200px">
|
||||
<option value="plan_one">$12/year ($1/month)</option>
|
||||
<option value="plan_two" <%= params[:selected_plan].nil? ? 'selected' : '' %>>$24/year ($2/month)</option>
|
||||
<option value="plan_three">$36/year ($3/month)</option>
|
||||
<option value="plan_four">$48/year ($4/month)</option>
|
||||
<option value="plan_five">$60/year ($5/month)</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<% if params[:stripe_token] %>
|
||||
<p class="tiny">Billing information has been saved, thank you!</p>
|
||||
<% else %>
|
||||
<p class="tiny">
|
||||
Card Number: <input type="text" size="20" data-stripe="number">
|
||||
CVC: <input type="text" size="4" maxlength="4" data-stripe="cvc" style="width: 60px">
|
||||
</p>
|
||||
<p class="tiny">
|
||||
Expiration:
|
||||
<input type="text" size="2" data-stripe="exp-month" placeholder="MM" maxlength="2" style="width: 50px">
|
||||
<input type="text" size="4" data-stripe="exp-year" placeholder="YYYY" maxlength="4" style="width: 60px">
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<p class="tiny"><b>Last thing!</b> Enter these two words correctly (with spaces) so we know you're not a robot (don't worry robots, we still love you).</p>
|
||||
|
||||
<div class="recaptcha">
|
||||
<%== recaptcha_tag :challenge, ssl: true %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3>You're done. Just click the button below!</h3>
|
||||
<input class="btn-Action" type="submit" value="Create Home Page">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
window.onload = function() {
|
||||
$('#signupform').find(':submit').prop('disabled', false)
|
||||
$('#signupform').submit(function(event) {
|
||||
if($('#signupform input:radio[name="plan"]:checked').val() == 'free') {
|
||||
return true
|
||||
}
|
||||
|
||||
if($('#stripe_token').val() != '')
|
||||
return true
|
||||
|
||||
var planError = $('#plan_error')
|
||||
planError.css('display', 'none')
|
||||
var signupform = $(this)
|
||||
signupform.find(':submit').prop('disabled', true)
|
||||
|
||||
Stripe.card.createToken(signupform, function(status, response) {
|
||||
console.log(response)
|
||||
if(response.error) {
|
||||
planError.text(response.error.message)
|
||||
planError.css('display', 'block')
|
||||
window.location = '#plan_error_link'
|
||||
signupform.find(':submit').prop('disabled', false)
|
||||
return false
|
||||
} else {
|
||||
$('#stripe_token').val(response.id)
|
||||
signupform.submit()
|
||||
}
|
||||
})
|
||||
return false
|
||||
})
|
||||
|
||||
$('#signupform input:radio[name="plan"]').change(function(){
|
||||
showPlanIfSelected()
|
||||
})
|
||||
|
||||
function showPlanIfSelected() {
|
||||
var planContainer = $('#plan_container')
|
||||
if($('#signupform input:radio[name="plan"]:checked').val() == 'supporter')
|
||||
return planContainer.css('display', 'block')
|
||||
planContainer.css('display', 'none')
|
||||
}
|
||||
showPlanIfSelected()
|
||||
}
|
||||
</script>
|
Loading…
Add table
Reference in a new issue