From 829ed6f5a909a56250564eb8e66f7f502d37d0eb Mon Sep 17 00:00:00 2001 From: Wes Hardaker Date: Mon, 14 Oct 2024 14:27:07 -0700 Subject: [PATCH] feat: allow guides to select gender preferences for participants (#77) --- guides/migrations/0021_guide_gender_pref.py | 31 +++++++++++++++++++++ guides/models.py | 8 ++++++ guides/templates/guides/guide_card.html | 9 ++++++ 3 files changed, 48 insertions(+) create mode 100644 guides/migrations/0021_guide_gender_pref.py diff --git a/guides/migrations/0021_guide_gender_pref.py b/guides/migrations/0021_guide_gender_pref.py new file mode 100644 index 0000000..7ab310e --- /dev/null +++ b/guides/migrations/0021_guide_gender_pref.py @@ -0,0 +1,31 @@ +# Generated by Django 5.1.2 on 2024-10-14 18:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("guides", "0020_guide_admin_notes_participant_admin_notes"), + ] + + operations = [ + migrations.AddField( + model_name="guide", + name="gender_pref", + field=models.CharField( + choices=[ + ("NoPref", "I don't have a preference"), + ("Male", "I would prefer to work with a male participant"), + ("Female", "I would prefer to work with a female participant"), + ( + "Non-Binary", + "I would prefer to work with a non-binary participant", + ), + ], + default="NoPref", + max_length=32, + verbose_name="Participant gender preference", + ), + ), + ] diff --git a/guides/models.py b/guides/models.py index 495a375..2e517c6 100644 --- a/guides/models.py +++ b/guides/models.py @@ -28,6 +28,13 @@ (GEND_FEMALE, "I would prefer to work with a female guide"), ) +PARTICIPANT_GEND_CHOICES = ( + (GEND_NOPREF, "I don't have a preference"), + (GEND_MALE, "I would prefer to work with a male participant"), + (GEND_FEMALE, "I would prefer to work with a female participant"), + (GEND_NONBINARY, "I would prefer to work with a non-binary participant") +) + GEND_TYPE_FEMALE = "Female" GEND_TYPE_MALE = "Male" GEND_TYPE_NONBINARY = "Non-Binary" @@ -151,6 +158,7 @@ class Guide(models.Model): groups = models.CharField('Which working groups are you most able to help people with?', max_length=256, default="", blank=True) remote = models.CharField('Will you be attending remotely?', max_length=32, choices=YN_CHOICES, default=YNM_NO) accept_remote = models.CharField('Are you willing to guide remote participants?',max_length=32, choices=YNM_CHOICES, default=YNM_YES) + gender_pref = models.CharField('Participant gender preference', max_length=32, choices=PARTICIPANT_GEND_CHOICES, default=GEND_NOPREF) additional_info = models.TextField('Is there anything else we should know?', blank=True) help_frequency = models.CharField("How frequently are you willing to be a guide?", max_length=32, choices=HELP_CHOICES, default=HELP_NO) diff --git a/guides/templates/guides/guide_card.html b/guides/templates/guides/guide_card.html index 5beb653..b0b7b6d 100644 --- a/guides/templates/guides/guide_card.html +++ b/guides/templates/guides/guide_card.html @@ -62,6 +62,15 @@ {% endif %}
Gender: {{ guide.gender }}
+
Participant gender: + {% if guide.gender_pref != "NoPref" %} + + {% endif %} + {{ guide.gender_pref }} + {% if guide.gender_pref != "NoPref" %} + + {% endif %} +
Is Remote: {{ guide.remote }}
Guide Remotes: {{ guide.accept_remote }}
Other: {{ guide.additional_info }}