Skip to content

Commit 761cc8b

Browse files
Merge pull request #2050 from basecamp/billing
Add billing system (monthly subscriptions)
2 parents 7640076 + ee80b87 commit 761cc8b

18 files changed

Lines changed: 86 additions & 197 deletions

File tree

Gemfile.saas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ eval_gemfile "Gemfile"
33

44
git_source(:bc) { |repo| "https://github.com/basecamp/#{repo}" }
55

6-
# SaaS-only functionality
76
gem "activeresource", require: "active_resource"
7+
gem "stripe", "~> 18.0"
88
gem "queenbee", bc: "queenbee-plugin"
99
gem "fizzy-saas", bc: "fizzy-saas"
1010
gem "console1984", bc: "console1984"

Gemfile.saas.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GIT
2121

2222
GIT
2323
remote: https://github.com/basecamp/fizzy-saas
24-
revision: f0bc5d811ff80b45dc44b88a13a0a17a3e823143
24+
revision: 8eaa692316bb27ed73bd628b4735082585498ca0
2525
specs:
2626
fizzy-saas (0.1.0)
2727
audits1984
@@ -558,6 +558,7 @@ GEM
558558
stimulus-rails (1.3.4)
559559
railties (>= 6.0.0)
560560
stringio (3.1.9)
561+
stripe (18.0.1)
561562
thor (1.4.0)
562563
thruster (0.1.17)
563564
thruster (0.1.17-aarch64-linux)
@@ -684,6 +685,7 @@ DEPENDENCIES
684685
solid_queue (~> 1.2)
685686
sqlite3 (>= 2.0)
686687
stimulus-rails
688+
stripe (~> 18.0)
687689
thruster
688690
trilogy (~> 2.9)
689691
turbo-rails

app/assets/stylesheets/web/animation.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@
7171
33% { background-color: var(--color-border-darker); scale: 1; }
7272
}
7373

74+
@keyframes wiggle {
75+
0% { transform: rotate(0deg); }
76+
20% { transform: rotate(3deg); }
77+
40% { transform: rotate(-3deg); }
78+
60% { transform: rotate(3deg); }
79+
80% { transform: rotate(-3deg); }
80+
100% { transform: rotate(0deg); }
81+
}
82+
7483
@keyframes wobble {
7584
0% { transform: rotate(calc(var(--bubble-rotate) + 30deg)); }
7685
15% { border-radius: 66% 34% 72% 28% / 39% 63% 37% 61%; }

app/assets/stylesheets/web/card-perma.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
border-radius: 99rem;
278278
}
279279

280-
.btn:not(.popup__btn, .btn--plain, .btn--reversed) {
280+
.btn:not(.popup__btn, .btn--plain, .btn--reversed, .settings-subscription__button) {
281281
--btn-background: var(--card-color);
282282
--btn-color: var(--color-ink-inverted);
283283
}

app/assets/stylesheets/web/utilities.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,23 @@
184184
.fill-highlight { background-color: var(--color-highlight); }
185185
.fill-transparent { background-color: transparent; }
186186

187+
.fill-highlighter {
188+
display: inline-block;
189+
position: relative;
190+
z-index: 1;
191+
192+
&::before {
193+
background-color: var(--color-highlight);
194+
border-radius: 0.2em;
195+
content: "";
196+
inset-block: 0;
197+
inset-inline: -0.1em;
198+
position: absolute;
199+
transform: skewX(-10deg) rotate(1deg);
200+
z-index: -1;
201+
}
202+
}
203+
187204
.translucent { opacity: var(--opacity, 0.66); }
188205

189206
/* Borders */

app/controllers/admin/stats_controller.rb

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/models/admin.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Admin
2+
end

app/views/account/settings/show.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@
2020
<%= render "account/settings/export" %>
2121
</div>
2222
</section>
23+
24+
<%= render "account/settings/subscription_panel" if Fizzy.saas? %>

app/views/admin/stats/show.html.erb

Lines changed: 0 additions & 126 deletions
This file was deleted.

app/views/cards/_container.html.erb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<% cache card do %>
2-
<section id="<%= dom_id(card, :card_container) %>" class="card-perma" style="--card-color: <%= card.color %>;">
1+
<section id="<%= dom_id(card, :card_container) %>" class="card-perma" style="--card-color: <%= card.color %>;">
2+
<% cache card do %>
33
<div class="card-perma__actions card-perma__actions--left">
44
<%= render "cards/container/gild", card: card if card.published? && !card.closed? %>
55
<%= render "cards/container/image", card: card %>
@@ -33,11 +33,15 @@
3333
<%= render "cards/display/preview/bubble", card: card %>
3434
<% end %>
3535
</div>
36+
<% end %>
3637

37-
<% if card.published? %>
38-
<%= render "cards/container/footer/published", card: card %>
39-
<% elsif card.drafted? %>
40-
<%= render "cards/container/footer/draft", card: card %>
38+
<% if card.published? %>
39+
<%= render "cards/container/footer/published", card: card %>
40+
<% elsif card.drafted? %>
41+
<% if Fizzy.saas? %>
42+
<%= render "cards/container/footer/saas/create", card: card %>
43+
<% else %>
44+
<%= render "cards/container/footer/create", card: card %>
4145
<% end %>
42-
</section>
43-
<% end %>
46+
<% end %>
47+
</section>

0 commit comments

Comments
 (0)