diff --git a/AKScheduling/forms.py b/AKScheduling/forms.py index d1739eba90c8c3b2c1af2b24c0284de4c0672d62..00a9b5bc04aa62f1acd7ecd8477a84adcd49402f 100644 --- a/AKScheduling/forms.py +++ b/AKScheduling/forms.py @@ -1,4 +1,5 @@ from django import forms +from django.utils.translation import gettext_lazy as _ from AKModel.models import AK @@ -11,3 +12,17 @@ class AKInterestForm(forms.ModelForm): fields = ['interest', 'notes', ] + + +class AKAddSlotForm(forms.Form): + """ + Form to create a new slot for an existing AK directly from scheduling view + """ + start = forms.CharField(label=_("Start"), disabled=True) + end = forms.CharField(label=_("End"), disabled=True) + duration = forms.CharField(label=_("Duration"), disabled=True) + room = forms.IntegerField(label=_("Room"), disabled=True) + + def __init__(self, event): + super().__init__() + self.fields['ak'] = forms.ModelChoiceField(event.ak_set.all(), label=_("AK")) diff --git a/AKScheduling/views.py b/AKScheduling/views.py index 7174287f22a37ad499fc602ec3e83c5ec687479f..2c8f275f3d262060cd511cc29dfa071f3ee1551d 100644 --- a/AKScheduling/views.py +++ b/AKScheduling/views.py @@ -7,8 +7,7 @@ from django.views.generic import ListView, DetailView, UpdateView from AKModel.models import AKSlot, AKTrack, Event, AK, AKCategory from AKModel.metaviews.admin import EventSlugMixin, FilterByEventSlugMixin, AdminViewMixin, IntermediateAdminView -from AKScheduling.forms import AKInterestForm -from AKSubmission.forms import AKAddSlotForm +from AKScheduling.forms import AKInterestForm, AKAddSlotForm class UnscheduledSlotsAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView): diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 3f324bd41e6e70c0707e557a43f026843a7ac3af..96e0419df12c54be457544d5448a8eea702c8e68 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -164,14 +164,3 @@ class AKOrgaMessageForm(forms.ModelForm): 'event': forms.HiddenInput, 'text': forms.Textarea, } - - -class AKAddSlotForm(forms.Form): - start = forms.CharField(label=_("Start"), disabled=True) - end = forms.CharField(label=_("End"), disabled=True) - duration = forms.CharField(label=_("Duration"), disabled=True) - room = forms.IntegerField(label=_("Room"), disabled=True) - - def __init__(self, event): - super().__init__() - self.fields['ak'] = forms.ModelChoiceField(event.ak_set.all(), label=_("AK"))