| 1 |
{% extends "base.html" %} |
| 2 |
|
| 3 |
{% block title %}Admin: Comp codes - Makenot.work{% endblock %} |
| 4 |
{% block body_attrs %} class="padded-page admin-page"{% endblock %} |
| 5 |
|
| 6 |
{% block head %} |
| 7 |
{% endblock %} |
| 8 |
|
| 9 |
{% block content %} |
| 10 |
{% include "partials/site_header.html" %} |
| 11 |
|
| 12 |
<div class="container"> |
| 13 |
{% include "partials/admin_nav.html" %} |
| 14 |
|
| 15 |
<h1 class="page-title">Comp codes</h1> |
| 16 |
|
| 17 |
<p class="text-sm dimmed"> |
| 18 |
Mint a free-trial code redeemable at creator-tier checkout. No card is collected |
| 19 |
up front; after the trial the subscription rolls to the founder price only if the |
| 20 |
recipient opts in. Two patterns: |
| 21 |
</p> |
| 22 |
<ul class="text-sm dimmed"> |
| 23 |
<li><strong>Unique code per creator</strong> — name it after the recipient (for |
| 24 |
example ALPHA-JAMIE) and set Max uses to 1. The status shows Unused until |
| 25 |
they redeem, then Redeemed.</li> |
| 26 |
<li><strong>Reusable code to share</strong> — leave Max uses blank. Anyone can |
| 27 |
redeem it, but each individual only once; the Uses count is the number of |
| 28 |
distinct people who have redeemed.</li> |
| 29 |
</ul> |
| 30 |
|
| 31 |
<div class="lottery-form"> |
| 32 |
<form hx-post="/api/admin/comp-codes/create" hx-target="#comp-codes-table" hx-swap="innerHTML"> |
| 33 |
<div class="form-group"> |
| 34 |
<label for="cc-code">Code (name after recipient)</label> |
| 35 |
<input type="text" id="cc-code" name="code" placeholder="ALPHA-JAMIE" required> |
| 36 |
</div> |
| 37 |
<div class="form-group"> |
| 38 |
<label for="cc-trial-days">Trial days</label> |
| 39 |
<input type="number" id="cc-trial-days" name="trial_days" min="1" max="3650" value="180"> |
| 40 |
</div> |
| 41 |
<div class="form-group"> |
| 42 |
<label for="cc-max-uses">Max uses (blank for unlimited)</label> |
| 43 |
<input type="number" id="cc-max-uses" name="max_uses" min="1" value="1"> |
| 44 |
</div> |
| 45 |
<div class="form-group"> |
| 46 |
<label for="cc-expires">Expires in days (blank for never)</label> |
| 47 |
<input type="number" id="cc-expires" name="expires_in_days" min="1"> |
| 48 |
</div> |
| 49 |
<button type="submit" class="btn-primary">Mint code</button> |
| 50 |
</form> |
| 51 |
</div> |
| 52 |
|
| 53 |
<div id="comp-codes-table"> |
| 54 |
{% include "partials/admin_comp_codes_entries.html" %} |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
{% endblock %} |
| 58 |
|