Development #8843
Publish blocks on account pages also using the frontend name
Début:
02 novembre 2015
Echéance:
% réalisé:
100%
Temps estimé:
Patch proposed:
Oui
Planning:
Description
It should be possible to do <h1>Certificates</h1>{{ blocks.x509 }}
for example
Fichiers
Révisions associées
Historique
Mis à jour par Mikaël Ates il y a environ 8 ans
- Fichier 0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch ajouté
- Patch proposed changé de Non à Oui
The list of block should be kept for compatibilty and it seems then not necessary to modify accounts.html. So maybe it's enough to build the dic and pass in the template context.
In the patch proposed I used the frontends id for the dictionnary keys. The block can be displayed in template with
{{ frontends_block_dic.fc|safe }}
for FranceConnect and with ids password and ssl for respectively LoginPasswordBackend and SSLFrontend.
Mis à jour par Benjamin Dauvergne il y a environ 8 ans
Two things:
- name it frontends_block_by_name, dic is just an implementation detail
- we should remove the need to use the safe filter by applying
django.utils.safestring.make_safe()
to blocks before passing them to the template
Mis à jour par Mikaël Ates il y a environ 8 ans
- Fichier 0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch 0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch ajouté
I've renamed it with 'by_id'.
blocks are already of type django.utils.safestring.SafeText. The safe filter should be removed from the template (and my example).
Mis à jour par Mikaël Ates il y a environ 8 ans
- Fichier
0001-Add-in-profile-template-context-a-dictionnary-of-fro.patchsupprimé
Mis à jour par Mikaël Ates il y a environ 8 ans
- Statut changé de Nouveau à Résolu (à déployer)
- % réalisé changé de 0 à 100
Appliqué par commit authentic2|7b633fe71f0e3ac3bd588b955662bf54e355ed37.
Mis à jour par Benjamin Dauvergne il y a environ 8 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a plus de 6 ans
- Statut changé de Solution déployée à Fermé
Add in profile template context a dictionnary of frontend blocks (fixes #8843).