data: add select2 widget for page selection in link list cell (#76059) #79
Loading…
Reference in New Issue
No description provided.
Delete Branch "wip/76059-manager-cellule-lien-lien-intern"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
63b26acb70
to3aa7ab9802
3aa7ab9802
toc67dc5061b
WIP: data: add select2 widget for page selection in link list cell (#76059)to data: add select2 widget for page selection in link list cell (#76059)@ -37,2 +38,4 @@
<script src="{% static "js/combo.map.js" %}"></script>
<script src="{% static "js/combo.multiselectwidget.js" %}"></script>
<script src="{% static "xstatic/select2.min.js" %}"></script>
<script src="{% static "xstatic/i18n/fr.js" %}"></script>
Ici on exploite les traductions packagées avec select2, c'est peu explicite mais nettement plus simple que de les prendre à notre charge comme dans wcs et a2.
@ -1198,0 +1207,4 @@
page_number = 1
pages = Page.get_as_reordered_flat_hierarchy(Page.objects.all())
pages = [x for x in pages if search_term in unicodedata.normalize('NFKC', x.title).casefold()]
J'ai fait au plus simple pour la partie recherche.
Un autre truc simple et plus performant aurait été le filtrage en SQL via genre
__icontains
, mais la gestion des accents aurait été moins bonne.Sinon la meilleure approche ça serait probablement trigram + unaccent mais c'est relou à mettre en place.
D'une manière ou d'une autre cette vue à vocation à devenir générique au détour d'un autre ticket qui nécessite select2 pour un champ d'un cellule.
bfa293f70f
toc67dc5061b
c67dc5061b
toa9fc7ca474
a9fc7ca474
to2ee91c942b