package web import "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" templ exportLinks(base string) {

{ i18n.T(ctx, "export.download_json") } { i18n.T(ctx, "export.download_pdf") }

} // 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) {
@accountDataBody(me)
} // 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")

{ i18n.T(ctx, "gdpr.account_export_intro") }

@exportLinks("/api/v1/me/export")

{ i18n.T(ctx, "gdpr.delete_account") }

{ i18n.T(ctx, "gdpr.delete_account_intro") }

if len(me.DeletesOrgs) > 0 {

{ i18n.T(ctx, "gdpr.deletes_orgs") }

}
@formError() @confirmFields(me)
} templ orgDataSection(me Me) {
@sectionHeading("gdpr.org_data")

{ i18n.T(ctx, "gdpr.org_export_intro") }

@exportLinks("/api/v1/org/export") if me.IsOwner {

{ i18n.T(ctx, "gdpr.delete_org") }

{ i18n.T(ctx, "gdpr.delete_org_intro") }

@formError() @field(i18n.T(ctx, "gdpr.type_slug", "Slug", me.ActiveSlug), "slug", "text", "off", true) @confirmFields(me)
}
}