diff --git a/HISTORY.rst b/HISTORY.rst index 0a347ac5ce..49fbce8c1c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,7 +3,14 @@ - Metadat widget appearance changes - Content windows appearance changes - Add new document's version list view permission - + +2.2.1 (2017-05-25) +================== +- Allow for bigger indexing expression templates. +- Auto select checkbox when updating metadata values. GitLab issue #371. +- Added support for passing the options allow-other and allow-root to the + FUSE index mirror. GitLab issue #385 + 2.2 (2017-04-26) ================ - Remove the installation app (GitLab #301). diff --git a/docs/releases/2.2.1.rst b/docs/releases/2.2.1.rst new file mode 100644 index 0000000000..de50dcf4f1 --- /dev/null +++ b/docs/releases/2.2.1.rst @@ -0,0 +1,78 @@ +=============================== +Mayan EDMS v2.2.1 release notes +=============================== + +Released: May 25, 2017 + +What's new +========== + +This is a bug-fix and minor feature release and all users are encouraged to +upgrade. + +Changes +------------- +- Index node expression template field changed from a 128 character field to an + unlimited size text field to allow for complex indexing expressions. +- When updating the metadata of a document, any input in the value form field + will select the adjacent checkbox. +- Support for passing the FUSE option `allow-other` and `allow-root` was added + to the index mirroring management command. + +Removals +-------- +* None + +Upgrading from a previous version +--------------------------------- + +Using PIP +~~~~~~~~~ + +Type in the console:: + + $ pip install -U mayan-edms + +the requirements will also be updated automatically. + +Using Git +~~~~~~~~~ + +If you installed Mayan EDMS by cloning the Git repository issue the commands:: + + $ git reset --hard HEAD + $ git pull + +otherwise download the compressed archived and uncompress it overriding the +existing installation. + +Next upgrade/add the new requirements:: + + $ pip install --upgrade -r requirements.txt + +Common steps +~~~~~~~~~~~~ + +Migrate existing database schema with:: + + $ mayan-edms.py performupgrade + +Add new static media:: + + $ mayan-edms.py collectstatic --noinput + +The upgrade procedure is now complete. + + +Backward incompatible changes +============================= + +* None + +Bugs fixed or issues closed +=========================== + +* `GitLab issue #371 `_ Auto select checkbox when updating metadata +* `GitLab issue #385 `_ mountindex: how to specify FUSE mount option allow_other? + +.. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/docs/releases/index.rst b/docs/releases/index.rst index 091513a7f8..d2aaa11fa2 100644 --- a/docs/releases/index.rst +++ b/docs/releases/index.rst @@ -22,6 +22,7 @@ versions of the documentation contain the release notes for any later releases. .. toctree:: :maxdepth: 1 + 2.2.1 2.2 2.1.11 2.1.10 diff --git a/docs/topics/faq.rst b/docs/topics/faq.rst index dedf95428f..987e0d2a43 100644 --- a/docs/topics/faq.rst +++ b/docs/topics/faq.rst @@ -126,3 +126,10 @@ dependent support Python 3 then will the project move to fully support Python 3. Make sure that the Celery BEAT scheduler is running correctly as it is the element that triggers the periodics tasks. + +**Q: How to do LDAP authentication** + +A sample settings file called ldap_connection_settings.py is included in the +contrib/settings/ folder of the repository showing how to setup LDAP +authentication. + diff --git a/mayan/apps/appearance/templates/appearance/base.html b/mayan/apps/appearance/templates/appearance/base.html index 57ab139e7e..34bd926549 100644 --- a/mayan/apps/appearance/templates/appearance/base.html +++ b/mayan/apps/appearance/templates/appearance/base.html @@ -33,6 +33,17 @@ {% block stylesheets %}{% endblock %} {% endcompress %} + {% if appearance_type == 'plain' %} diff --git a/mayan/apps/document_indexing/migrations/0011_auto_20170524_0456.py b/mayan/apps/document_indexing/migrations/0011_auto_20170524_0456.py new file mode 100644 index 0000000000..8f0ac49d50 --- /dev/null +++ b/mayan/apps/document_indexing/migrations/0011_auto_20170524_0456.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.6 on 2017-05-24 04:56 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('document_indexing', '0010_documentindexinstancenode_indexinstance'), + ] + + operations = [ + migrations.AlterField( + model_name='indextemplatenode', + name='expression', + field=models.TextField(help_text="Enter a template to render. Use Django's default templating language (https://docs.djangoproject.com/en/1.7/ref/templates/builtins/)", verbose_name='Indexing expression'), + ), + ] diff --git a/mayan/apps/document_indexing/models.py b/mayan/apps/document_indexing/models.py index a276a8113a..ff0b112a73 100644 --- a/mayan/apps/document_indexing/models.py +++ b/mayan/apps/document_indexing/models.py @@ -114,8 +114,7 @@ class IndexTemplateNode(MPTTModel): index = models.ForeignKey( Index, related_name='node_templates', verbose_name=_('Index') ) - expression = models.CharField( - max_length=128, + expression = models.TextField( help_text=_( 'Enter a template to render. ' 'Use Django\'s default templating language ' diff --git a/mayan/apps/metadata/forms.py b/mayan/apps/metadata/forms.py index c220154ac4..38916ad583 100644 --- a/mayan/apps/metadata/forms.py +++ b/mayan/apps/metadata/forms.py @@ -16,11 +16,16 @@ class DocumentMetadataForm(forms.Form): label=_('Name'), required=False, widget=forms.TextInput(attrs={'readonly': 'readonly'}) ) - value = forms.CharField(label=_('Value'), required=False) + value = forms.CharField(label=_('Value'), required=False, + widget=forms.TextInput(attrs={'class': 'metadata-value'}) + ) update = forms.BooleanField( initial=True, label=_('Update'), required=False ) + class Media: + js = ('metadata/js/metadata_form.js',) + def __init__(self, *args, **kwargs): super(DocumentMetadataForm, self).__init__(*args, **kwargs) diff --git a/mayan/apps/metadata/static/metadata/js/metadata_form.js b/mayan/apps/metadata/static/metadata/js/metadata_form.js new file mode 100644 index 0000000000..a39726fac8 --- /dev/null +++ b/mayan/apps/metadata/static/metadata/js/metadata_form.js @@ -0,0 +1,11 @@ +'use strict'; + +waitForJQuery(function() { + jQuery(document).ready(function() { + $('.metadata-value').on('input', function(event) { + // Check the checkbox next to a metadata value input when there is + // data entry in the value's input. + $(event.target).parents('tr').find(':checkbox').prop('checked', true); + }); + }); +}); diff --git a/mayan/apps/mirroring/management/commands/mountindex.py b/mayan/apps/mirroring/management/commands/mountindex.py index 7244716dae..2a57b9b948 100644 --- a/mayan/apps/mirroring/management/commands/mountindex.py +++ b/mayan/apps/mirroring/management/commands/mountindex.py @@ -11,6 +11,7 @@ from fuse import FUSE, FuseOSError, Operations from django.core import management from django.core.cache import caches from django.core.exceptions import MultipleObjectsReturned +from django.core.management.base import CommandError from django.db.models import Count from document_indexing.models import Index, IndexInstanceNode @@ -214,15 +215,35 @@ class Command(management.BaseCommand): def add_arguments(self, parser): parser.add_argument('slug', nargs='?', help='Index slug') - parser.add_argument('mount_point', nargs='?', help='Mount point') + parser.add_argument( + '--allow-other', action='store_true', dest='allow_other', + default=False, + help='All users (including root) can access the index files.' + ) + parser.add_argument( + '--allow-root', action='store_true', dest='allow_root', + default=False, + help='Mount access is limited to the user mounting the index and ' + 'root. This option and --allow-other are mutually exclusive.' + ) def handle(self, *args, **options): if not options.get('slug') or not options.get('mount_point'): self.stderr.write(self.style.ERROR('Incorrect number of arguments')) exit(1) - FUSE( - operations=IndexFS(index_slug=options['slug']), - mountpoint=options['mount_point'], nothreads=True, foreground=True - ) + try: + FUSE( + operations=IndexFS(index_slug=options['slug']), + mountpoint=options['mount_point'], nothreads=True, foreground=True, + allow_other=options['allow_other'], + allow_root=options['allow_root'] + ) + except RuntimeError as exception: + if options['allow_other'] or options['allow_root']: + raise CommandError( + 'Make sure \'user_allow_other\' is set in /etc/fuse.conf' + ) + else: + raise