From d046fb8c68dab3f20554afdef3c0affc3947e616 Mon Sep 17 00:00:00 2001
From: Andy Byers
Date: Fri, 13 Sep 2024 10:57:04 +0100
Subject: [PATCH 1/8] Reverts account and frozen author fields to charfields.
---
.../0096_alter_account_activation_code_and_more.py | 14 +++++++-------
src/core/models.py | 14 +++++++-------
.../0080_frozen_author_bleach_20240507_1350.py | 14 +++++++-------
src/submission/models.py | 14 +++++++-------
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/core/migrations/0096_alter_account_activation_code_and_more.py b/src/core/migrations/0096_alter_account_activation_code_and_more.py
index 424abfd9c..d8281c00f 100644
--- a/src/core/migrations/0096_alter_account_activation_code_and_more.py
+++ b/src/core/migrations/0096_alter_account_activation_code_and_more.py
@@ -19,32 +19,32 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='account',
name='department',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300, verbose_name='Department'),
+ field=models.CharField(blank=True, max_length=300, verbose_name='Department'),
),
migrations.AlterField(
model_name='account',
name='first_name',
- field=core.model_utils.JanewayBleachCharField(max_length=300, verbose_name='First name'),
+ field=models.CharField(max_length=300, verbose_name='First name'),
),
migrations.AlterField(
model_name='account',
name='institution',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=1000, verbose_name='Institution'),
+ field=models.CharField(blank=True, max_length=1000, verbose_name='Institution'),
),
migrations.AlterField(
model_name='account',
name='last_name',
- field=core.model_utils.JanewayBleachCharField(max_length=300, verbose_name='Last name'),
+ field=models.CharField(max_length=300, verbose_name='Last name'),
),
migrations.AlterField(
model_name='account',
name='middle_name',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300, verbose_name='Middle name'),
+ field=models.CharField(blank=True, max_length=300, verbose_name='Middle name'),
),
migrations.AlterField(
model_name='account',
name='salutation',
- field=core.model_utils.JanewayBleachCharField(blank=True, choices=[('Miss', 'Miss'), ('Ms', 'Ms'), ('Mrs', 'Mrs'), ('Mr', 'Mr'), ('Mx', 'Mx'), ('Dr', 'Dr'), ('Prof.', 'Prof.')], max_length=10, verbose_name='Salutation'),
+ field=models.CharField(blank=True, choices=[('Miss', 'Miss'), ('Ms', 'Ms'), ('Mrs', 'Mrs'), ('Mr', 'Mr'), ('Mx', 'Mx'), ('Dr', 'Dr'), ('Prof.', 'Prof.')], max_length=10, verbose_name='Salutation'),
),
migrations.AlterField(
model_name='account',
@@ -54,6 +54,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='account',
name='suffix',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300, verbose_name='Name suffix'),
+ field=models.CharField(blank=True, max_length=300, verbose_name='Name suffix'),
),
]
diff --git a/src/core/models.py b/src/core/models.py
index 9a3661a4b..c496d5dc9 100644
--- a/src/core/models.py
+++ b/src/core/models.py
@@ -235,30 +235,30 @@ class Account(AbstractBaseUser, PermissionsMixin):
username = models.CharField(max_length=254, unique=True, verbose_name=_('Username'))
name_prefix = models.CharField(max_length=10, blank=True)
- first_name = JanewayBleachCharField(
+ first_name = models.CharField(
max_length=300,
blank=False,
verbose_name=_('First name'),
)
- middle_name = JanewayBleachCharField(
+ middle_name = models.CharField(
max_length=300,
blank=True,
verbose_name=_('Middle name'),
)
- last_name = JanewayBleachCharField(
+ last_name = models.CharField(
max_length=300,
blank=False,
verbose_name=_('Last name'),
)
activation_code = models.CharField(max_length=100, null=True, blank=True)
- salutation = JanewayBleachCharField(
+ salutation = models.CharField(
max_length=10,
choices=SALUTATION_CHOICES,
blank=True,
verbose_name=_('Salutation'),
)
- suffix = JanewayBleachCharField(
+ suffix = models.CharField(
max_length=300,
blank=True,
verbose_name=_('Name suffix'),
@@ -268,12 +268,12 @@ class Account(AbstractBaseUser, PermissionsMixin):
verbose_name=_('Biography'),
)
orcid = models.CharField(max_length=40, null=True, blank=True, verbose_name=_('ORCiD'))
- institution = JanewayBleachCharField(
+ institution = models.CharField(
max_length=1000,
blank=True,
verbose_name=_('Institution'),
)
- department = JanewayBleachCharField(
+ department = models.CharField(
max_length=300,
blank=True,
verbose_name=_('Department'),
diff --git a/src/submission/migrations/0080_frozen_author_bleach_20240507_1350.py b/src/submission/migrations/0080_frozen_author_bleach_20240507_1350.py
index 2cc7ae683..114c9153d 100644
--- a/src/submission/migrations/0080_frozen_author_bleach_20240507_1350.py
+++ b/src/submission/migrations/0080_frozen_author_bleach_20240507_1350.py
@@ -15,12 +15,12 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='frozenauthor',
name='department',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300),
+ field=models.CharField(blank=True, max_length=300),
),
migrations.AlterField(
model_name='frozenauthor',
name='first_name',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300),
+ field=models.CharField(blank=True, max_length=300),
),
migrations.AlterField(
model_name='frozenauthor',
@@ -40,26 +40,26 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='frozenauthor',
name='institution',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=1000),
+ field=models.CharField(blank=True, max_length=1000),
),
migrations.AlterField(
model_name='frozenauthor',
name='last_name',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300),
+ field=models.CharField(blank=True, max_length=300),
),
migrations.AlterField(
model_name='frozenauthor',
name='middle_name',
- field=core.model_utils.JanewayBleachCharField(blank=True, max_length=300),
+ field=models.CharField(blank=True, max_length=300),
),
migrations.AlterField(
model_name='frozenauthor',
name='name_prefix',
- field=core.model_utils.JanewayBleachCharField(blank=True, help_text='Optional name prefix (e.g: Prof or Dr)', max_length=300),
+ field=models.CharField(blank=True, help_text='Optional name prefix (e.g: Prof or Dr)', max_length=300),
),
migrations.AlterField(
model_name='frozenauthor',
name='name_suffix',
- field=core.model_utils.JanewayBleachCharField(blank=True, help_text='Optional name suffix (e.g.: Jr or III)', max_length=300),
+ field=models.CharField(blank=True, help_text='Optional name suffix (e.g.: Jr or III)', max_length=300),
),
]
diff --git a/src/submission/models.py b/src/submission/models.py
index a9b6d80c9..3623f4d86 100755
--- a/src/submission/models.py
+++ b/src/submission/models.py
@@ -1911,23 +1911,23 @@ class FrozenAuthor(AbstractLastModifiedModel):
on_delete=models.SET_NULL,
)
- name_prefix = JanewayBleachCharField(
+ name_prefix = models.CharField(
max_length=300,
blank=True,
help_text=_("Optional name prefix (e.g: Prof or Dr)")
)
- name_suffix = JanewayBleachCharField(
+ name_suffix = models.CharField(
max_length=300,
blank=True,
help_text=_("Optional name suffix (e.g.: Jr or III)")
)
- first_name = JanewayBleachCharField(max_length=300, blank=True)
- middle_name = JanewayBleachCharField(max_length=300, blank=True)
- last_name = JanewayBleachCharField(max_length=300, blank=True)
+ first_name = models.CharField(max_length=300, blank=True)
+ middle_name = models.CharField(max_length=300, blank=True)
+ last_name = models.CharField(max_length=300, blank=True)
- institution = JanewayBleachCharField(max_length=1000, blank=True)
- department = JanewayBleachCharField(max_length=300, blank=True)
+ institution = models.CharField(max_length=1000, blank=True)
+ department = models.CharField(max_length=300, blank=True)
frozen_biography = JanewayBleachField(
blank=True,
verbose_name=_('Frozen Biography'),
From 642daadf27b5b8e5ae91c9e05d40209afa500e46 Mon Sep 17 00:00:00 2001
From: Andy Byers
Date: Fri, 13 Sep 2024 11:18:18 +0100
Subject: [PATCH 2/8] Adds a button_classes var to style ORCID reg btn
---
src/templates/common/elements/orcid_registration.html | 6 +++++-
src/themes/OLH/templates/core/accounts/register.html | 2 +-
src/themes/clean/templates/core/accounts/register.html | 2 +-
src/themes/material/templates/core/accounts/register.html | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/templates/common/elements/orcid_registration.html b/src/templates/common/elements/orcid_registration.html
index ee83a4b71..ee1357699 100644
--- a/src/templates/common/elements/orcid_registration.html
+++ b/src/templates/common/elements/orcid_registration.html
@@ -9,6 +9,10 @@
[remove]
{% else %}
- {% trans "Register with ORCiD" %}
+
+ {% trans "Register with ORCiD" %}
+
{% endif %}
{% endif %}
diff --git a/src/themes/OLH/templates/core/accounts/register.html b/src/themes/OLH/templates/core/accounts/register.html
index 5a3d372c4..3898ca57e 100644
--- a/src/themes/OLH/templates/core/accounts/register.html
+++ b/src/themes/OLH/templates/core/accounts/register.html
@@ -30,7 +30,7 @@ {% trans "Register for an account with" %} {{ request.press.name }}.
{% blocktrans %}For more information read our password guide.{% endblocktrans %}
- {% include "common/elements/orcid_registration.html" %}
+ {% include "common/elements/orcid_registration.html" with button_classes="button expanded orcid-button" %}
{% include "elements/forms/errors.html" with form=form %}
diff --git a/src/themes/clean/templates/core/accounts/register.html b/src/themes/clean/templates/core/accounts/register.html
index 2511eafdf..be56f96d8 100644
--- a/src/themes/clean/templates/core/accounts/register.html
+++ b/src/themes/clean/templates/core/accounts/register.html
@@ -20,7 +20,7 @@ {% trans "Register for an account with" %} {{ request.press.name }}.
{% include "common/elements/password_rules.html" %}
{% blocktrans %}For more information read our password guide.{% endblocktrans %}
- {% include "common/elements/orcid_registration.html" %}
+ {% include "common/elements/orcid_registration.html" with button_classes="btn orcid-button btn-block" %}
{% bootstrap_form form %}
diff --git a/src/themes/material/templates/core/accounts/register.html b/src/themes/material/templates/core/accounts/register.html
index 40c25933b..9599b9345 100644
--- a/src/themes/material/templates/core/accounts/register.html
+++ b/src/themes/material/templates/core/accounts/register.html
@@ -24,7 +24,7 @@
{% blocktrans trimmed %}For more information read our password guide.{% endblocktrans %}
- {% include "common/elements/orcid_registration.html" %}
+ {% include "common/elements/orcid_registration.html" with button_classes="btn wide-button orcid-button" %}