diff --git a/events/forms.py b/events/forms.py index 52bb0d2..9fb7def 100644 --- a/events/forms.py +++ b/events/forms.py @@ -265,6 +265,10 @@ class EventInviteMemberForm(forms.Form): class EventInviteEmailForm(forms.Form): emails = MultiEmailField(label=_(""), widget=forms.widgets.Textarea) +class EventContactForm(forms.Form): + to = forms.ChoiceField(label=_("")) + body = forms.CharField(label=_(""), widget=forms.widgets.Textarea) + class EventSeriesForm(forms.ModelForm): class Meta: model = EventSeries diff --git a/events/migrations/0030_add_attendee_actual_status.py b/events/migrations/0030_add_attendee_actual_status.py new file mode 100644 index 0000000..1793bf9 --- /dev/null +++ b/events/migrations/0030_add_attendee_actual_status.py @@ -0,0 +1,23 @@ +# Generated by Django 2.0 on 2018-05-17 00:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0029_add_team_premium_fields'), + ] + + operations = [ + migrations.AddField( + model_name='attendee', + name='actual', + field=models.SmallIntegerField(choices=[(-1, 'No'), (0, 'Maybe'), (1, 'Yes')], db_index=True, default=0, verbose_name='Attended'), + ), + migrations.AlterField( + model_name='attendee', + name='status', + field=models.SmallIntegerField(choices=[(-1, 'No'), (0, 'Maybe'), (1, 'Yes')], db_index=True, default=1, verbose_name='Attending'), + ), + ] diff --git a/events/models/events.py b/events/models/events.py index 2115cea..3f2ff13 100644 --- a/events/models/events.py +++ b/events/models/events.py @@ -77,6 +77,10 @@ class Event(models.Model): attendees = models.ManyToManyField(UserProfile, through='Attendee', related_name="attending", blank=True) + @property + def is_over(self): + return self.end_time <= timezone.now() + @property def tz(self): if self.place is not None: @@ -210,7 +214,8 @@ class Attendee(models.Model): event = models.ForeignKey(Event, on_delete=models.CASCADE) user = models.ForeignKey(UserProfile, on_delete=models.CASCADE) role = models.SmallIntegerField(_("Role"), choices=ROLES, default=NORMAL, db_index=True) - status = models.SmallIntegerField(_("Attending?"), choices=STATUSES, default=YES, db_index=True) + status = models.SmallIntegerField(_("Attending"), choices=STATUSES, default=YES, db_index=True) + actual = models.SmallIntegerField(_("Attended"), choices=STATUSES, default=MAYBE, db_index=True) joined_date = models.DateTimeField(default=timezone.now) last_reminded = models.DateTimeField(null=True, blank=True) @@ -222,6 +227,10 @@ class Attendee(models.Model): def status_name(self): return Attendee.STATUSES[self.status+1][1] + @property + def actual_name(self): + return Attendee.STATUSES[self.actual+1][1] + def __str__(self): return "%s at %s" % (self.user, self.event) diff --git a/get_together/templates/get_together/emails/attendee_contact.html b/get_together/templates/get_together/emails/attendee_contact.html new file mode 100644 index 0000000..d74e7ea --- /dev/null +++ b/get_together/templates/get_together/emails/attendee_contact.html @@ -0,0 +1,13 @@ +{% extends "get_together/emails/base.html" %} + +{% block content %} +
Sender: {{ sender|striptags }}
{{body|striptags}}
+ +