diff --git a/patchwork/forms.py b/patchwork/forms.py index e7d1ad27..43d21c09 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -102,8 +102,9 @@ class EmailForm(forms.Form): class UserProfileForm(forms.ModelForm): class Meta: model = UserProfile - fields = ['items_per_page', 'show_ids'] - labels = {'show_ids': 'Show Patch IDs:'} + fields = ['items_per_page', 'show_ids', 'mid_scheme'] + labels = {'show_ids': 'Show Patch IDs:', + 'mid_scheme': 'Message URL scheme'} def _get_delegate_qs(project, instance=None): diff --git a/patchwork/migrations/0047_userprofile_mid_scheme.py b/patchwork/migrations/0047_userprofile_mid_scheme.py new file mode 100644 index 00000000..47168a5f --- /dev/null +++ b/patchwork/migrations/0047_userprofile_mid_scheme.py @@ -0,0 +1,22 @@ +# Generated by Django 4.2.7 on 2024-01-11 04:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('patchwork', '0046_patch_comment_events'), + ] + + operations = [ + migrations.AddField( + model_name='userprofile', + name='mid_scheme', + field=models.CharField( + blank=True, + help_text='URL scheme to use when opening message IDs', + max_length=255, + ), + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index 67408b00..a4ab4490 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -173,6 +173,7 @@ class UserProfile(models.Model): default=False, help_text='Show click-to-copy patch IDs in the list view', ) + mid_scheme = models.CharField(max_length=255, blank=True, help_text="URL scheme to use when opening message IDs") @property def name(self): diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index 85e7be4b..b23d6c2c 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -29,6 +29,9 @@

{{ submission.name }}

(mailing list archive) {% endif %} + {% if user.is_authenticated and user.profile.mid_scheme %} + + {% endif %} {% if submission.state %}