-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make birthdate optional and less precise
or fuzzy, as it were - Reduces friction when signing up - Reduces amount of personal information stored by default - Keeps exact birthdate private in case people don’t realize that displaying their age is equivalent to displaying their birthdate, as long as the transition is recorded We still prevent users from displaying an age that’s inconsistent with anything they’ve done with ratings, and from changing their age once set. TODO: `asserted_adult` should be filled in for existing users just in case their birthdate is removed by site staff.
- Loading branch information
1 parent
b99a63c
commit 3f3131b
Showing
27 changed files
with
290 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// `invalid-use-title` indicates that an element’s title is a good custom error message for when it doesn’t pass HTML form validation. | ||
for (const element of document.getElementsByClassName('invalid-use-title')) { | ||
const message = element.title; | ||
element.title = ''; | ||
|
||
const updateCustomValidity = () => { | ||
element.setCustomValidity(''); | ||
|
||
if (!element.checkValidity()) { | ||
element.setCustomValidity(message); | ||
} | ||
}; | ||
|
||
element.addEventListener('change', updateCustomValidity); | ||
updateCustomValidity(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$content-color-lighter: #777; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,30 @@ | ||
.form-date-day, .form-date-year { | ||
width: 25%; | ||
float: left; | ||
@import '../theme'; | ||
|
||
.form-date { | ||
display: flex; | ||
gap: 4px; | ||
} | ||
|
||
.form-date > * { | ||
// `!important`s here override terrible global `label` style that needs refactoring | ||
display: flex !important; | ||
flex-direction: column; | ||
padding: 0 !important; | ||
} | ||
|
||
.form-date > * > .sublabel { | ||
color: $content-color-lighter; | ||
padding-top: 0.35em; | ||
font-size: 12px; | ||
font-size: 0.75rem; | ||
font-weight: 400; | ||
} | ||
|
||
.form-date-month { | ||
width: 46%; | ||
float: left; | ||
padding: 0 2%; | ||
flex: 1; | ||
max-width: 12em; | ||
} | ||
|
||
.form-date > .form-date-year > input { | ||
width: 6em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@import 'components/date-picker'; | ||
@import 'components/password-meter'; | ||
|
||
#signup-terms { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
libweasyl/alembic/versions/57171ee9e989_make_birthdate_optional.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""Make birthdate optional | ||
Revision ID: 57171ee9e989 | ||
Revises: 9a41d4fa38ba | ||
Create Date: 2023-12-22 00:15:53.754117 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '57171ee9e989' | ||
down_revision = '9a41d4fa38ba' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.alter_column('logincreate', 'birthday', | ||
existing_type=sa.INTEGER(), | ||
nullable=True) | ||
op.add_column('userinfo', sa.Column('asserted_adult', sa.Boolean(), server_default='f', nullable=False)) | ||
op.alter_column('userinfo', 'birthday', | ||
existing_type=sa.INTEGER(), | ||
nullable=True) | ||
|
||
|
||
def downgrade(): | ||
op.alter_column('userinfo', 'birthday', | ||
existing_type=sa.INTEGER(), | ||
nullable=False) | ||
op.drop_column('userinfo', 'asserted_adult') | ||
op.alter_column('logincreate', 'birthday', | ||
existing_type=sa.INTEGER(), | ||
nullable=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.