~evanj/cms

ref: 76738226cae5c57a518db8a20b0525d32223f741 cms/internal/v/html/billing.html -rw-r--r-- 2.9 KiB
76738226Evan M Jones Feat(email+upgrade): MVP support for user emails (after signup) and 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang=en>
<head>
  {{ template "html/_head.html" }}
  <title>CMS | Billing</title>
</head>
<body class='page bg-light'>
  <style>{{ template "css/main.css" }}</style>
  <main>
    {{ template "html/_header.html" $ }}
    <div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
      <h1 class="display-4">Billing</h1>
    </div>
    {{if .User}}
      <div class='container'>
        <div class='row'>
          <div class="col-12 col-md-6">
            <div class='text-center'>
              {{if .User.HasEmail}}
              <p>Update your email.</p>
              {{else}}
              <p>Set your email in case you get locked out of your account.</p>
              {{end}}
            </div>
            <form action='/user/update/email' method=POST>
              <label for=email>Email</label>
              <input id=email name=email type=email class="mb-3 form-control" placeholder="email" required {{if .User.HasEmail}}value="{{.User.Email}}"{{end}}>
              <button type="submit" class="btn btn-primary">Go</button>
            </form>
          </div>
          <div class="col-12 col-md-6">
            {{if .User | paid}}
              <p class='text-center mb-5'>Cancel your subscription, {{.User.Org.Tier.Name}} tier.</p>
            {{else}}
              <p class='text-center mb-5'>Upgrade to a paid tier.<br>Get more access.</p>
              <div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 mb-5 text-center">
                {{range .Tiers}}
                  {{if not (.|isFree)}}
                    <form action='/user/update/billing' method=POST class="col">
                      <input type=hidden name=tier value="{{.Name}}" />
                      <div class="card mb-4 shadow-sm">
                      <div class="card-header">
                        <h4 class="my-0 font-weight-normal">{{.Name}}</h4>
                      </div>
                      <div class="card-body">
                        <h1 class="card-title pricing-card-title">{{.Price}} <small class="text-muted">/ {{.TimeUnit}}</small></h1>
                        <ul class="list-unstyled mt-3 mb-4">
                          {{range .Opts}}
                            <li>{{.Text}}</li>
                          {{end}}
                        </ul>
                        <button type="submit" class="btn btn-primary w-100">Go</button>
                      </div>
                    </form>
                    </div>
                  {{end}}
                {{end}}
              </div>
            {{end}}
          </div>
        </div>
      </div>
    {{else}}
      <div class='container'>
        <div class='row'>
          <div class="col-12">
            <h1>Oops</h1>
            <p>Sorry, our developers are lazy. This should really redirect you.</p>
          </div>
        </div>
      </div>
    {{end}}
    {{ template "html/_footer.html" $ }}
  </main>
  {{ template "html/_scripts.html" }}
</body>
</html>