diff --git a/hackathon/forms.py b/hackathon/forms.py index 0108ad90..96c54b43 100644 --- a/hackathon/forms.py +++ b/hackathon/forms.py @@ -88,10 +88,21 @@ class HackathonForm(forms.ModelForm): }) ) is_public = forms.BooleanField(required=False) + allow_external_registrations = forms.BooleanField(required=False, label="Allow external registrations") + registration_form = forms.URLField( + label="External Registration Form", + required=False, + widget=forms.TextInput( + attrs={ + 'placeholder': 'Add form url if the event is open to external participants', + 'type':'url', + } + ) + ) max_participants = forms.IntegerField( - label="Max Number Of Participants (leave empty for no max)", + label="Max Participants", required=False, - widget=forms.TextInput({'type': 'number'}) + widget=forms.TextInput({'type': 'number', 'placeholder': 'Leave empty for no max'}) ) class Meta: @@ -99,6 +110,7 @@ class Meta: fields = ['display_name', 'description', 'theme', 'start_date', 'end_date', 'status', 'organisation', 'score_categories', 'team_size', 'tag_line', 'is_public', 'max_participants', + 'allow_external_registrations', 'registration_form' ] def __init__(self, *args, **kwargs): diff --git a/hackathon/migrations/0049_hackathon_is_register.py b/hackathon/migrations/0049_hackathon_is_register.py new file mode 100644 index 00000000..030e2fdb --- /dev/null +++ b/hackathon/migrations/0049_hackathon_is_register.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2024-09-11 08:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0048_auto_20221219_1655'), + ] + + operations = [ + migrations.AddField( + model_name='hackathon', + name='is_register', + field=models.BooleanField(default=True), + ), + ] diff --git a/hackathon/migrations/0050_hackathon_google_registrations_form.py b/hackathon/migrations/0050_hackathon_google_registrations_form.py new file mode 100644 index 00000000..ce6c7d1a --- /dev/null +++ b/hackathon/migrations/0050_hackathon_google_registrations_form.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2024-09-11 11:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0049_hackathon_is_register'), + ] + + operations = [ + migrations.AddField( + model_name='hackathon', + name='google_registrations_form', + field=models.URLField(blank=True, default='', help_text='Link to the Google Form for registrations.'), + ), + ] diff --git a/hackathon/migrations/0051_auto_20240911_1306.py b/hackathon/migrations/0051_auto_20240911_1306.py new file mode 100644 index 00000000..3387fc24 --- /dev/null +++ b/hackathon/migrations/0051_auto_20240911_1306.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2024-09-11 13:06 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0050_hackathon_google_registrations_form'), + ] + + operations = [ + migrations.RenameField( + model_name='hackathon', + old_name='google_registrations_form', + new_name='google_registration_form', + ), + ] diff --git a/hackathon/migrations/0052_auto_20240912_1324.py b/hackathon/migrations/0052_auto_20240912_1324.py new file mode 100644 index 00000000..221661a3 --- /dev/null +++ b/hackathon/migrations/0052_auto_20240912_1324.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2024-09-12 13:24 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0051_auto_20240911_1306'), + ] + + operations = [ + migrations.RenameField( + model_name='hackathon', + old_name='google_registration_form', + new_name='registration_form', + ), + ] diff --git a/hackathon/migrations/0053_auto_20240912_1527.py b/hackathon/migrations/0053_auto_20240912_1527.py new file mode 100644 index 00000000..c6b74a02 --- /dev/null +++ b/hackathon/migrations/0053_auto_20240912_1527.py @@ -0,0 +1,22 @@ +# Generated by Django 3.1.13 on 2024-09-12 15:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('hackathon', '0052_auto_20240912_1324'), + ] + + operations = [ + migrations.RemoveField( + model_name='hackathon', + name='is_register', + ), + migrations.AddField( + model_name='hackathon', + name='allow_external_registrations', + field=models.BooleanField(default=False), + ), + ] diff --git a/hackathon/models.py b/hackathon/models.py index 6e190dd7..66207b36 100644 --- a/hackathon/models.py +++ b/hackathon/models.py @@ -80,6 +80,12 @@ class Hackathon(models.Model): ) is_public = models.BooleanField(default=True) max_participants = models.IntegerField(default=None, null=True, blank=True) + allow_external_registrations = models.BooleanField(default=False) + registration_form = models.URLField( + default="", + blank=True, + help_text=("Link to the Google Form for registrations.") + ) def __str__(self): return self.display_name diff --git a/hackathon/templates/hackathon/create-event.html b/hackathon/templates/hackathon/create-event.html index 333dea60..f7196daf 100644 --- a/hackathon/templates/hackathon/create-event.html +++ b/hackathon/templates/hackathon/create-event.html @@ -55,14 +55,20 @@