| 1 |
{% extends "base.html" %} |
| 2 |
|
| 3 |
{% block title %}Dashboard - Makenot.work{% endblock %} |
| 4 |
{% block body_attrs %} class="padded-page dashboard-page dashboard-user-page"{% endblock %} |
| 5 |
|
| 6 |
{% block content %} |
| 7 |
{% include "partials/site_header.html" %} |
| 8 |
|
| 9 |
{% if let Some(su) = session_user %}{% if su.is_sandbox %} |
| 10 |
<div class="sandbox-banner"> |
| 11 |
Sandbox mode: your data will be deleted when the session expires. |
| 12 |
<a href="/join" class="sandbox-banner-link">Create an account</a> to keep your work. |
| 13 |
</div> |
| 14 |
{% endif %}{% endif %} |
| 15 |
|
| 16 |
<div class="container"> |
| 17 |
{% if deactivated %} |
| 18 |
<div class="alert alert-warning"> |
| 19 |
<p class="alert-title">Account Deactivated</p> |
| 20 |
<p>Your account is deactivated. Your content is hidden from fans and no new content can be created.</p> |
| 21 |
<p>You can:</p> |
| 22 |
<div class="account-status-actions"> |
| 23 |
<form hx-post="/api/users/me/reactivate" hx-swap="none" |
| 24 |
onsubmit="setTimeout(function(){ window.location.reload(); }, 500)"> |
| 25 |
<button type="submit" class="btn-primary">Reactivate Account</button> |
| 26 |
</form> |
| 27 |
<a href="/dashboard/export" class="button">Export Data</a> |
| 28 |
<a href="/dashboard/delete-account" class="button btn-danger">Permanently Delete</a> |
| 29 |
</div> |
| 30 |
</div> |
| 31 |
{% elif creator_paused %} |
| 32 |
<div class="alert alert-warning"> |
| 33 |
<p class="alert-title">Account Paused</p> |
| 34 |
<p>Your creator account is paused. Existing fan subscriptions will expire at the end of their billing period. One-time purchases remain accessible. No new sales can be made.</p> |
| 35 |
<p>To resume, re-subscribe to a creator plan:</p> |
| 36 |
<div class="account-status-actions"> |
| 37 |
<a href="/creators" class="button btn-primary">Resume: Choose a Tier</a> |
| 38 |
<a href="/dashboard/export" class="button">Export Data</a> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
{% elif suspended %} |
| 42 |
<div class="suspension-wrap"> |
| 43 |
{% let reason = suspension_reason.as_deref().unwrap_or("No reason provided") %} |
| 44 |
{% include "partials/suspension_banner.html" %} |
| 45 |
</div> |
| 46 |
{% endif %} |
| 47 |
|
| 48 |
{% if let Some(warning) = password_warning %} |
| 49 |
<div class="password-warning-banner"> |
| 50 |
<strong>Password Warning:</strong> {{ warning }} |
| 51 |
You can change your password in Account settings. |
| 52 |
</div> |
| 53 |
{% endif %} |
| 54 |
|
| 55 |
<header> |
| 56 |
<h1 class="page-title">{{ user.username }}</h1> |
| 57 |
<div class="dash-user-header-links"> |
| 58 |
<a href="/u/{{ user.username }}" class="dash-user-header-link">View public profile →</a> |
| 59 |
<a href="/dashboard/export" class="dash-user-header-link">Export data →</a> |
| 60 |
</div> |
| 61 |
</header> |
| 62 |
|
| 63 |
<div id="onboarding-area"> |
| 64 |
{% if let Some(checklist) = onboarding %} |
| 65 |
{% include "partials/onboarding_checklist.html" %} |
| 66 |
{% endif %} |
| 67 |
{% if show_checklist_recovery %} |
| 68 |
<div class="checklist-recovery"> |
| 69 |
<a href="#" hx-post="/dashboard/onboarding/restore" hx-target="#onboarding-area" hx-swap="innerHTML" |
| 70 |
class="checklist-recovery-link">Show setup checklist</a> |
| 71 |
</div> |
| 72 |
{% endif %} |
| 73 |
</div> |
| 74 |
|
| 75 |
<div class="tabs" role="tablist" aria-label="Dashboard sections"> |
| 76 |
{% if deactivated %} |
| 77 |
<button class="tab is-selected" |
| 78 |
role="tab" |
| 79 |
aria-selected="true" |
| 80 |
aria-controls="tab-content" |
| 81 |
id="tab-support" |
| 82 |
hx-get="/dashboard/tabs/support" |
| 83 |
hx-target="#tab-content" |
| 84 |
hx-swap="innerHTML" |
| 85 |
hx-indicator="#tab-spinner" |
| 86 |
onclick="setActiveTab(this)">Support</button> |
| 87 |
<span id="tab-spinner" class="htmx-indicator tab-spinner" aria-live="polite"> Loading...</span> |
| 88 |
</div> |
| 89 |
|
| 90 |
<div id="tab-content" class="tab-content active" |
| 91 |
role="tabpanel" |
| 92 |
aria-labelledby="tab-support" |
| 93 |
hx-get="/dashboard/tabs/support" |
| 94 |
hx-trigger="load" |
| 95 |
hx-swap="innerHTML"> |
| 96 |
</div> |
| 97 |
{% else %} |
| 98 |
{% if let Some(su) = session_user %}{% if su.can_create_projects %} |
| 99 |
<button class="tab is-selected" |
| 100 |
role="tab" |
| 101 |
aria-selected="true" |
| 102 |
aria-controls="tab-content" |
| 103 |
id="tab-projects" |
| 104 |
title="Your projects and their items" |
| 105 |
hx-get="/dashboard/tabs/projects" |
| 106 |
hx-target="#tab-content" |
| 107 |
hx-swap="innerHTML" |
| 108 |
hx-indicator="#tab-spinner" |
| 109 |
onclick="setActiveTab(this)">Projects</button> |
| 110 |
{% endif %}{% endif %} |
| 111 |
<button class="tab{% if let Some(su) = session_user %}{% if !su.can_create_projects %} is-selected{% endif %}{% endif %}" |
| 112 |
role="tab" |
| 113 |
aria-selected="{% if let Some(su) = session_user %}{% if !su.can_create_projects %}true{% else %}false{% endif %}{% endif %}" |
| 114 |
aria-controls="tab-content" |
| 115 |
id="tab-payments" |
| 116 |
title="Stripe connection and payment history" |
| 117 |
hx-get="/dashboard/tabs/payments" |
| 118 |
hx-target="#tab-content" |
| 119 |
hx-swap="innerHTML" |
| 120 |
hx-indicator="#tab-spinner" |
| 121 |
onclick="setActiveTab(this)">Payments</button> |
| 122 |
{% if let Some(su) = session_user %}{% if su.can_create_projects %} |
| 123 |
<button class="tab" |
| 124 |
role="tab" |
| 125 |
aria-selected="false" |
| 126 |
aria-controls="tab-content" |
| 127 |
id="tab-analytics" |
| 128 |
title="Sales, revenue, and audience stats" |
| 129 |
hx-get="/dashboard/tabs/analytics" |
| 130 |
hx-target="#tab-content" |
| 131 |
hx-swap="innerHTML" |
| 132 |
hx-indicator="#tab-spinner" |
| 133 |
onclick="setActiveTab(this)">Analytics</button> |
| 134 |
{% endif %}{% endif %} |
| 135 |
<button class="tab" |
| 136 |
role="tab" |
| 137 |
aria-selected="false" |
| 138 |
aria-controls="tab-content" |
| 139 |
id="tab-settings" |
| 140 |
title="Profile, account, plan, and integrations" |
| 141 |
hx-get="/dashboard/tabs/settings" |
| 142 |
hx-target="#tab-content" |
| 143 |
hx-swap="innerHTML" |
| 144 |
hx-indicator="#tab-spinner" |
| 145 |
onclick="setActiveTab(this)">Settings</button> |
| 146 |
<button class="tab" |
| 147 |
role="tab" |
| 148 |
aria-selected="false" |
| 149 |
aria-controls="tab-content" |
| 150 |
id="tab-support" |
| 151 |
title="Contact support or report an issue" |
| 152 |
hx-get="/dashboard/tabs/support" |
| 153 |
hx-target="#tab-content" |
| 154 |
hx-swap="innerHTML" |
| 155 |
hx-indicator="#tab-spinner" |
| 156 |
onclick="setActiveTab(this)">Support</button> |
| 157 |
<span id="tab-spinner" class="htmx-indicator tab-spinner" aria-live="polite"> Loading...</span> |
| 158 |
</div> |
| 159 |
|
| 160 |
|
| 161 |
<div id="tab-content" class="tab-content active" |
| 162 |
role="tabpanel" |
| 163 |
{% if let Some(su) = session_user %}{% if su.can_create_projects %} |
| 164 |
aria-labelledby="tab-projects" |
| 165 |
hx-get="/dashboard/tabs/projects" |
| 166 |
{% else %} |
| 167 |
aria-labelledby="tab-payments" |
| 168 |
hx-get="/dashboard/tabs/payments" |
| 169 |
{% endif %}{% endif %} |
| 170 |
hx-trigger="load" |
| 171 |
hx-swap="innerHTML"> |
| 172 |
</div> |
| 173 |
{% endif %} |
| 174 |
</div> |
| 175 |
{% endblock %} |
| 176 |
|
| 177 |
{% block scripts %} |
| 178 |
<script src="/static/passkey.js"></script> |
| 179 |
{% endblock %} |
| 180 |
|
| 181 |
|