Projet

Général

Profil

Development #8843

Publish blocks on account pages also using the frontend name

Ajouté par Benjamin Dauvergne il y a plus de 8 ans. Mis à jour il y a plus de 6 ans.

Statut:
Fermé
Priorité:
Bas
Assigné à:
Catégorie:
-
Version cible:
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

Révision 7b633fe7 (diff)
Ajouté par Mikaël Ates il y a environ 8 ans

Add in profile template context a dictionnary of frontend blocks (fixes #8843).

Historique

#2

Mis à jour par Benjamin Dauvergne il y a plus de 8 ans

  • Version cible mis à 2.2.0
#3

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.

#4

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
#5

Mis à jour par Mikaël Ates il y a environ 8 ans

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).

#6

Mis à jour par Mikaël Ates il y a environ 8 ans

  • Fichier 0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch supprimé
#7

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

Ok.

#8

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
#9

Mis à jour par Benjamin Dauvergne il y a environ 8 ans

  • Statut changé de Résolu (à déployer) à Solution déployée
#11

Mis à jour par Benjamin Dauvergne il y a plus de 6 ans

  • Statut changé de Solution déployée à Fermé

Formats disponibles : Atom PDF