Merge remote-tracking branch 'origin/master' into Aufinal/view_spectacles
This commit is contained in:
commit
20f3030552
8 changed files with 27 additions and 10 deletions
|
@ -162,3 +162,10 @@ Pour mettre à jour les paquets Python, utiliser la commande suivante :
|
|||
Pour mettre à jour les modèles après une migration, il faut ensuite faire :
|
||||
|
||||
python manage.py migrate
|
||||
|
||||
|
||||
## Documentation utilisateur
|
||||
|
||||
Une brève documentation utilisateur pour se faliliariser plus vite avec l'outil
|
||||
est accessible sur le
|
||||
[wiki](https://git.eleves.ens.fr/cof-geek/gestioCOF/wikis/home).
|
||||
|
|
|
@ -16,7 +16,6 @@ class AttributionInline(admin.TabularInline):
|
|||
model = Attribution
|
||||
|
||||
class ParticipantAdmin(admin.ModelAdmin):
|
||||
#inlines = [ChoixSpectacleInline]
|
||||
inlines = [AttributionInline]
|
||||
def get_queryset(self, request):
|
||||
return Participant.objects.annotate(nb_places = Count('attributions'),
|
||||
|
@ -31,8 +30,9 @@ class ParticipantAdmin(admin.ModelAdmin):
|
|||
else: return u"0 €"
|
||||
total.admin_order_field = "total"
|
||||
total.short_description = "Total à payer"
|
||||
list_display = ("user", "nb_places", "total", "paid", "paymenttype")
|
||||
list_filter = ("paid",)
|
||||
list_display = ("user", "nb_places", "total", "paid", "paymenttype",
|
||||
"tirage")
|
||||
list_filter = ("paid", "tirage")
|
||||
search_fields = ('user__username', 'user__first_name', 'user__last_name')
|
||||
actions = ['send_attribs',]
|
||||
actions_on_bottom = True
|
||||
|
|
|
@ -241,7 +241,9 @@ def do_tirage(request, tirage_id):
|
|||
# FIXME: Établir les conditions de validations (formulaire ?)
|
||||
# cf. issue #32
|
||||
if False:
|
||||
Attribution.objects.all().delete()
|
||||
Attribution.objects.filter(
|
||||
spectacle__tirage=tirage_elt
|
||||
).delete()
|
||||
for (show, members, _) in results:
|
||||
for (member, _, _, _) in members:
|
||||
attrib = Attribution(spectacle=show, participant=member)
|
||||
|
|
|
@ -53,6 +53,7 @@ urlpatterns = patterns('',
|
|||
url(r'^autocomplete/registration$', 'gestioncof.autocomplete.autocomplete'),
|
||||
url(r'^autocomplete/', include('autocomplete_light.urls')),
|
||||
# Interface admin
|
||||
url(r'^admin/logout/', 'gestioncof.views.logout'),
|
||||
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
url(r'^admin/(?P<app_label>[\d\w]+)/(?P<model_name>[\d\w]+)/csv/',
|
||||
'gestioncof.csv_views.admin_list_export',
|
||||
|
|
|
@ -154,6 +154,13 @@ class PetitCoursAttributionCounterAdmin(admin.ModelAdmin):
|
|||
list_display = ('user','matiere','count',)
|
||||
list_filter = ('matiere',)
|
||||
search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'matiere__name')
|
||||
actions = ['reset',]
|
||||
actions_on_bottom = True
|
||||
|
||||
def reset(self, request, queryset):
|
||||
queryset.update(count=0)
|
||||
reset.short_description = u"Remise à zéro du compteur"
|
||||
|
||||
|
||||
class PetitCoursDemandeAdmin(admin.ModelAdmin):
|
||||
list_display = ('name','email','agrege_requis','niveau','created','traitee','processed')
|
||||
|
|
|
@ -79,6 +79,11 @@ class SurveyForm(forms.Form):
|
|||
field.question_id = question.id
|
||||
self.fields["question_%d" % question.id] = field
|
||||
|
||||
def answers(self):
|
||||
for name, value in self.cleaned_data.items():
|
||||
if name.startswith('question_'):
|
||||
yield (self.fields[name].question_id, value)
|
||||
|
||||
class SurveyStatusFilterForm(forms.Form):
|
||||
def __init__(self, *args, **kwargs):
|
||||
survey = kwargs.pop("survey")
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<td>{% for matiere in demande.matieres.all %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %}</td>
|
||||
<td>{{ demande.created|date:"d E Y" }}</td>
|
||||
<td style="text-align: center;"><img src="{% if demande.traitee %}{% static "images/yes.png" %}{% else %}{% static "images/no.png" %}{% endif %}" /></td>
|
||||
<td>{% if demande.traitee_par %}{{ demande.traitee_par.username }}{% else %}<img src="{% static "/images/none.png" %}" />{% endif %}</td>
|
||||
<td>{% if demande.traitee_par %}{{ demande.traitee_par.username }}{% else %}<img src="{% static "images/none.png" %}" />{% endif %}</td>
|
||||
<td><a href="{% url "petits-cours-demande-details" demande.id %}" class="see_detail">Détails</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -59,11 +59,6 @@ def logout(request):
|
|||
else:
|
||||
return redirect("django.contrib.auth.views.logout")
|
||||
|
||||
def answers(self):
|
||||
for name, value in self.cleaned_data.items():
|
||||
if name.startswith('question_'):
|
||||
yield (self.fields[name].question_id, value)
|
||||
|
||||
@login_required
|
||||
def survey(request, survey_id):
|
||||
survey = get_object_or_404(Survey, id = survey_id)
|
||||
|
|
Loading…
Reference in a new issue