From 1136ae57a49fd1ec8146f73fe7266465d2449fa4 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 12 Dec 2019 20:43:23 -0400 Subject: [PATCH] Increase some file sizes - Add or improve field help texts. Signed-off-by: Roberto Rosario --- HISTORY.rst | 5 +++ mayan/apps/document_parsing/views.py | 4 +-- mayan/apps/document_states/forms.py | 5 ++- .../migrations/0017_auto_20191213_0044.py | 35 +++++++++++++++++++ mayan/apps/document_states/models.py | 13 +++++-- .../migrations/0010_auto_20191213_0044.py | 20 +++++++++++ mayan/apps/linking/models.py | 3 +- mayan/apps/mailer/forms.py | 6 ++-- .../migrations/0006_auto_20191213_0044.py | 24 +++++++++++++ mayan/apps/mailer/models.py | 5 +-- .../migrations/0004_auto_20191213_0044.py | 20 +++++++++++ mayan/apps/permissions/models.py | 3 +- mayan/apps/permissions/views.py | 3 ++ .../migrations/0023_auto_20191213_0044.py | 31 ++++++++++++++++ mayan/apps/sources/models/base.py | 3 +- mayan/apps/sources/models/email_sources.py | 10 +++--- 16 files changed, 173 insertions(+), 17 deletions(-) create mode 100644 mayan/apps/document_states/migrations/0017_auto_20191213_0044.py create mode 100644 mayan/apps/linking/migrations/0010_auto_20191213_0044.py create mode 100644 mayan/apps/mailer/migrations/0006_auto_20191213_0044.py create mode 100644 mayan/apps/permissions/migrations/0004_auto_20191213_0044.py create mode 100644 mayan/apps/sources/migrations/0023_auto_20191213_0044.py diff --git a/HISTORY.rst b/HISTORY.rst index 81272c0ffd..19456f2e6b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,11 @@ Python 2 and Python 3. - Remove Django DownloadView library. Implement downloads natively using modified port of Django 2.2 FileResponse. +- Increase the role label field size from 64 to 128 characters. +- Increase the smart link label size from 96 to 128 characters. +- Increase the source label field size from 64 to 128 characters. +- Add missing link icons. +- Add missing field help texts. 3.3.4 (2019-12-09) ================== diff --git a/mayan/apps/document_parsing/views.py b/mayan/apps/document_parsing/views.py index 47446e6df3..4c90ad369f 100644 --- a/mayan/apps/document_parsing/views.py +++ b/mayan/apps/document_parsing/views.py @@ -139,7 +139,7 @@ class DocumentSubmitView(MultipleObjectConfirmActionView): result = { 'title': ungettext( singular='Submit %(count)d document to the parsing queue?', - plural='Submit %(count)d documents to the parsing queue', + plural='Submit %(count)d documents to the parsing queue?', number=queryset.count() ) % { 'count': queryset.count(), @@ -186,7 +186,7 @@ class DocumentTypeSettingsEditView(ExternalObjectMixin, SingleObjectEditView): class DocumentTypeSubmitView(FormView): extra_context = { - 'title': _('Submit all documents of a type for parsing.') + 'title': _('Submit all documents of a type for parsing') } form_class = DocumentTypeFilteredSelectForm post_action_redirect = reverse_lazy(viewname='common:tools_list') diff --git a/mayan/apps/document_states/forms.py b/mayan/apps/document_states/forms.py index e2320e2b46..a43ac43119 100644 --- a/mayan/apps/document_states/forms.py +++ b/mayan/apps/document_states/forms.py @@ -19,7 +19,10 @@ from .models import ( class WorkflowActionSelectionForm(forms.Form): - klass = forms.ChoiceField(choices=(), label=_('Action')) + klass = forms.ChoiceField( + choices=(), help_text=_('The action type for this action entry.'), + label=_('Action') + ) def __init__(self, *args, **kwargs): super(WorkflowActionSelectionForm, self).__init__(*args, **kwargs) diff --git a/mayan/apps/document_states/migrations/0017_auto_20191213_0044.py b/mayan/apps/document_states/migrations/0017_auto_20191213_0044.py new file mode 100644 index 0000000000..b7ea78e336 --- /dev/null +++ b/mayan/apps/document_states/migrations/0017_auto_20191213_0044.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2019-12-13 00:44 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('document_states', '0016_auto_20191108_2332'), + ] + + operations = [ + migrations.AlterField( + model_name='workflow', + name='label', + field=models.CharField(help_text='A short text to describe the workflow.', max_length=255, unique=True, verbose_name='Label'), + ), + migrations.AlterField( + model_name='workflowstate', + name='label', + field=models.CharField(help_text='A short text to describe the workflow state.', max_length=255, verbose_name='Label'), + ), + migrations.AlterField( + model_name='workflowstateaction', + name='label', + field=models.CharField(help_text='A short text describing the action.', max_length=255, verbose_name='Label'), + ), + migrations.AlterField( + model_name='workflowtransition', + name='label', + field=models.CharField(help_text='A short text to describe the transition.', max_length=255, verbose_name='Label'), + ), + ] diff --git a/mayan/apps/document_states/models.py b/mayan/apps/document_states/models.py index 83e546e28c..1dbc7ee99f 100644 --- a/mayan/apps/document_states/models.py +++ b/mayan/apps/document_states/models.py @@ -55,6 +55,7 @@ class Workflow(models.Model): verbose_name=_('Internal name') ) label = models.CharField( + help_text=_('A short text to describe the workflow.'), max_length=255, unique=True, verbose_name=_('Label') ) document_types = models.ManyToManyField( @@ -268,7 +269,10 @@ class WorkflowState(models.Model): on_delete=models.CASCADE, related_name='states', to=Workflow, verbose_name=_('Workflow') ) - label = models.CharField(max_length=255, verbose_name=_('Label')) + label = models.CharField( + help_text=_('A short text to describe the workflow state.'), + max_length=255, verbose_name=_('Label') + ) initial = models.BooleanField( default=False, help_text=_( @@ -348,7 +352,7 @@ class WorkflowStateAction(models.Model): verbose_name=_('Workflow state') ) label = models.CharField( - max_length=255, help_text=_('A simple identifier for this action.'), + max_length=255, help_text=_('A short text describing the action.'), verbose_name=_('Label') ) enabled = models.BooleanField(default=True, verbose_name=_('Enabled')) @@ -415,7 +419,10 @@ class WorkflowTransition(models.Model): on_delete=models.CASCADE, related_name='transitions', to=Workflow, verbose_name=_('Workflow') ) - label = models.CharField(max_length=255, verbose_name=_('Label')) + label = models.CharField( + help_text=_('A short text to describe the transition.'), + max_length=255, verbose_name=_('Label') + ) origin_state = models.ForeignKey( on_delete=models.CASCADE, related_name='origin_transitions', to=WorkflowState, verbose_name=_('Origin state') diff --git a/mayan/apps/linking/migrations/0010_auto_20191213_0044.py b/mayan/apps/linking/migrations/0010_auto_20191213_0044.py new file mode 100644 index 0000000000..9cd6b0421c --- /dev/null +++ b/mayan/apps/linking/migrations/0010_auto_20191213_0044.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2019-12-13 00:44 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('linking', '0009_auto_20191211_0233'), + ] + + operations = [ + migrations.AlterField( + model_name='smartlink', + name='label', + field=models.CharField(db_index=True, help_text='A short text describing the smart link.', max_length=128, verbose_name='Label'), + ), + ] diff --git a/mayan/apps/linking/models.py b/mayan/apps/linking/models.py index 5067a89c68..23505b7dc4 100644 --- a/mayan/apps/linking/models.py +++ b/mayan/apps/linking/models.py @@ -24,7 +24,8 @@ class SmartLink(models.Model): Django's database filter operations. """ label = models.CharField( - db_index=True, max_length=96, verbose_name=_('Label') + db_index=True, help_text=_('A short text describing the smart link.'), + max_length=128, verbose_name=_('Label') ) dynamic_label = models.CharField( blank=True, max_length=96, help_text=_( diff --git a/mayan/apps/mailer/forms.py b/mayan/apps/mailer/forms.py index 4373b2a3ab..ed9fde0381 100644 --- a/mayan/apps/mailer/forms.py +++ b/mayan/apps/mailer/forms.py @@ -73,11 +73,13 @@ class DocumentMailForm(forms.Form): class UserMailerBackendSelectionForm(forms.Form): - backend = forms.ChoiceField(choices=(), label=_('Backend')) + backend = forms.ChoiceField( + choices=(), help_text=_('The driver to use when sending emails.'), + label=_('Backend') + ) def __init__(self, *args, **kwargs): super(UserMailerBackendSelectionForm, self).__init__(*args, **kwargs) - self.fields['backend'].choices = [ ( key, backend.label diff --git a/mayan/apps/mailer/migrations/0006_auto_20191213_0044.py b/mayan/apps/mailer/migrations/0006_auto_20191213_0044.py new file mode 100644 index 0000000000..b5eadf4935 --- /dev/null +++ b/mayan/apps/mailer/migrations/0006_auto_20191213_0044.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2019-12-13 00:44 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mailer', '0005_auto_20170718_0123'), + ] + + operations = [ + migrations.AlterModelOptions( + name='usermailer', + options={'ordering': ('label',), 'verbose_name': 'Mailing profile', 'verbose_name_plural': 'Mailing profiles'}, + ), + migrations.AlterField( + model_name='usermailer', + name='label', + field=models.CharField(help_text='A short text describing the mailing profile.', max_length=128, unique=True, verbose_name='Label'), + ), + ] diff --git a/mayan/apps/mailer/models.py b/mayan/apps/mailer/models.py index c9d19dd183..669eaa4ab1 100644 --- a/mayan/apps/mailer/models.py +++ b/mayan/apps/mailer/models.py @@ -45,6 +45,7 @@ class UserMailer(models.Model): their use. """ label = models.CharField( + help_text=_('A short text describing the mailing profile.'), max_length=128, unique=True, verbose_name=_('Label') ) default = models.BooleanField( @@ -67,8 +68,8 @@ class UserMailer(models.Model): class Meta: ordering = ('label',) - verbose_name = _('User mailer') - verbose_name_plural = _('User mailers') + verbose_name = _('Mailing profile') + verbose_name_plural = _('Mailing profiles') def __str__(self): return self.label diff --git a/mayan/apps/permissions/migrations/0004_auto_20191213_0044.py b/mayan/apps/permissions/migrations/0004_auto_20191213_0044.py new file mode 100644 index 0000000000..3e9d351cb3 --- /dev/null +++ b/mayan/apps/permissions/migrations/0004_auto_20191213_0044.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2019-12-13 00:44 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('permissions', '0003_remove_role_name'), + ] + + operations = [ + migrations.AlterField( + model_name='role', + name='label', + field=models.CharField(help_text='A short text describing the role.', max_length=128, unique=True, verbose_name='Label'), + ), + ] diff --git a/mayan/apps/permissions/models.py b/mayan/apps/permissions/models.py index ff7498a75a..5566dda1bc 100644 --- a/mayan/apps/permissions/models.py +++ b/mayan/apps/permissions/models.py @@ -98,7 +98,8 @@ class Role(models.Model): to a group using a role, are granted for the entire system. """ label = models.CharField( - max_length=64, unique=True, verbose_name=_('Label') + help_text=_('A short text describing the role.'), max_length=128, + unique=True, verbose_name=_('Label') ) permissions = models.ManyToManyField( related_name='roles', to=StoredPermission, diff --git a/mayan/apps/permissions/views.py b/mayan/apps/permissions/views.py index 49d28dd3a0..7dac502208 100644 --- a/mayan/apps/permissions/views.py +++ b/mayan/apps/permissions/views.py @@ -49,6 +49,9 @@ class RoleCreateView(SingleObjectCreateView): view_permission = permission_role_create post_action_redirect = reverse_lazy(viewname='permissions:role_list') + def get_extra_context(self): + return {'title': _('Create new role')} + def get_save_extra_data(self): return {'_user': self.request.user} diff --git a/mayan/apps/sources/migrations/0023_auto_20191213_0044.py b/mayan/apps/sources/migrations/0023_auto_20191213_0044.py new file mode 100644 index 0000000000..07222f851b --- /dev/null +++ b/mayan/apps/sources/migrations/0023_auto_20191213_0044.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2019-12-13 00:44 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('sources', '0022_auto_20191022_0737'), + ] + + operations = [ + migrations.AlterField( + model_name='emailbasemodel', + name='from_metadata_type', + field=models.ForeignKey(blank=True, help_text='Select a metadata type to store the email\'s "from" value. Must be a valid metadata type for the document type selected previously.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='email_from', to='metadata.MetadataType', verbose_name='From metadata type'), + ), + migrations.AlterField( + model_name='emailbasemodel', + name='subject_metadata_type', + field=models.ForeignKey(blank=True, help_text="Select a metadata type to store the email's subject value. Must be a valid metadata type for the document type selected previously.", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='email_subject', to='metadata.MetadataType', verbose_name='Subject metadata type'), + ), + migrations.AlterField( + model_name='source', + name='label', + field=models.CharField(db_index=True, help_text='A short text to describe this source.', max_length=128, unique=True, verbose_name='Label'), + ), + ] diff --git a/mayan/apps/sources/models/base.py b/mayan/apps/sources/models/base.py index 18d5611f8c..855d5f9c42 100644 --- a/mayan/apps/sources/models/base.py +++ b/mayan/apps/sources/models/base.py @@ -27,7 +27,8 @@ logger = logging.getLogger(__name__) @python_2_unicode_compatible class Source(models.Model): label = models.CharField( - db_index=True, max_length=64, unique=True, verbose_name=_('Label') + db_index=True, help_text=_('A short text to describe this source.'), + max_length=128, unique=True, verbose_name=_('Label') ) enabled = models.BooleanField(default=True, verbose_name=_('Enabled')) diff --git a/mayan/apps/sources/models/email_sources.py b/mayan/apps/sources/models/email_sources.py index 429da5a042..3e426903d0 100644 --- a/mayan/apps/sources/models/email_sources.py +++ b/mayan/apps/sources/models/email_sources.py @@ -57,15 +57,17 @@ class EmailBaseModel(IntervalBaseModel): ) subject_metadata_type = models.ForeignKey( blank=True, help_text=_( - 'Select a metadata type valid for the document type selected in ' - 'which to store the email\'s subject.' + 'Select a metadata type to store the email\'s subject value. ' + 'Must be a valid metadata type for the document type selected ' + 'previously.' ), on_delete=models.CASCADE, null=True, related_name='email_subject', to=MetadataType, verbose_name=_('Subject metadata type') ) from_metadata_type = models.ForeignKey( blank=True, help_text=_( - 'Select a metadata type valid for the document type selected in ' - 'which to store the email\'s "from" value.' + 'Select a metadata type to store the email\'s "from" value. ' + 'Must be a valid metadata type for the document type selected ' + 'previously.' ), on_delete=models.CASCADE, null=True, related_name='email_from', to=MetadataType, verbose_name=_('From metadata type') )