Commit | Line | Data |
---|---|---|
e548663a PP |
1 | # coding: utf-8 |
2 | ||
3 | from django import template | |
4 | ||
5 | from chercheurs.models import GroupeChercheur, DomaineRecherche, CG_STATUT_CHOICES | |
6 | from chercheurs.templatetags.chercheurs_admin import prepare_choices | |
7 | ||
8 | register = template.Library() | |
9 | ||
10 | @register.inclusion_tag('admin/filter.html', takes_context=True) | |
11 | def filter_statut(context): | |
12 | return {'title': 'statut', | |
13 | 'choices': prepare_choices(CG_STATUT_CHOICES, 'statut', context)} | |
14 | ||
15 | @register.inclusion_tag('admin/filter.html', takes_context=True) | |
16 | def filter_groupe_chercheurs(context): | |
d26ca87a | 17 | return {'title': u"communautés de chercheurs", |
e548663a PP |
18 | 'choices': prepare_choices(GroupeChercheur.objects.values_list('id', 'nom'), 'groupe', context)} |
19 | ||
20 | @register.inclusion_tag('admin/filter.html', takes_context=True) | |
21 | def filter_domaine_recherche(context): | |
22 | return {'title': u"domaine de recherche", | |
23 | 'choices': prepare_choices(DomaineRecherche.objects.values_list('id', 'nom'), 'groupe', context)} | |
24 |