+class DonationStep1(UpdateView):
+ queryset = models.Schedule.objects.filter(payed_at=None)
+ form_class = forms.DonationStep1Form
+ slug_field = slug_url_kwarg = 'key'
+ template_name = 'club/2022/donation_step1.html'
+ step = 1
+
+ def get_context_data(self, **kwargs):
+ c = super().get_context_data(**kwargs)
+ c['club'] = models.Club.objects.first()
+ return c
+
+ def get_success_url(self):
+ return reverse('donation_step2', args=[self.object.key])
+
+
+class DonationStep2(UpdateView):
+ queryset = models.Schedule.objects.filter(payed_at=None)
+ form_class = forms.DonationStep2Form
+ slug_field = slug_url_kwarg = 'key'
+ template_name = 'club/2022/donation_step2.html'
+ step = 2
+
+ def get_context_data(self, **kwargs):
+ c = super().get_context_data(**kwargs)
+ c['club'] = models.Club.objects.first()
+ return c
+
+
+class JoinView(CreateView):
+ @property
+ def club(self):
+ return models.Club.objects.first()
+
+ @property
+ def new_layout(self):
+ return self.request.EXPERIMENTS['layout'].value
+
+ def get_template_names(self):
+ if self.new_layout:
+ return 'club/2022/donation_step1.html'
+ return 'club/membership_form.html'
+
+ def get_form_class(self):
+ if self.new_layout:
+ return forms.DonationStep1Form
+ return ScheduleForm
+