ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 9m21s
ci / test (pull_request) Successful in 13m53s
ci / build (pull_request) Successful in 11m22s
ci / image (pull_request) Successful in 4m36s
Terms of service join the legal notice and privacy policy, for the platform only. Every account accepts the platform's privacy policy and terms: on sign-up (also through an invitation) by ticking a box for the versions shown, and after a sign-in through a provider right away. When an admin saves a material change with "everyone has to accept again", the document gets a new version and each account is asked at its next request; corrections ask nobody. Acceptances are kept per version with their time, as proof, and are part of the data export. Until an account accepted, and while it is suspended, it can read the documents, export its data, delete itself and sign out, nothing else: pages lead to /consent or /account/suspended, other API calls answer 403 consent_required or account_suspended. Suspended accounts therefore sign in again, by password or provider; their API tokens stay blocked. Deleting an account deletes the organizations it owns, monitors and all, also when they have other members (each organization has one owner); it no longer refuses. The account settings name those organizations first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
70 lines
2.9 KiB
Templ
70 lines
2.9 KiB
Templ
package web
|
|
|
|
import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n"
|
|
|
|
templ exportLinks(base string) {
|
|
<p class="mb-6 flex gap-3 text-sm">
|
|
<a href={ templ.SafeURL(base + "?format=json") } class="border border-ink px-3 py-1.5 hover:bg-ink hover:text-paper" download>{ i18n.T(ctx, "export.download_json") }</a>
|
|
<a href={ templ.SafeURL(base + "?format=pdf") } class="border border-ink px-3 py-1.5 hover:bg-ink hover:text-paper" download>{ i18n.T(ctx, "export.download_pdf") }</a>
|
|
</p>
|
|
}
|
|
|
|
// confirmFields asks for the password, or the email address for accounts
|
|
// signing in through SSO only.
|
|
templ confirmFields(me Me) {
|
|
if me.HasPassword {
|
|
@field(i18n.T(ctx, "gdpr.password"), "password", "password", "current-password", true)
|
|
} else {
|
|
@field(i18n.T(ctx, "gdpr.type_email"), "confirm", "email", "off", true)
|
|
}
|
|
}
|
|
|
|
templ accountDataSection(me Me) {
|
|
<section class="mt-12 max-w-xl">
|
|
@accountDataBody(me)
|
|
</section>
|
|
}
|
|
|
|
// accountDataBody exports and deletes the account; also shown to accounts
|
|
// that are suspended or have not accepted the terms.
|
|
templ accountDataBody(me Me) {
|
|
@sectionHeading("gdpr.account_data")
|
|
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.account_export_intro") }</p>
|
|
@exportLinks("/api/v1/me/export")
|
|
<h3 class="mb-2 mt-8 text-sm font-medium text-down">{ i18n.T(ctx, "gdpr.delete_account") }</h3>
|
|
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.delete_account_intro") }</p>
|
|
if len(me.DeletesOrgs) > 0 {
|
|
<div class="mb-4 border border-down p-3 text-sm">
|
|
<p class="mb-2 text-down">{ i18n.T(ctx, "gdpr.deletes_orgs") }</p>
|
|
<ul class="list-inside list-disc">
|
|
for _, o := range me.DeletesOrgs {
|
|
<li>{ o }</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
}
|
|
<form data-api="/me/delete" data-next="/login" data-confirm={ i18n.T(ctx, "gdpr.delete_account_confirm") }>
|
|
@formError()
|
|
@confirmFields(me)
|
|
<button type="submit" class="mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50">{ i18n.T(ctx, "gdpr.delete_account") }</button>
|
|
</form>
|
|
}
|
|
|
|
templ orgDataSection(me Me) {
|
|
<section class="mt-12 max-w-xl">
|
|
@sectionHeading("gdpr.org_data")
|
|
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.org_export_intro") }</p>
|
|
@exportLinks("/api/v1/org/export")
|
|
if me.IsOwner {
|
|
<h3 class="mb-2 mt-8 text-sm font-medium text-down">{ i18n.T(ctx, "gdpr.delete_org") }</h3>
|
|
<p class="mb-4 text-sm text-muted">{ i18n.T(ctx, "gdpr.delete_org_intro") }</p>
|
|
<form data-api="/org/delete" data-next="/" data-confirm={ i18n.T(ctx, "gdpr.delete_org_confirm") }>
|
|
@formError()
|
|
@field(i18n.T(ctx, "gdpr.type_slug", "Slug", me.ActiveSlug), "slug", "text", "off", true)
|
|
@confirmFields(me)
|
|
<button type="submit" class="mt-2 w-full border border-down px-3 py-2 text-sm font-medium text-down hover:bg-down hover:text-paper disabled:opacity-50">{ i18n.T(ctx, "gdpr.delete_org") }</button>
|
|
</form>
|
|
}
|
|
</section>
|
|
}
|