mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-29 20:44:24 +00:00
73305c0b28
Eboutic : - Implémentation de la norme 3DSecure v2 pour les paiement par carte bancaire - Amélioration générale de l'interface utilisateur - Résolution du problème avec les caractères spéciaux dans le panier sur Safari - Réparation du cookie du panier de l'eboutic qui n'était pas fonctionnel Autre : - Mise à jour de la documentation - Mise à jour des dépendances Javascript - Suppression du code inutilisé dans `subscription/models.py` - Amélioration des pages administrateur (back-office Django) Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com> Co-authored-by: Théo DURR <git@theodurr.fr> Co-authored-by: Julien Constant <julienconstant190@gmail.com>
38 lines
999 B
Python
38 lines
999 B
Python
from ajax_select import make_ajax_form
|
|
from django.contrib import admin
|
|
|
|
from election.models import Election, Role, ElectionList, Candidature
|
|
|
|
|
|
@admin.register(Election)
|
|
class ElectionAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"title",
|
|
"is_candidature_active",
|
|
"is_vote_active",
|
|
"is_vote_finished",
|
|
"archived",
|
|
)
|
|
form = make_ajax_form(Election, {"voters": "users"})
|
|
|
|
|
|
@admin.register(Role)
|
|
class RoleAdmin(admin.ModelAdmin):
|
|
list_display = ("election", "title", "max_choice")
|
|
search_fields = ("election__title", "title")
|
|
|
|
|
|
@admin.register(ElectionList)
|
|
class ElectionListAdmin(admin.ModelAdmin):
|
|
list_display = ("election", "title")
|
|
search_fields = ("election__title", "title")
|
|
|
|
|
|
@admin.register(Candidature)
|
|
class CandidatureAdmin(admin.ModelAdmin):
|
|
list_display = ("user", "role", "election_list")
|
|
form = make_ajax_form(Candidature, {"user": "users"})
|
|
|
|
|
|
# Votes must stay fully anonymous, so no ModelAdmin for Vote model
|