Skip to content

Commit

Permalink
feat: allow guides to select gender preferences for participants (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardaker authored Oct 14, 2024
1 parent a9373f2 commit 829ed6f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
31 changes: 31 additions & 0 deletions guides/migrations/0021_guide_gender_pref.py
Original file line number Diff line number Diff line change
@@ -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",
),
),
]
8 changes: 8 additions & 0 deletions guides/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions guides/templates/guides/guide_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
{% endif %}
</div>
<div>Gender: {{ guide.gender }}</div>
<div>Participant gender:
{% if guide.gender_pref != "NoPref" %}
<span class="badge badge-pill badge-warning">
{% endif %}
{{ guide.gender_pref }}
{% if guide.gender_pref != "NoPref" %}
</span>
{% endif %}
</div>
<div>Is Remote: {{ guide.remote }}</div>
<div>Guide Remotes: {{ guide.accept_remote }}</div>
<div>Other: {{ guide.additional_info }}</div>
Expand Down

0 comments on commit 829ed6f

Please sign in to comment.