From: davin baragiotta Date: Thu, 28 Oct 2010 23:07:48 +0000 (-0400) Subject: Merge branch 'master' of ssh://gitosis@git.auf/auf_savoirs_en_partage_django X-Git-Url: https://git.auf.org/?p=auf_savoirs_en_partage_django.git;a=commitdiff_plain;h=a7caf45902f35858a82b69f2e2c2e701e721b50a;hp=0b5b6fe025fae0ce293865b0d1566cfc6bd8d5db Merge branch 'master' of ssh://gitosis@git.auf/auf_savoirs_en_partage_django --- diff --git a/auf_savoirs_en_partage/chercheurs/forms.py b/auf_savoirs_en_partage/chercheurs/forms.py index 8d1506c..d4e702b 100644 --- a/auf_savoirs_en_partage/chercheurs/forms.py +++ b/auf_savoirs_en_partage/chercheurs/forms.py @@ -63,7 +63,7 @@ class RepertoireSearchForm (forms.Form): mots_cles = forms.CharField (required = False, label="Mots-clés") discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Discipline", empty_label="Tous") domaine = forms.ModelChoiceField(queryset=Groupe.objects.all(), required=False, label="Domaine de recherche", empty_label="Tous") - #fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction") + fonction = forms.ChoiceField(choices=(('','Tous'),('chercheur','Chercheur'), ('enseignant','Enseignant-Chercheur'), ('expert','Expert')), required=False, label="Fonction") pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous") class SendPasswordForm(forms.Form): diff --git a/auf_savoirs_en_partage/chercheurs/views.py b/auf_savoirs_en_partage/chercheurs/views.py index 7c3abf5..291833e 100644 --- a/auf_savoirs_en_partage/chercheurs/views.py +++ b/auf_savoirs_en_partage/chercheurs/views.py @@ -142,6 +142,14 @@ def chercheur_queryset (request): mots_cles = simpleForm.cleaned_data["mots_cles"] if mots_cles: list = list.search(mots_cles) + fonction = simpleForm.cleaned_data["fonction"] + if fonction: + if fonction == "enseignant": + list = list.filter(enseignant=True) + if fonction == "expert": + list = list.exclude(expertise=None) + + return list def index(request): @@ -196,7 +204,8 @@ def inscription(request): pub = publication4_form.save() c.publication4 = pub these = these_form.save() - expertise = expertise_form.save() + if expertise_form.is_valid() and expertise_form.cleaned_data['nom']: + expertise = expertise_form.save() c.these = these c.expertise = expertise etablissement_form.save(commit=False) @@ -288,7 +297,8 @@ def edit(request): if publication4_form.is_valid() and publication4_form.cleaned_data['titre']: chercheur.publication4 = publication4_form.save() chercheur.these = these_form.save() - chercheur.expertise = expertise_form.save() + if expertise_form.cleaned_data['nom']: + chercheur.expertise = expertise_form.save() chercheur.save() #Gestion des groupes groupes = request.POST.getlist('groupe-groupes') diff --git a/auf_savoirs_en_partage/templates/chercheurs/chercheur_form.html b/auf_savoirs_en_partage/templates/chercheurs/chercheur_form.html new file mode 100644 index 0000000..83fadec --- /dev/null +++ b/auf_savoirs_en_partage/templates/chercheurs/chercheur_form.html @@ -0,0 +1,63 @@ + + + {% if personne_form.errors or chercheur_form.errors or etablissement_form.errors or discipline_form.errors or these_form.errors %} +Votre fiche n'a pas été enregistrée. Veuillez remplir tous les champs obligatoires (*). +{% endif %} +
+ Informations personnelles + {% with personne_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+
+ Informations académiques + {% with chercheur_form as form %} + {% include "table_form.html" %} + {% endwith %} + {% with groupe_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+ +
+ Etablissement de rattachement + {% with etablissement_form as form %} + {% include "table_form.html" %} + {% endwith %} +

Si l'établissement n'existe pas ci-dessus

+ {% with etablissement_autre_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+ +
+ Champ disciplinaire, thèmes de recherche + {% with discipline_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+ +
+ Thèse ou mémoire +
+
+ {% with these_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+
+
+
+ +
+ Expertise +
+ {% with expertise_form as form %} + {% include "table_form.html" %} + {% endwith %} +
+
diff --git a/auf_savoirs_en_partage/templates/chercheurs/retrieve.html b/auf_savoirs_en_partage/templates/chercheurs/retrieve.html index c36f3b7..e4c02a5 100644 --- a/auf_savoirs_en_partage/templates/chercheurs/retrieve.html +++ b/auf_savoirs_en_partage/templates/chercheurs/retrieve.html @@ -24,11 +24,10 @@ {{chercheur.nationalite.nom|default:"-"}} {% endif %} - - + Diplôme: {{chercheur.diplome|default:"-"}} @@ -60,12 +59,34 @@ {% endif %} + + {% if chercheur.expertise %} +
Expertise
+ + + + + + {% if chercheur.expertise.date %} + + + + + {% endif %} + {% if chercheur.expertise.organisme_demandeur and chercheur.expertise.organisme_demandeur_visible %} + + + + + {% endif %} +
Titre de l'expertise:{{chercheur.expertise.nom}}
Date:{{chercheur.expertise.date}}
Organisme demandeur:{{chercheur.expertise.organisme_demandeur}}
+ {% endif %}
Thèmes de recherche et publications
- - + + {% if chercheur.these %}
Thèmes de recherche et domaine d'expertise:{{chercheur.expertise}}Thèmes de recherche:{{chercheur.theme_recherche}}