Project

General

Profile

Development #8843

Publish blocks on account pages also using the frontend name

Added by Benjamin Dauvergne almost 4 years ago. Updated over 1 year ago.

Status:
Fermé
Priority:
Bas
Category:
-
Target version:
Start date:
02 Nov 2015
Due date:
% Done:

100%

Patch proposed:
Yes
Planning:
No

Description

It should be possible to do <h1>Certificates</h1>{{ blocks.x509 }} for example

0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch View (1.58 KB) Mikaël Ates, 24 Feb 2016 02:59 PM

Associated revisions

Revision 7b633fe7 (diff)
Added by Mikaël Ates over 3 years ago

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

History

#2 Updated by Benjamin Dauvergne almost 4 years ago

  • Target version set to 2.2.0

#3 Updated by Mikaël Ates over 3 years ago

  • File 0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch added
  • Patch proposed changed from No to Yes

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 Updated by Benjamin Dauvergne over 3 years ago

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 Updated by Mikaël Ates over 3 years ago

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 Updated by Mikaël Ates over 3 years ago

  • File deleted (0001-Add-in-profile-template-context-a-dictionnary-of-fro.patch)

#7 Updated by Benjamin Dauvergne over 3 years ago

Ok.

#8 Updated by Mikaël Ates over 3 years ago

  • Status changed from Nouveau to Résolu (à déployer)
  • % Done changed from 0 to 100

#9 Updated by Benjamin Dauvergne over 3 years ago

  • Status changed from Résolu (à déployer) to Solution déployée

#11 Updated by Benjamin Dauvergne over 1 year ago

  • Status changed from Solution déployée to Fermé

Also available in: Atom PDF