Templates¶
This references the template files, their role and the variables available in their contexts. The intended audience for this reference is designers wishing to build their custom Canaille theme.
Base¶
Those templates are shared by all the pages rendered by Canaille.
Template files¶
- TEMPLATE base.html¶
The main template inherited by almost every other templates.
- Parameters:
user (
User) – The current user, if logged in.features (
Features) – The features enabled and available in Canaille.locale (
str) – The user locale.logo_url (
str) – The URL of the instance logo defined inLOGO.favicon_url (
str) – The URL of the instance favicon defined inFAVICON.request_is_boosted (
bool) – Whether the page is boosted byHTMX.menu (
bool) – Whether to display the menu or not.debug (
bool) – Whether the app has been launched in debug mode.no_secret_key (bool) – Whether a
SECRET_KEYhas been defined.
- TEMPLATE error.html¶
The error page. Displayed for all kinds of errors (not found, internal server error etc.).
- TEMPLATE macro/flask.html¶
Macros for Flask flash message rendering
- TEMPLATE macro/form.html¶
Macros for form and form field rendering.
Connects WTForms, Fomantic-UI and HTMX.
- TEMPLATE macro/table.html¶
Macros for rendering table paginated with HTMX.
Forms¶
Core¶
The core templates are displayed in the authentication and profile edition pages.
Template files¶
- TEMPLATE core/about.html¶
The ‘About’ page.¶
The ‘About’ page.¶
The ‘About’ page.
This is an informational page, displaying the project links.
- Parameters:
version (
str) – The current Canaille version.
- TEMPLATE core/group.html¶
The group edition page.¶
The group edition page.¶
Group edition page.
Displays the group edition or creation form.
- Parameters:
edited_group (
Group) –Nonein a creation context. In edition context this is the edited group.form (
CreateGroupFormorEditGroupForm) – The group edition/creation form.
- TEMPLATE core/invite.html¶
The invitation form page.¶
The invitation form page.¶
The invitation form page.
Displays the invitation form to users with the invitation permission.
- Parameters:
form (
InvitationForm) – The invitation form.
- TEMPLATE core/invite_group_member.html¶
Group invitation form page.
Displays the group invitation form to users with the appropriate permissions.
- Parameters:
form (
GroupInvitationForm) – The group invitation form.group (
Group) – The group to invite members to.
- TEMPLATE core/join.html¶
The invitation acceptation page.
This page is displayed to users who have clicked on invitation links sent by mail (or by other media). It displays a basic account creation form.
- Parameters:
form (
JoinForm) – The account creation form.captcha_data – Optional CAPTCHA data when CAPTCHA is enabled
- TEMPLATE core/login.html¶
The login page.¶
The login page.¶
The login page.
This page displays a form to get the user identifier.
- Parameters:
form (
LoginForm) – The login form.
- TEMPLATE core/partials/profile_settings_fido.html¶
WebAuthn passkeys management partial.
Displays the passkeys section in profile settings.
- Parameters:
edited_user (
User) – The user being edited.
- TEMPLATE core/partial/captcha_field.html¶
CAPTCHA field partial template.
This macro renders a complete CAPTCHA field with: - Hidden token field - CAPTCHA image - Audio playback button - Refresh button - Input field for user response - Error messages
- Parameters:
form – The form containing captcha and captcha_token fields
captcha_data – Dict with ‘token’ and ‘image_data_uri’
audio_endpoint – Flask endpoint name for audio CAPTCHA (e.g., ‘core.auth.password.captcha_audio’)
- TEMPLATE core/account/add.html¶
User account creation page.
This template displays an account creation form. It is used in the registration page, and in the manual account creation page available for users with user management permission.
- TEMPLATE core/account/edit.html¶
The user profile edition page.¶
The user profile edition page.¶
The profile edition template.
Displays a user profile edition form.
- Parameters:
edited_user (
User) – The user that the form will edit.profile_form (
FlaskForm) – The user profile edition form. Dynamically built according to the userREADandWRITEpermissions. The available fields are those appearing in READ and WRITE, those only appearing in READ are read-only.emails_form (
EmailConfirmationForm) – An email edition form. Used when thehas_email_confirmationfeature is enabled.
- TEMPLATE core/account/settings.html¶
The user profile settings edition page.¶
The user profile settings edition page.¶
The profile settings template.
Displays the user settings edition form.
- Parameters:
edited_user (
User) – The user that the form will edit.form (
FlaskForm) – The user profile edition form. Dynamically built according to the userREADandWRITEpermissions. The available fields are those appearing in READ and WRITE, those only appearing in READ are read-only.self_deletion (
bool) – Whether the editor is allowed to delete the account of the edited user.
- TEMPLATE core/account/auth/fido2.html¶
The FIDO2/WebAuthn authentication factor template.
Displays the passkeys management.
- Parameters:
edited_user (
User) – The user being edited.
- TEMPLATE core/account/auth/index.html¶
The authentication factors list template.
Displays the list of available authentication factors for a user.
- Parameters:
edited_user (
User) – The user being edited.
- TEMPLATE core/account/auth/otp.html¶
The OTP authentication factor template.
Displays the authenticator application management.
- Parameters:
edited_user (
User) – The user being edited.
- TEMPLATE core/account/auth/password.html¶
The password authentication factor template.
Displays the password management form.
- TEMPLATE core/auth/email.html¶
The multi-factor authentication code verification template.
Displays a form that asks for the multi-factor authentication code.
- Parameters:
form (
TwoFactorForm) – The code verification form.
- TEMPLATE core/auth/fido-setup.html¶
WebAuthn credential registration template.
Displays the WebAuthn registration interface.
- Parameters:
options_json (str) – The WebAuthn registration options in JSON format.
- TEMPLATE core/auth/fido.html¶
WebAuthn authentication template.
Displays the WebAuthn authentication interface.
- Parameters:
options_json (str) – The WebAuthn authentication options in JSON format.
- TEMPLATE core/auth/firstlogin.html¶
The first login page.¶
The first login page.¶
The first login page.
This page is displayed to users who do not have set a password yet.
- TEMPLATE core/auth/forgotten-password-code.html¶
The password reinitialization code page.¶
The password reinitialization code page.¶
Password forgotten code page.
This page displays a form asking for the code sent to the email address of users who cannot remember their password.
- TEMPLATE core/auth/forgotten-password.html¶
The password reinitialization page.¶
The password reinitialization page.¶
Password forgotten page.
This page displays a form asking for the email address of users who cannot remember their password.
- TEMPLATE core/auth/otp.html¶
The multi-factor authentication code verification template.
Displays a form that asks for the multi-factor authentication code.
- Parameters:
form (
TwoFactorForm) – The code verification form.
- TEMPLATE core/auth/reset-password.html¶
The password reset page.¶
The password reset page.¶
The password reset template.
Displays a password reset form.
- Parameters:
form (
PasswordResetForm) – The password reset form.user (
User) – The user associated with the URL.token (
str) – The secret link token.
- TEMPLATE core/auth/setup-otp.html¶
The multi-factor authentication initialization template.
Display a QR-code and the OTP secret.
- TEMPLATE core/auth/sms.html¶
The multi-factor authentication code verification template.
Displays a form that asks for the multi-factor authentication code.
- Parameters:
form (
TwoFactorForm) – The code verification form.
- TEMPLATE core/auth/partials/fido_errors.html¶
WebAuthn error messages partial.
Displays all possible WebAuthn error messages (hidden by default).
- Parameters:
attached (bool) – If true, use ‘attached’ style instead of ‘icon’ style.
- TEMPLATE core/auth/partials/fido_setup_content.html¶
WebAuthn registration content partial.
Displays the registration instructions, error messages, and options.
- Parameters:
options_json (str) – The WebAuthn registration options in JSON format.
Forms¶
- class canaille.core.endpoints.forms.CaptchaField(*args, **kwargs)[source]¶
Bases:
StringFieldCAPTCHA field for security code input.
- class canaille.core.endpoints.forms.CreateGroupForm(*args, **kwargs)[source]¶
Bases:
FormThe group creation form.
- class canaille.core.endpoints.forms.EditGroupForm(*args, **kwargs)[source]¶
Bases:
FormThe group edition form.
- class canaille.core.endpoints.forms.GroupInvitationForm(*args, **kwargs)[source]¶
Bases:
FormThe group invitation form.
- class canaille.core.endpoints.forms.InvitationForm(*args, **kwargs)[source]¶
Bases:
FormThe user invitation form.
- class canaille.core.endpoints.forms.PasswordWithCaptchaForm(*args, **kwargs)[source]¶
Bases:
PasswordForm
OIDC¶
The OIDC templates are displayed in the OIDC consent pages.
Template files¶
- TEMPLATE oidc/authorize.html¶
The consent request dialog.¶
The consent request dialog.¶
Consent request template.
This templates is displayed to users accessing a new application that requests to access to personal information. It lists the personal information requested by the application, and offers the user to accept or decline.
- Parameters:
user (
User) – The user whose consent is asked.grant (An Authlib
Grant) – The OIDC grant.
- TEMPLATE oidc/client_add.html¶
The client addition page.¶
The client addition page.¶
The client addition template.
Displays a form to create a new
Client.- Parameters:
form (
ClientAddForm.) – The client creation form.
- TEMPLATE oidc/client_edit.html¶
The client addition page.¶
The client addition page.¶
The client edition template.
Displays a form to edit a
Client.- Parameters:
form (
ClientAddForm.) – The client creation form.client (
Client) – The edited client.
- TEMPLATE oidc/consent_list.html¶
The consented applications list.¶
The consented applications list.¶
The consented applications list.
Display a list of clients for which users have given or revoked their consent.
- TEMPLATE oidc/logout.html¶
The OIDC logout template.
Used during OIDC RP-initiated logout, when an user confirmation is needed.
- Parameters:
form (
LogoutForm.) – The logout form.client (
Client) – The client requesting the logout.
- TEMPLATE oidc/token_list.html¶
The list of tokens.¶
The list of tokens.¶
The list of tokens.
Displays a paginated list of
Token.
- TEMPLATE oidc/token_view.html¶
The token view page.¶
The token view page.¶
The token view template.
Displays the details of a token
Token.- Parameters:
form (
TokenRevokationForm.) – A token revokation form.
Forms¶
- class canaille.oidc.endpoints.forms.ClientAddForm(*args, **kwargs)[source]¶
Bases:
FormSimplified form for adding a new client with only essential fields.
- class canaille.oidc.endpoints.forms.ClientEditForm(*args, **kwargs)[source]¶
Bases:
ClientAddFormComplete form for editing a client with all metadata fields.