wbase 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +219 -2
- data/app/assets/javascripts/wbase/auth/bootstrap.min.js +7 -0
- data/app/assets/javascripts/wbase/auth/detect.js +7 -0
- data/app/assets/javascripts/wbase/auth/fastclick.js +841 -0
- data/app/assets/javascripts/wbase/auth/jquery.app.js +318 -0
- data/app/assets/javascripts/wbase/auth/jquery.blockUI.js +620 -0
- data/app/assets/javascripts/wbase/auth/jquery.core.js +323 -0
- data/app/assets/javascripts/wbase/auth/jquery.min.js +5 -0
- data/app/assets/javascripts/wbase/auth/jquery.nicescroll.js +113 -0
- data/app/assets/javascripts/wbase/auth/jquery.scrollTo.min.js +7 -0
- data/app/assets/javascripts/wbase/auth/jquery.slimscroll.js +474 -0
- data/app/assets/javascripts/wbase/auth/modernizr.min.js +1 -0
- data/app/assets/javascripts/wbase/auth/pace.min.js +2 -0
- data/app/assets/javascripts/wbase/auth/waves.js +498 -0
- data/app/assets/javascripts/wbase/auth/wow.min.js +2 -0
- data/app/assets/javascripts/wbase/auth.js +12 -0
- data/app/assets/stylesheets/wbase/auth/components.css +2362 -0
- data/app/assets/stylesheets/wbase/auth/core.css +2190 -0
- data/app/assets/stylesheets/wbase/auth/icons.css +12067 -0
- data/app/assets/stylesheets/wbase/auth/pages.css +2039 -0
- data/app/assets/stylesheets/wbase/auth/responsive.css +162 -0
- data/app/assets/stylesheets/wbase/auth/typicons.css +1370 -0
- data/app/assets/stylesheets/wbase/auth/variables.css +0 -0
- data/app/assets/stylesheets/wbase/auth.scss +9 -0
- data/app/controllers/wbase/application_controller.rb +13 -0
- data/app/controllers/wbase/mail_events_controller.rb +21 -0
- data/app/controllers/wbase/password_resets_controller.rb +43 -0
- data/app/controllers/wbase/sessions_controller.rb +35 -0
- data/app/controllers/wbase/static_pages_controller.rb +4 -0
- data/app/controllers/wbase/stripe_webhooks_controller.rb +54 -0
- data/app/controllers/wbase/subscriptions_controller.rb +50 -0
- data/app/controllers/wbase/users_controller.rb +65 -0
- data/app/helpers/wbase/auth_helper.rb +44 -0
- data/app/jobs/wbase/activate_drip_subscriber_job.rb +15 -0
- data/app/jobs/wbase/create_drip_subscriber_job.rb +13 -0
- data/app/jobs/wbase/dripable.rb +22 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/mailers/wbase/admin_mailer.rb +35 -0
- data/app/mailers/wbase/password_reset_mailer.rb +20 -0
- data/app/models/wbase/mail_event.rb +21 -0
- data/app/models/wbase/plan.rb +26 -0
- data/app/models/wbase/ssl_verification.rb +21 -0
- data/app/models/wbase/stripe_webhook.rb +22 -0
- data/app/models/wbase/subscription.rb +47 -0
- data/app/models/wbase/userable.rb +85 -0
- data/app/services/wbase/mail_event_batch.rb +22 -0
- data/app/services/wbase/start_subscription.rb +81 -0
- data/app/views/layouts/mailer.html.erb +53 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/layouts/wbase/_common_head.html.erb +46 -0
- data/app/views/layouts/wbase/auth.html.erb +23 -0
- data/app/views/layouts/wbase/landing.html.erb +9 -56
- data/app/views/shared/_errors.html.erb +10 -0
- data/app/views/wbase/admin_mailer/new_subscription.html.erb +33 -0
- data/app/views/wbase/admin_mailer/new_user.html.erb +7 -0
- data/app/views/wbase/password_reset_mailer/reset.html.erb +10 -0
- data/app/views/wbase/password_reset_mailer/reset.text.erb +5 -0
- data/app/views/wbase/password_resets/edit.html.erb +22 -0
- data/app/views/wbase/password_resets/new.html.erb +41 -0
- data/app/views/wbase/sessions/new.html.erb +58 -0
- data/app/views/wbase/static_pages/landing/_pricing.html.erb +6 -2
- data/app/views/wbase/static_pages/start.html.erb +1 -1
- data/app/views/wbase/static_pages/welcome.html.erb +1 -1
- data/app/views/wbase/subscriptions/edit.html.erb +2 -0
- data/app/views/wbase/subscriptions/new.html.erb +91 -0
- data/app/views/wbase/subscriptions/show.html.erb +2 -0
- data/app/views/wbase/users/_affiliate.html.erb +66 -0
- data/app/views/wbase/users/_plan.html.erb +11 -0
- data/app/views/wbase/users/_plans.html.erb +11 -0
- data/app/views/wbase/users/edit.html.erb +2 -0
- data/app/views/wbase/users/new.html.erb +38 -0
- data/app/views/wbase/users/show.html.erb +37 -0
- data/config/initializers/assets.rb +1 -3
- data/config/routes.rb +9 -0
- data/db/migrate/20161127212521_create_wbase_subscriptions.rb +17 -0
- data/db/migrate/20161127212831_create_wbase_plans.rb +15 -0
- data/db/migrate/20161127224117_create_wbase_ssl_verifications.rb +10 -0
- data/db/migrate/20161128022640_create_wbase_mail_events.rb +16 -0
- data/db/migrate/20161128031211_create_wbase_stripe_webhooks.rb +17 -0
- data/lib/wbase/engine.rb +37 -28
- data/lib/wbase/version.rb +1 -1
- data/test/controllers/wbase/mail_events_controller_test.rb +13 -0
- data/test/controllers/wbase/password_resets_controller_test.rb +13 -0
- data/test/controllers/wbase/sessions_controller_test.rb +13 -0
- data/test/controllers/wbase/stripe_webhooks_controller_test.rb +13 -0
- data/test/controllers/wbase/subscriptions_controller_test.rb +13 -0
- data/test/controllers/wbase/users_controller_test.rb +13 -0
- data/test/dummy/config/database.yml +4 -7
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +85 -0
- data/test/dummy/log/development.log +225 -0
- data/test/fixtures/wbase/mail_events.yml +38 -0
- data/test/fixtures/wbase/plans.yml +40 -0
- data/test/fixtures/wbase/stripe_webhooks.yml +41 -0
- data/test/fixtures/wbase/subscriptions.yml +46 -0
- data/test/jobs/wbase/activate_drip_subscriber_job_test.rb +9 -0
- data/test/jobs/wbase/create_drip_subscriber_job_job_test.rb +9 -0
- data/test/mailers/previews/wbase/admin_mailer_preview.rb +11 -0
- data/test/mailers/previews/wbase/password_reset_mailer_preview.rb +11 -0
- data/test/mailers/wbase/admin_mailer_test.rb +14 -0
- data/test/mailers/wbase/password_reset_mailer_test.rb +14 -0
- data/test/models/wbase/mail_event_test.rb +26 -0
- data/test/models/wbase/plan_test.rb +30 -0
- data/test/models/wbase/ssl_verification_test.rb +20 -0
- data/test/models/wbase/stripe_webhook_test.rb +27 -0
- data/test/models/wbase/subscription_test.rb +32 -0
- metadata +121 -12
- data/app/helpers/wbase/application_helper.rb +0 -4
- data/app/helpers/wbase/static_pages_helper.rb +0 -4
- data/app/views/wbase/static_pages/_map.html.erb +0 -17
- data/app/views/wbase/static_pages/_order_stats.html.erb +0 -28
- data/app/views/wbase/static_pages/_pricing.html.erb +0 -89
- data/app/views/wbase/static_pages/_stats.html.erb +0 -28
- data/app/views/wbase/static_pages/_testimonial.html.erb +0 -16
- data/app/views/wbase/static_pages/affiliate.html.erb +0 -54
- data/app/views/wbase/static_pages/faq.html.erb +0 -63
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<div class="panel-heading">
|
|
2
|
+
<h3 class="text-center">
|
|
3
|
+
<%= current_user.get_selected_plan.name %>
|
|
4
|
+
</h3>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<p class="text-center">
|
|
8
|
+
<%= number_to_currency(current_user.get_selected_plan.price) %> / <small>month</small>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p class="text-center">
|
|
12
|
+
<%= link_to "See other plans", "/welcome#pricing-section" %>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
|
|
16
|
+
<script type="text/javascript">
|
|
17
|
+
Stripe.setPublishableKey('<%= ENV["STRIPE_PUBLISHABLE_KEY"] %>');
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<form action="/subscription" method="POST" id="payment-form">
|
|
21
|
+
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
|
|
22
|
+
<input type="hidden" name="subscription[plan_id]" value="<%= current_user.get_selected_plan.id %>">
|
|
23
|
+
<span class="payment-errors"></span>
|
|
24
|
+
|
|
25
|
+
<div class="form-group">
|
|
26
|
+
<label for="card-number" class="control-label">Card Number</label>
|
|
27
|
+
<input id="card-number" type="text" size="20" data-stripe="number" class="form-control boxed" autofocus>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="row form-group">
|
|
31
|
+
<div class="col-xs-6">
|
|
32
|
+
<label for="exp_month">Exp (MM / YY)</label>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="col-xs-4 col-xs-offset-2">
|
|
35
|
+
<label for="cvc">CVC</label>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col-xs-3">
|
|
38
|
+
<input id="exp_month" type="text" size="2" data-stripe="exp_month" class="form-control boxed" placeholder="MM">
|
|
39
|
+
</div>
|
|
40
|
+
<div class="col-xs-3">
|
|
41
|
+
<input type="text" size="2" data-stripe="exp_year" class="form-control boxed" placeholder="YY">
|
|
42
|
+
</div>
|
|
43
|
+
<div class="col-xs-4 col-xs-offset-2">
|
|
44
|
+
<input id="cvc" type="text" size="4" data-stripe="cvc" class="form-control boxed" placeholder="CVC">
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<input type="submit" class="submit btn btn-block btn-primary" value="Get Started!">
|
|
49
|
+
<hr>
|
|
50
|
+
|
|
51
|
+
<div class="form-group">
|
|
52
|
+
<p class="text-muted text-center"><a href="/logout">Nevermind...</a></p>
|
|
53
|
+
</div>
|
|
54
|
+
</form>
|
|
55
|
+
|
|
56
|
+
<% content_for :javascripts do %>
|
|
57
|
+
<script type="text/javascript">
|
|
58
|
+
function stripeResponseHandler(status, response) {
|
|
59
|
+
// Grab the form:
|
|
60
|
+
var $form = $('#payment-form');
|
|
61
|
+
|
|
62
|
+
if (response.error) { // Problem!
|
|
63
|
+
// Show the errors on the form:
|
|
64
|
+
$form.find('.payment-errors').text(response.error.message);
|
|
65
|
+
$form.find('.submit').prop('disabled', false); // Re-enable submission
|
|
66
|
+
} else { // Token was created!
|
|
67
|
+
// Get the token ID:
|
|
68
|
+
var token = response.id,
|
|
69
|
+
lastFour = response.card.last4,
|
|
70
|
+
cardType = response.card.brand;
|
|
71
|
+
// Insert the token ID into the form so it gets submitted to the server:
|
|
72
|
+
$form.append($('<input type="hidden" name="subscription[credit_card_token]">').val(token));
|
|
73
|
+
$form.append($('<input type="hidden" name="subscription[last_four]">').val(lastFour));
|
|
74
|
+
$form.append($('<input type="hidden" name="subscription[card_type]">').val(cardType));
|
|
75
|
+
// Submit the form:
|
|
76
|
+
$form.get(0).submit();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
$(function() {
|
|
80
|
+
var $form = $('#payment-form');
|
|
81
|
+
$form.submit(function(event) {
|
|
82
|
+
// Disable the submit button to prevent repeated clicks:
|
|
83
|
+
$form.find('.submit').prop('disabled', true);
|
|
84
|
+
// Request a token from Stripe:
|
|
85
|
+
Stripe.card.createToken($form, stripeResponseHandler);
|
|
86
|
+
// Prevent the form from being submitted:
|
|
87
|
+
return false;
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
</script>
|
|
91
|
+
<% end %>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<div class="card-block">
|
|
2
|
+
<div class="title-block">
|
|
3
|
+
<h4 class="title">
|
|
4
|
+
Account Settings
|
|
5
|
+
</h4>
|
|
6
|
+
<p class="title-description"></p>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="row row-sm">
|
|
9
|
+
<div class="col-xs-12 col-sm-12 stat-col">
|
|
10
|
+
<div class="stat-icon">
|
|
11
|
+
<i class="fa fa-rocket"></i>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="stat">
|
|
14
|
+
<div class="value"> <%= current_user.email %></div>
|
|
15
|
+
<div class="name"> Email </div>
|
|
16
|
+
</div>
|
|
17
|
+
<progress class="progress stat-progress" value="100" max="100">
|
|
18
|
+
<div class="progress">
|
|
19
|
+
<span class="progress-bar" style="width: 100%;"></span>
|
|
20
|
+
</div>
|
|
21
|
+
</progress>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="col-xs-12 col-sm-12 stat-col">
|
|
24
|
+
<div class="stat-icon">
|
|
25
|
+
<i class="fa fa-pencil-square-o"></i>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="stat">
|
|
28
|
+
<div class="value"> 1 </div>
|
|
29
|
+
<div class="name"> Active Forms </div>
|
|
30
|
+
</div>
|
|
31
|
+
<progress class="progress stat-progress" value="100" max="100">
|
|
32
|
+
<div class="progress">
|
|
33
|
+
<span class="progress-bar" style="width: 100%;"></span>
|
|
34
|
+
</div>
|
|
35
|
+
</progress>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="col-xs-12 col-sm-12 stat-col">
|
|
38
|
+
<div class="stat-icon">
|
|
39
|
+
<i class="fa fa-link"></i>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="stat">
|
|
42
|
+
<div class="value"> <%= new_user_url(af: current_user.affiliate_key) %> </div>
|
|
43
|
+
<div class="name"> Invite Link </div>
|
|
44
|
+
</div>
|
|
45
|
+
<progress class="progress stat-progress" value="100" max="100">
|
|
46
|
+
<div class="progress">
|
|
47
|
+
<span class="progress-bar" style="width: 100%;"></span>
|
|
48
|
+
</div>
|
|
49
|
+
</progress>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="col-xs-12 col-sm-12 stat-col">
|
|
52
|
+
<div class="stat-icon">
|
|
53
|
+
<i class="fa fa-key"></i>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="stat">
|
|
56
|
+
<div class="value"> <%= current_user.api_key %> </div>
|
|
57
|
+
<div class="name"> API Key (Use with Zapier) </div>
|
|
58
|
+
</div>
|
|
59
|
+
<progress class="progress stat-progress" value="100" max="100">
|
|
60
|
+
<div class="progress">
|
|
61
|
+
<span class="progress-bar" style="width: 100%;"></span>
|
|
62
|
+
</div>
|
|
63
|
+
</progress>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<div class="panel-heading">
|
|
2
|
+
<h3 class="text-center">
|
|
3
|
+
Sign Up for
|
|
4
|
+
<strong class="text-custom"><%= Wbase.site_name %></strong>
|
|
5
|
+
</h3>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div class="panel-body">
|
|
9
|
+
<form class="form-horizontal m-t-20" action="/user" method="POST">
|
|
10
|
+
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
|
|
11
|
+
|
|
12
|
+
<div class="form-group ">
|
|
13
|
+
<div class="col-xs-12">
|
|
14
|
+
<label for="email">Email</label>
|
|
15
|
+
<input class="form-control" id="email" type="email" name="user[email]" required="" placeholder="first.last@gmail.com">
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="form-group">
|
|
20
|
+
<div class="col-xs-12">
|
|
21
|
+
<label for="password">Password</label>
|
|
22
|
+
<input class="form-control" id="password" type="password" name="user[password]" required="" placeholder="Password">
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="form-group text-center m-t-40">
|
|
27
|
+
<div class="col-xs-12">
|
|
28
|
+
<button class="btn btn-pink btn-block text-uppercase waves-effect waves-light" type="submit">Sign Up</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</form>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="row">
|
|
35
|
+
<div class="col-sm-12 text-center">
|
|
36
|
+
<p>Already have an account? <a href="/session/new" class="m-l-5"><b>Log In</b></a></p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<article class="content dashboard-page">
|
|
2
|
+
<div class="title-block">
|
|
3
|
+
<h3 class="title">
|
|
4
|
+
<%= current_user.email %>
|
|
5
|
+
<p class="title-description">
|
|
6
|
+
Settings
|
|
7
|
+
</p>
|
|
8
|
+
<span class="sparkline bar" data-type="bar"></span>
|
|
9
|
+
</h3>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<section class="section">
|
|
13
|
+
<div class="row sameheight-container">
|
|
14
|
+
<% if flash[:errors] %>
|
|
15
|
+
<div class="alert alert-danger">
|
|
16
|
+
<% flash[:errors].each do |error| %>
|
|
17
|
+
<%= error %>
|
|
18
|
+
<% end %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
<div class="col-md-6">
|
|
22
|
+
<div class="card card-block">
|
|
23
|
+
<h3>Account</h3>
|
|
24
|
+
<form action="/user" method="post">
|
|
25
|
+
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
|
|
26
|
+
<input type="hidden" name="_method" value="PUT" />
|
|
27
|
+
<div class="form-group">
|
|
28
|
+
<label for="email">Email</label>
|
|
29
|
+
<input type="email" id="email" name="user[email]" class="form-control" value="<%= current_user.email %>">
|
|
30
|
+
</div>
|
|
31
|
+
<button class="btn btn-success-outline">Update</button>
|
|
32
|
+
</form>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</section>
|
|
37
|
+
</article>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# Rails.application.config.assets.precompile += [/^[-_a-zA-Z0-9]*\..*/]
|
|
2
1
|
Rails.application.config.assets.paths << Rails.root.join('assets', 'wbase', 'fonts')
|
|
3
|
-
Rails.application.config.assets.precompile += %w( wbase/landing.css )
|
|
4
|
-
Rails.application.config.assets.precompile += %w( wbase/landing.js )
|
|
2
|
+
Rails.application.config.assets.precompile += %w( wbase/landing.css wbase/landing.js wbase/auth.css wbase/auth.js )
|
|
5
3
|
Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
|
data/config/routes.rb
CHANGED
|
@@ -14,4 +14,13 @@ Wbase::Engine.routes.draw do
|
|
|
14
14
|
get "/#{ action }", to: "static_pages##{ action }"
|
|
15
15
|
get "/#{ action.gsub('_', '-') }", to: "static_pages##{ action }"
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
get '/logout', to: 'sessions#destroy'
|
|
19
|
+
resource :user, exclude: [:destroy]
|
|
20
|
+
resource :session, only: [:new, :create, :destroy]
|
|
21
|
+
resource :password_reset, only: [:new, :create, :edit, :update]
|
|
22
|
+
resource :subscription, only: [:new, :create]
|
|
23
|
+
resources :mail_events
|
|
24
|
+
resources :stripe_webhooks
|
|
25
|
+
get '/.well-known/acme-challenge/:id' => 'static_pages#letsencrypt'
|
|
17
26
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class CreateWbaseSubscriptions < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :wbase_subscriptions do |t|
|
|
4
|
+
t.string :stripe_id, null: false
|
|
5
|
+
t.integer :plan_id, null: false, index: true
|
|
6
|
+
t.string :last_four
|
|
7
|
+
t.integer :coupon_id
|
|
8
|
+
t.string :card_type
|
|
9
|
+
t.integer :current_price
|
|
10
|
+
t.integer :user_id, null: false, index: true
|
|
11
|
+
t.datetime :paid_thru
|
|
12
|
+
t.string :credit_card_token
|
|
13
|
+
|
|
14
|
+
t.timestamps null: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class CreateWbasePlans < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :wbase_plans do |t|
|
|
4
|
+
t.string :name, null: false, index: true
|
|
5
|
+
t.string :stripe_id, null: false, index: true
|
|
6
|
+
t.integer :price, null: false
|
|
7
|
+
t.string :interval, default: 'monthly'
|
|
8
|
+
t.text :features
|
|
9
|
+
t.boolean :highlight, default: false
|
|
10
|
+
t.integer :display_order, default: 0
|
|
11
|
+
|
|
12
|
+
t.timestamps null: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class CreateWbaseMailEvents < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :wbase_mail_events do |t|
|
|
4
|
+
t.string :sg_message_id
|
|
5
|
+
t.string :email
|
|
6
|
+
t.string :timestamp
|
|
7
|
+
t.string :smtp_id
|
|
8
|
+
t.string :event
|
|
9
|
+
t.json :data
|
|
10
|
+
t.integer :mail_eventable_id
|
|
11
|
+
t.string :mail_eventable_type
|
|
12
|
+
|
|
13
|
+
t.timestamps null: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class CreateWbaseStripeWebhooks < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
create_table :wbase_stripe_webhooks do |t|
|
|
4
|
+
t.string :external_id
|
|
5
|
+
t.string :object
|
|
6
|
+
t.string :api_version
|
|
7
|
+
t.datetime :created
|
|
8
|
+
t.json :data
|
|
9
|
+
t.boolean :livemode
|
|
10
|
+
t.integer :pending_webhooks
|
|
11
|
+
t.string :external_type
|
|
12
|
+
t.string :external_request
|
|
13
|
+
|
|
14
|
+
t.timestamps null: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/wbase/engine.rb
CHANGED
|
@@ -8,6 +8,8 @@ module Wbase
|
|
|
8
8
|
:image,
|
|
9
9
|
:keywords,
|
|
10
10
|
:site_name,
|
|
11
|
+
:admin_email,
|
|
12
|
+
:firehose_email,
|
|
11
13
|
|
|
12
14
|
# Landing
|
|
13
15
|
:sub_title,
|
|
@@ -29,35 +31,35 @@ module Wbase
|
|
|
29
31
|
:testimonials,
|
|
30
32
|
:socials,
|
|
31
33
|
:plans].each do |setting|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
mattr_accessor setting do
|
|
35
|
+
[]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
landing_sections = [
|
|
40
|
+
:nav_view,
|
|
41
|
+
:header_view,
|
|
42
|
+
:features_view,
|
|
43
|
+
:description_view,
|
|
44
|
+
:video_view,
|
|
45
|
+
:customers_view,
|
|
46
|
+
:pricing_view,
|
|
47
|
+
:trial_view,
|
|
48
|
+
:about_view,
|
|
49
|
+
:newsletter_view,
|
|
50
|
+
:team_view,
|
|
51
|
+
:social_view,
|
|
52
|
+
:contact_view,
|
|
53
|
+
:footer_view,
|
|
54
|
+
]
|
|
55
|
+
landing_sections.each do |setting|
|
|
56
|
+
mattr_accessor setting do
|
|
57
|
+
true
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
mattr_accessor :landing_sections do
|
|
61
|
+
landing_sections
|
|
62
|
+
end
|
|
61
63
|
end
|
|
62
64
|
|
|
63
65
|
def self.setup(&block)
|
|
@@ -66,5 +68,12 @@ module Wbase
|
|
|
66
68
|
|
|
67
69
|
class Engine < ::Rails::Engine
|
|
68
70
|
isolate_namespace Wbase
|
|
71
|
+
config.generators do |g|
|
|
72
|
+
g.orm :active_record
|
|
73
|
+
g.template_engine :erb
|
|
74
|
+
end
|
|
75
|
+
config.to_prepare do
|
|
76
|
+
Wbase::ApplicationController.helper Rails.application.helpers
|
|
77
|
+
end
|
|
69
78
|
end
|
|
70
79
|
end
|
data/lib/wbase/version.rb
CHANGED
|
@@ -5,21 +5,18 @@
|
|
|
5
5
|
# gem 'sqlite3'
|
|
6
6
|
#
|
|
7
7
|
default: &default
|
|
8
|
-
adapter:
|
|
8
|
+
adapter: postgresql
|
|
9
|
+
encoding: unicode
|
|
9
10
|
pool: 5
|
|
10
11
|
timeout: 5000
|
|
11
12
|
|
|
12
13
|
development:
|
|
13
14
|
<<: *default
|
|
14
|
-
database:
|
|
15
|
+
database: wbase_dev
|
|
15
16
|
|
|
16
17
|
# Warning: The database defined as "test" will be erased and
|
|
17
18
|
# re-generated from your development database when you run "rake".
|
|
18
19
|
# Do not set this db to the same as development or production.
|
|
19
20
|
test:
|
|
20
21
|
<<: *default
|
|
21
|
-
database:
|
|
22
|
-
|
|
23
|
-
production:
|
|
24
|
-
<<: *default
|
|
25
|
-
database: db/production.sqlite3
|
|
22
|
+
database: wbase_test
|
|
Binary file
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
|
5
|
+
#
|
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
|
7
|
+
# database schema. If you need to create the application database on another
|
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
11
|
+
#
|
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
|
13
|
+
|
|
14
|
+
ActiveRecord::Schema.define(version: 20161128031211) do
|
|
15
|
+
|
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
|
17
|
+
enable_extension "plpgsql"
|
|
18
|
+
|
|
19
|
+
create_table "wbase_mail_events", force: :cascade do |t|
|
|
20
|
+
t.string "sg_message_id"
|
|
21
|
+
t.string "email"
|
|
22
|
+
t.string "timestamp"
|
|
23
|
+
t.string "smtp_id"
|
|
24
|
+
t.string "event"
|
|
25
|
+
t.json "data"
|
|
26
|
+
t.integer "mail_eventable_id"
|
|
27
|
+
t.string "mail_eventable_type"
|
|
28
|
+
t.datetime "created_at", null: false
|
|
29
|
+
t.datetime "updated_at", null: false
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
create_table "wbase_plans", force: :cascade do |t|
|
|
33
|
+
t.string "name", null: false
|
|
34
|
+
t.string "stripe_id", null: false
|
|
35
|
+
t.integer "price", null: false
|
|
36
|
+
t.string "interval", default: "monthly"
|
|
37
|
+
t.text "features"
|
|
38
|
+
t.boolean "highlight", default: false
|
|
39
|
+
t.integer "display_order", default: 0
|
|
40
|
+
t.datetime "created_at", null: false
|
|
41
|
+
t.datetime "updated_at", null: false
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
add_index "wbase_plans", ["name"], name: "index_wbase_plans_on_name", using: :btree
|
|
45
|
+
add_index "wbase_plans", ["stripe_id"], name: "index_wbase_plans_on_stripe_id", using: :btree
|
|
46
|
+
|
|
47
|
+
create_table "wbase_ssl_verifications", force: :cascade do |t|
|
|
48
|
+
t.string "key", null: false
|
|
49
|
+
t.string "value", null: false
|
|
50
|
+
t.datetime "created_at", null: false
|
|
51
|
+
t.datetime "updated_at", null: false
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
create_table "wbase_stripe_webhooks", force: :cascade do |t|
|
|
55
|
+
t.string "external_id"
|
|
56
|
+
t.string "object"
|
|
57
|
+
t.string "api_version"
|
|
58
|
+
t.datetime "created"
|
|
59
|
+
t.json "data"
|
|
60
|
+
t.boolean "livemode"
|
|
61
|
+
t.integer "pending_webhooks"
|
|
62
|
+
t.string "external_type"
|
|
63
|
+
t.string "external_request"
|
|
64
|
+
t.datetime "created_at", null: false
|
|
65
|
+
t.datetime "updated_at", null: false
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
create_table "wbase_subscriptions", force: :cascade do |t|
|
|
69
|
+
t.string "stripe_id", null: false
|
|
70
|
+
t.integer "plan_id", null: false
|
|
71
|
+
t.string "last_four"
|
|
72
|
+
t.integer "coupon_id"
|
|
73
|
+
t.string "card_type"
|
|
74
|
+
t.integer "current_price"
|
|
75
|
+
t.integer "user_id", null: false
|
|
76
|
+
t.datetime "paid_thru"
|
|
77
|
+
t.string "credit_card_token"
|
|
78
|
+
t.datetime "created_at", null: false
|
|
79
|
+
t.datetime "updated_at", null: false
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
add_index "wbase_subscriptions", ["plan_id"], name: "index_wbase_subscriptions_on_plan_id", using: :btree
|
|
83
|
+
add_index "wbase_subscriptions", ["user_id"], name: "index_wbase_subscriptions_on_user_id", using: :btree
|
|
84
|
+
|
|
85
|
+
end
|