Crate mas_templates

Source
Expand description

Templates rendering

Modules§

check
Helps rendering each template with sample data

Macros§

register_templates
Macro that helps generating helper function that renders a specific template with a strongly-typed context. It also register the template in a static array to help detecting missing templates at startup time.

Structs§

AccountInactiveContext
Context used by the account/deactivated.html and account/locked.html templates
ApiDocContext
Context used by the swagger/doc.html template
AppContext
Context used by the app.html template
CompatSsoContext
Context used by the sso.html template
ConsentContext
Context used by the consent.html template
DeviceConsentContext
Context used by the device_consent.html template
DeviceLinkContext
Context used by the device_link.html template
EmailRecoveryContext
Context used by the emails/recovery.{txt,html,subject} templates
EmailVerificationContext
Context used by the emails/verification.{txt,html,subject} templates
EmptyContext
An empty context used for composition
ErrorContext
Context used by the error.html template
FormPostContext
Context used by the form_post.html template
FormState
The state of a form and its fields
IndexContext
Context used by the index.html template
LoginContext
Context used by the login.html template
NotFoundContext
Context used by the not found (404.html) template
PasswordRegisterContext
Context used by the password_register.html template
PolicyViolationContext
Context used by the policy_violation.html template
PostAuthContext
Context used in login and reauth screens, for the post-auth action to do
ReauthContext
Context used by the reauth.html template
RecoveryExpiredContext
Context used by the pages/recovery/expired.html template
RecoveryFinishContext
Context used by the pages/recovery/finish.html template
RecoveryProgressContext
Context used by the pages/recovery/progress.html template
RecoveryStartContext
Context used by the pages/recovery/start.html template
RegisterContext
Context used by the register.html template
RegisterStepsDisplayNameContext
Context used by the display_name.html template
RegisterStepsEmailInUseContext
Context used by the pages/register/steps/email_in_use.html template
RegisterStepsVerifyEmailContext
Context used by the pages/register/steps/verify_email.html templates
SiteBranding
Site branding information.
SiteFeatures
Site features information.
Templates
Wrapper around minijinja::Environment helping rendering the various templates
UpstreamExistingLinkContext
Context used by the pages/upstream_oauth2/{link_mismatch,do_login}.html templates
UpstreamRegister
Context used by the pages/upstream_oauth2/do_register.html templates
UpstreamSuggestLink
Context used by the pages/upstream_oauth2/suggest_link.html templates
WithCaptcha
Context with an optional CAPTCHA configuration in it
WithCsrf
Context with a CSRF token in it
WithLanguage
Context with a specified locale in it
WithOptionalSession
Context with an optional user session in it
WithSession
Context with a user session in it

Enums§

DeviceLinkFormField
Form fields on the device link page
FieldError
An error on a form field
FormError
An error on the whole form
LoginFormField
Fields of the login form
PostAuthContextInner
Inner context used in login and reauth screens. See PostAuthContext.
ReauthFormField
Fields of the reauthentication form
RecoveryFinishFormField
Fields of the account recovery finish form
RecoveryStartFormField
Fields of the account recovery start form
RegisterFormField
Fields of the registration form
RegisterStepsDisplayNameFormField
Fields for the display name form
RegisterStepsVerifyEmailFormField
Fields of the email verification form
TemplateError
Failed to render a template
TemplateLoadingError
There was an issue while loading the templates
UpstreamRegisterFormField
User-editeable fields of the upstream account link form

Traits§

FormField
A trait which should be used for form field enums
SiteConfigExt
Extension trait for SiteConfig to construct SiteBranding and SiteFeatures from it.
TemplateContext
Helper trait to construct context wrappers
ToFormState
Utility trait to help creating FormState out of a form

Functions§

escape_html
Escape the given string for use in HTML