feat: add plan stacking

This commit is contained in:
2026-03-24 21:47:25 +04:00
parent 7b8f693710
commit b987024f9d
9 changed files with 381 additions and 19 deletions
+11 -1
View File
@@ -51,8 +51,18 @@
</div>
<% } else if ((plan === 'pro' || plan === 'pro2x' || plan === 'pro4x') && it.account.plan_expires_at) { %>
<div class="mt-4 pt-4 border-t divider text-xs text-gray-500">
Pro plan expires <%= new Date(it.account.plan_expires_at).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) %>.
<%= planLabel %> expires <%= new Date(it.account.plan_expires_at).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) %>.
<a href="/dashboard/checkout" class="text-blue-400 hover:text-blue-300 ml-1">Extend or upgrade to Lifetime</a>
<% const stack = it.account.plan_stack || [];
if (stack.length > 0) {
const planNames = { free: 'Free', pro: 'Pro', pro2x: 'Pro 2x', pro4x: 'Pro 4x', lifetime: 'Lifetime' };
const parts = stack.map(function(s) {
const name = planNames[s.plan] || s.plan;
return s.remaining_days == null ? name : name + ' (' + s.remaining_days + 'd)';
});
%>
<div class="mt-1 text-gray-600">Then: <%= parts.join(' → ') %></div>
<% } %>
</div>
<% } %>
</section>