diff --git a/elections/forms.py b/elections/forms.py index 1c7ad44..b25e0ab 100644 --- a/elections/forms.py +++ b/elections/forms.py @@ -42,6 +42,11 @@ class UploadVotersForm(forms.Form): return csv_file +class VoterMailForm(forms.Form): + objet = forms.CharField() + message = forms.CharField(widget=forms.Textarea) + + class QuestionForm(forms.ModelForm): class Meta: model = Question diff --git a/elections/migrations/0006_election_sent_mail.py b/elections/migrations/0006_election_sent_mail.py new file mode 100644 index 0000000..3556431 --- /dev/null +++ b/elections/migrations/0006_election_sent_mail.py @@ -0,0 +1,20 @@ +# Generated by Django 2.2.17 on 2020-12-23 19:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("elections", "0005_user_full_name"), + ] + + operations = [ + migrations.AddField( + model_name="election", + name="sent_mail", + field=models.BooleanField( + default=False, verbose_name="mail avec les identifiants envoyé" + ), + ), + ] diff --git a/elections/models.py b/elections/models.py index 6e714ab..0bdaf03 100644 --- a/elections/models.py +++ b/elections/models.py @@ -20,6 +20,10 @@ class Election(models.Model): _("restreint le vote à une liste de personnes"), default=True ) + sent_mail = models.BooleanField( + _("mail avec les identifiants envoyé"), default=False + ) + created_by = models.ForeignKey( settings.AUTH_USER_MODEL, related_name="elections_created", diff --git a/elections/staticdefs.py b/elections/staticdefs.py new file mode 100644 index 0000000..c35708c --- /dev/null +++ b/elections/staticdefs.py @@ -0,0 +1,12 @@ +MAIL_VOTERS = ( + "Dear {full_name},\n" + "\n" + "\n" + "Election URL: {election_url}\n" + "\n" + "Your voter ID: {username}\n" + "Your password: {password}\n" + "\n" + "-- \n" + "Kadenios" +) diff --git a/elections/templates/elections/election_admin.html b/elections/templates/elections/election_admin.html index 27554fd..2449f06 100644 --- a/elections/templates/elections/election_admin.html +++ b/elections/templates/elections/election_admin.html @@ -40,7 +40,7 @@ - {% trans "Importer une liste de votant·e·s" %} + {% trans "Gestion de la liste de votant·e·s" %} {% endif %} diff --git a/elections/templates/elections/mail_voters.html b/elections/templates/elections/mail_voters.html new file mode 100644 index 0000000..4f8b477 --- /dev/null +++ b/elections/templates/elections/mail_voters.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} +{% load i18n %} + + +{% block content %} + +