From 5de84576e29402dbc6b3fcf42c0a8692a536de5b Mon Sep 17 00:00:00 2001 From: Nicolas Castejon Date: Mon, 7 Sep 2020 09:43:20 +0200 Subject: [PATCH 01/31] Fix responsive issue when the layer is very long in the basemap form. --- geocontrib/static/geocontrib/css/base.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/geocontrib/static/geocontrib/css/base.css b/geocontrib/static/geocontrib/css/base.css index c1e351af..40924439 100644 --- a/geocontrib/static/geocontrib/css/base.css +++ b/geocontrib/static/geocontrib/css/base.css @@ -64,6 +64,15 @@ main { color: #9f3a38; } +/* Fix semantic ui overflow when is too long */ +.layer-item .form div.text { + width: 100% +} + +.ui.selection.dropdown .menu>.item { + word-break: break-all; +} + /* Needs this unfortunatly, because semantic overrides the background-color */ #form-layers .blue-background-class { background-color: rgb(205, 229, 245); From 3c89ef94e7d9764ee8b3d165aa5686e9743cf685 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 8 Sep 2020 10:52:13 +0200 Subject: [PATCH 02/31] Added missing head title elements in template and views context --- geocontrib/context_processors.py | 5 +++-- geocontrib/templates/geocontrib/feature/feature_list.html | 4 +++- geocontrib/views/accounts.py | 1 + geocontrib/views/content_managment.py | 8 ++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/geocontrib/context_processors.py b/geocontrib/context_processors.py index f6f0ace7..42687b65 100644 --- a/geocontrib/context_processors.py +++ b/geocontrib/context_processors.py @@ -1,7 +1,8 @@ +import logging + from django.conf import settings + from geocontrib.models import Authorization -import json -import logging logger = logging.getLogger(__name__) diff --git a/geocontrib/templates/geocontrib/feature/feature_list.html b/geocontrib/templates/geocontrib/feature/feature_list.html index abdcdae5..d949f2bf 100644 --- a/geocontrib/templates/geocontrib/feature/feature_list.html +++ b/geocontrib/templates/geocontrib/feature/feature_list.html @@ -3,6 +3,8 @@ {% load static %} {% load app_filters %} +{% block title %}{{ title }}{% endblock %} + {% block content %}
@@ -197,7 +199,7 @@

{{ features|length }} signalement{% if features|length > 1 %}s{% endif %} diff --git a/geocontrib/views/accounts.py b/geocontrib/views/accounts.py index 33e9d6a3..5afd1d9c 100644 --- a/geocontrib/views/accounts.py +++ b/geocontrib/views/accounts.py @@ -101,5 +101,6 @@ def get(self, request): context['events'] = serialized_events.data context['features'] = serialized_feature_events.data context['comments'] = serialized_comment_events.data + context['title'] = "Mon compte" return render(request, 'geocontrib/my_account.html', context) diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index f32f5ddc..58946f35 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -80,6 +80,9 @@ def get_context_data(self, **kwargs): try: request = self.request project = None + title = None + if any([isinstance(self.object, model) for model in [Project, FeatureType, Feature]]): + title = self.object.title if isinstance(self.object, Project): project = self.object elif isinstance(self.object, FeatureType) or isinstance(self.object, Feature): @@ -102,6 +105,7 @@ def get_context_data(self, **kwargs): context['serialized_features'] = serialized_features.data context['serialized_base_maps'] = serialized_base_maps.data context['serialized_layers'] = serialized_layers.data + context['title'] = title except Exception: logger.exception('BaseMapContext error') return context @@ -223,7 +227,7 @@ def post(self, request, slug, feature_type_slug, feature_id): events = Event.objects.filter(feature_id=feature.feature_id).order_by('created_on') serialized_events = EventSerializer(events, many=True) - context = { + context = {**self.get_context_data(), **{ 'feature': feature, 'feature_data': feature.custom_fields_as_list, 'feature_types': FeatureType.objects.filter(project=project), @@ -236,7 +240,7 @@ def post(self, request, slug, feature_type_slug, feature_id): project=project, feature_id=feature.feature_id, object_type='feature'), 'events': serialized_events.data, 'comment_form': CommentForm(), - } + }} return render(request, 'geocontrib/feature/feature_detail.html', context) From 674dc2195ef8dc3b75d11914a2c6293d809d7115 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 8 Sep 2020 12:15:09 +0200 Subject: [PATCH 03/31] Fix displ_creator property belong to feature instances "feature.creator.display_creator" changed to "feat.display_creator" --- api/serializers.py | 2 +- geocontrib/forms.py | 2 +- geocontrib/templates/geocontrib/feature/feature_detail.html | 2 +- .../templates/geocontrib/feature_type/feature_type_detail.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/serializers.py b/api/serializers.py index aacb1ecd..6799b5a3 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -267,7 +267,7 @@ def get_feature_to(self, obj): 'title': str(feature.title), 'feature_url': feature.get_view_url(), 'created_on': feature.created_on.strftime("%d/%m/%Y %H:%M"), - 'creator': feature.creator.display_creator, + 'creator': feature.display_creator, } except Exception: logger.exception('No related feature found') diff --git a/geocontrib/forms.py b/geocontrib/forms.py index 8ce0131e..834d660c 100644 --- a/geocontrib/forms.py +++ b/geocontrib/forms.py @@ -414,7 +414,7 @@ def __init__(self, *args, **kwargs): self.fields['feature_to'].choices = tuple( (feat.feature_id, "{} ({} - {})".format( - feat.title, feat.creator.display_creator, feat.created_on.strftime("%d/%m/%Y %H:%M"))) for feat in qs + feat.title, feat.display_creator, feat.created_on.strftime("%d/%m/%Y %H:%M"))) for feat in qs ) except Exception: diff --git a/geocontrib/templates/geocontrib/feature/feature_detail.html b/geocontrib/templates/geocontrib/feature/feature_detail.html index 738a30f2..2c6bf231 100644 --- a/geocontrib/templates/geocontrib/feature/feature_detail.html +++ b/geocontrib/templates/geocontrib/feature/feature_detail.html @@ -62,7 +62,7 @@

{% if user.is_authenticated %} Auteur - {{ feature.creator.display_creator }} + {{ feature.display_creator }} {% endif %} diff --git a/geocontrib/templates/geocontrib/feature_type/feature_type_detail.html b/geocontrib/templates/geocontrib/feature_type/feature_type_detail.html index 5cfdc858..5e1b55c9 100644 --- a/geocontrib/templates/geocontrib/feature_type/feature_type_detail.html +++ b/geocontrib/templates/geocontrib/feature_type/feature_type_detail.html @@ -123,7 +123,7 @@

[ Créé le {{ feature.created_on }} {% if user.is_authenticated %} - par {{ feature.creator.display_creator }} + par {{ feature.display_creator }} {% endif %} ]

From fc35ada64b32c2911c08c0d286164174008da023 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 8 Sep 2020 15:35:27 +0200 Subject: [PATCH 04/31] Fix: Handeling project_detail access Unauthenticated users cannot access project w/ access_level_pub_feature above 0 --- geocontrib/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geocontrib/models.py b/geocontrib/models.py index 27a9c651..add85e0e 100644 --- a/geocontrib/models.py +++ b/geocontrib/models.py @@ -156,7 +156,7 @@ def all_permissions(cls, user, project, feature=None): user_rank = cls.get_rank(user, project) - if user_rank >= project_rank_min or project_rank_min < 2: + if user_rank >= project_rank_min or project_rank_min == 0: user_perms['can_view_project'] = True user_perms['can_view_feature'] = True user_perms['can_view_feature_type'] = True From 0433c397b89959d19401070c1b8cdb22a412214d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 15 Sep 2020 17:01:26 +0200 Subject: [PATCH 05/31] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4070e9c..62bed137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Fixed +- Display creator +- Fix responsive issue when the layer is very long in the basemap form. +- Added missing title + ## [1.1.0] - 2020-08-28 ### Changed From 56052c7d9bef4adac82dca04ca99cc5671b17f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 15 Sep 2020 17:14:33 +0200 Subject: [PATCH 06/31] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62bed137..09c944d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Display creator -- Fix responsive issue when the layer is very long in the basemap form. +- Responsive issue when the layer is very long in the basemap form. - Added missing title +- Project detail Access ## [1.1.0] - 2020-08-28 From 92e85f2d0aa2206fcc854660d723c139c3807dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Tue, 22 Sep 2020 15:08:09 +0200 Subject: [PATCH 07/31] Improve changelog summary --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c944d0..43d02c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased ### Fixed -- Display creator -- Responsive issue when the layer is very long in the basemap form. -- Added missing title -- Project detail Access +- Display creator in feature and feature type +- Responsive issue when the layer is very long in the basemap form +- Add title in project, feature type and feature +- Access to the project when no project rank defined ## [1.1.0] - 2020-08-28 From 7d8507ceec60ddd28e05b6bd237f06c6f720d3b2 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 22 Sep 2020 16:04:03 +0200 Subject: [PATCH 08/31] Added missing head title elements --- .../geocontrib/project/project_home.html | 4 ++-- geocontrib/views/content_managment.py | 23 ++++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/geocontrib/templates/geocontrib/project/project_home.html b/geocontrib/templates/geocontrib/project/project_home.html index 1c56ff6c..70c6a629 100644 --- a/geocontrib/templates/geocontrib/project/project_home.html +++ b/geocontrib/templates/geocontrib/project/project_home.html @@ -2,7 +2,7 @@ {% load static %} -{% block title %}Projet {{ project.title }}{% endblock %} +{% block title %}{{ title }}{% endblock %} {% block content %} @@ -273,7 +273,7 @@

// Load into js variables the python context. const baseMaps = JSON.parse(document.getElementById('basemaps').textContent); const layers = JSON.parse(document.getElementById('layers').textContent); - const features = JSON.parse(document.getElementById('features').textContent) ? + const features = JSON.parse(document.getElementById('features').textContent) ? JSON.parse(document.getElementById('features').textContent).features : null; const serviceMap = JSON.parse(document.getElementById('serviceMap').textContent); const optionsMap = JSON.parse(document.getElementById('optionsMap').textContent); diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index 58946f35..4c74bff2 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -427,7 +427,7 @@ def post(self, request, slug, feature_type_slug): attachment_formset = self.AttachmentFormset( request.POST or None, request.FILES, prefix='attachment') - context = { + context = {**self.get_context_data(), **{ 'features': Feature.handy.availables(user, project).order_by('updated_on'), 'feature_type': feature_type, 'project': project, @@ -437,7 +437,7 @@ def post(self, request, slug, feature_type_slug): 'linked_formset': linked_formset, 'attachment_formset': attachment_formset, 'action': 'create', - } + }} return render(request, 'geocontrib/feature/feature_edit.html', context) @@ -812,6 +812,7 @@ def get(self, request, slug): 'permissions': Authorization.all_permissions(user, project), 'feature_types': project.featuretype_set.all(), 'project': project, + 'title': "Création d'un type de signalement", } return render(request, 'geocontrib/feature_type/feature_type_create.html', context) @@ -844,6 +845,7 @@ def post(self, request, slug): 'permissions': Authorization.all_permissions(user, project), 'feature_types': project.featuretype_set.all(), 'project': project, + 'title': "Création d'un type de signalement", } return render(request, 'geocontrib/feature_type/feature_type_create.html', context) @@ -877,7 +879,8 @@ def get(self, request, slug, feature_type_slug): 'feature_types': project.featuretype_set.all(), 'features': features, 'project': project, - 'structure': structure.data + 'structure': structure.data, + 'title': feature_type.title, } return render(request, 'geocontrib/feature_type/feature_type_detail.html', context) @@ -929,6 +932,7 @@ def get(self, request, slug, feature_type_slug): 'structure': structure.data, 'form': form, 'formset': formset, + 'title': feature_type.title, } return render(request, 'geocontrib/feature_type/feature_type_edit.html', context) @@ -976,6 +980,7 @@ def post(self, request, slug, feature_type_slug): 'permissions': Authorization.all_permissions(user, feature_type.project), 'project': feature_type.project, 'feature_type': feature_type, + 'title': feature_type.title } return render(request, 'geocontrib/feature_type/feature_type_edit.html', context) @@ -1191,6 +1196,7 @@ def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['project'] = serilized_projects + context['title'] = project.title context['user'] = user context['last_comments'] = serialized_comments context['last_features'] = features[0:5] @@ -1221,7 +1227,8 @@ def get(self, request, slug): 'permissions': Authorization.all_permissions(request.user, project), 'feature_types': project.featuretype_set.all(), 'is_suscriber': Subscription.is_suscriber(request.user, project), - 'action': 'update' + 'action': 'update', + 'title': project.title, } return render(request, 'geocontrib/project/project_edit.html', context) @@ -1238,7 +1245,8 @@ def post(self, request, slug): 'permissions': Authorization.all_permissions(request.user, project), 'feature_types': project.featuretype_set.all(), 'is_suscriber': Subscription.is_suscriber(request.user, project), - 'action': 'update' + 'action': 'update', + 'title': project.title, } return render(request, 'geocontrib/project/project_edit.html', context) @@ -1263,6 +1271,7 @@ def form_valid(self, form): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['action'] = 'create' + context['title'] = "Création d'un projet" return context @@ -1287,6 +1296,7 @@ def get(self, request, slug): 'project': project, 'permissions': permissions, 'formset': formset, + 'title': project.title, }} return render(request, 'geocontrib/project/project_mapping.html', context) @@ -1308,7 +1318,8 @@ def post(self, request, slug): context = {**self.get_context_data(), **{ 'project': project, 'permissions': permissions, - 'formset': formset + 'formset': formset, + 'title': project.title, }} return render(request, 'geocontrib/project/project_mapping.html', context) From 10a85600a76aa4ab5b6c8700bf9cf13b6f940f3d Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Mon, 28 Sep 2020 12:09:25 +0200 Subject: [PATCH 09/31] Feat(ProjectDetail): Filtering draft features and related comments --- geocontrib/views/content_managment.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index 4c74bff2..0ed0bc97 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -1181,16 +1181,20 @@ def get_context_data(self, **kwargs): project = self.get_object() permissions = Authorization.all_permissions(user, project) - last_comments = Comment.objects.filter( + # On filtre les signalements selon leur statut et l'utilisateur courant + features = Feature.handy.availables( + user=user, project=project + ).order_by('-created_on') + + # On filtre les commentaire selon les signalements visibles + last_comments = Comment.objects.filter( + project=project, + feature_id__in=[feat.feature_id for feat in features] ).order_by('-created_on')[0:5] serialized_comments = CommentSerializer(last_comments, many=True).data - features = Feature.objects.filter( - project=project - ).order_by('-created_on') - serilized_projects = ProjectDetailedSerializer(project).data context = super().get_context_data(**kwargs) From 33ff2636b0b7ff3bda0c0d84a1e11be1758ab32e Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Mon, 28 Sep 2020 14:40:28 +0200 Subject: [PATCH 10/31] Feat(ProjectDetail): Display authors default value - getting contextual value from models properties --- api/serializers.py | 4 ++-- geocontrib/forms.py | 2 +- geocontrib/models.py | 7 ++++++ .../geocontrib/project/project_home.html | 4 ++-- geocontrib/views/content_managment.py | 22 ++++++++++--------- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/api/serializers.py b/api/serializers.py index 6799b5a3..30dcbf03 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -99,7 +99,7 @@ class CommentSerializer(serializers.ModelSerializer): created_on = serializers.DateTimeField(format="%d/%m/%Y", read_only=True) - author = UserSerializer(read_only=True) + display_author = serializers.ReadOnlyField() related_feature = serializers.SerializerMethodField() @@ -122,7 +122,7 @@ class Meta: fields = ( 'created_on', 'comment', - 'author', + 'display_author', 'related_feature', ) diff --git a/geocontrib/forms.py b/geocontrib/forms.py index 834d660c..aa5f3e0f 100644 --- a/geocontrib/forms.py +++ b/geocontrib/forms.py @@ -205,7 +205,7 @@ class AuthorizationForm(forms.ModelForm): username = forms.CharField(label="Nom d'utilisateur") - email = forms.EmailField(label="Adresse email") + email = forms.EmailField(label="Adresse email", required=False) level = forms.ModelChoiceField( label="Niveau d'autorisation", diff --git a/geocontrib/models.py b/geocontrib/models.py index add85e0e..d2169ae6 100644 --- a/geocontrib/models.py +++ b/geocontrib/models.py @@ -592,6 +592,13 @@ def save(self, *args, **kwargs): self.created_on = timezone.now() super().save(*args, **kwargs) + @property + def display_author(self): + res = "Utilisateur supprimé" + if self.author: + res = self.author.get_full_name() or self.author.username + return res + class Attachment(AnnotationAbstract): diff --git a/geocontrib/templates/geocontrib/project/project_home.html b/geocontrib/templates/geocontrib/project/project_home.html index 70c6a629..b0de02c0 100644 --- a/geocontrib/templates/geocontrib/project/project_home.html +++ b/geocontrib/templates/geocontrib/project/project_home.html @@ -115,7 +115,7 @@

Types de signalements

{{ item.title }}
- [ {{ item.created_on|date:"d/m/Y" }}{% if user.is_authenticated %}, par {{ item.creator.first_name }} {{ item.creator.last_name }}{% endif %} ] + [ {{ item.created_on|date:"d/m/Y" }}{% if user.is_authenticated %}, par {{ item.display_creator }} {% endif %} ]
@@ -138,7 +138,7 @@

Types de signalements

"{{ item.comment }}"
- [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.author.full_name }}{% endif %} ] + [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.display_author }}{% endif %} ]
diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index 4c74bff2..23672b05 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -1368,6 +1368,7 @@ def post(self, request, slug): formset = self.AuthorizationFormSet(request.POST or None) authorised = Authorization.objects.filter(project=project) permissions = Authorization.all_permissions(user, project) + if formset.is_valid(): for data in formset.cleaned_data: @@ -1389,16 +1390,17 @@ def post(self, request, slug): authorization.save() return redirect('geocontrib:project_members', slug=slug) - - context = { - "title": "Gestion des membres du projet {}".format(project.title), - 'authorised': authorised, - 'permissions': permissions, - 'project': project, - 'formset': formset, - 'feature_types': FeatureType.objects.filter(project=project) - } - return render(request, 'geocontrib/project/project_members.html', context) + else: + logger.error(formset.errors) + context = { + "title": "Gestion des membres du projet {}".format(project.title), + 'authorised': authorised, + 'permissions': permissions, + 'project': project, + 'formset': formset, + 'feature_types': FeatureType.objects.filter(project=project) + } + return render(request, 'geocontrib/project/project_members.html', context) ###################### From 0af057429ae7042b9b17485251ec1b337f36d078 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Tue, 29 Sep 2020 09:20:16 +0200 Subject: [PATCH 11/31] Fix(Templates): Replace displayable fullname -Feature, Comment, and Event instances may be linked to a deleted User instance. Fullnames displayed in templates are defined as models properties. --- api/serializers.py | 6 +++--- geocontrib/models.py | 7 +++++++ .../email/notif_suscriber_grouped_events.html | 12 ++++++------ .../templates/geocontrib/feature/feature_detail.html | 6 +++--- geocontrib/templates/geocontrib/my_account.html | 6 +++--- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/api/serializers.py b/api/serializers.py index 30dcbf03..35d7bc49 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -80,7 +80,7 @@ class UserSerializer(serializers.ModelSerializer): full_name = serializers.SerializerMethodField() def get_full_name(self, obj): - return obj.get_full_name() + return obj.get_full_name() or obj.username class Meta: model = User @@ -285,7 +285,7 @@ class EventSerializer(serializers.ModelSerializer): created_on = serializers.DateTimeField(format="%d/%m/%Y %H:%M", read_only=True) - user = UserSerializer(read_only=True) + display_user = serializers.ReadOnlyField() related_comment = serializers.SerializerMethodField() @@ -344,7 +344,7 @@ class Meta: 'feature_id', 'comment_id', 'attachment_id', - 'user', + 'display_user', 'related_comment', 'related_feature', 'project_url', diff --git a/geocontrib/models.py b/geocontrib/models.py index d2169ae6..1d1e2052 100644 --- a/geocontrib/models.py +++ b/geocontrib/models.py @@ -691,6 +691,13 @@ def save(self, *args, **kwargs): self.created_on = timezone.now() super().save(*args, **kwargs) + @property + def display_user(self): + res = "Utilisateur supprimé" + if self.user: + res = self.user.get_full_name() or self.user.username + return res + @property def contextualize_action(self): evt = 'Aucun evenement' diff --git a/geocontrib/templates/geocontrib/email/notif_suscriber_grouped_events.html b/geocontrib/templates/geocontrib/email/notif_suscriber_grouped_events.html index 3d94179a..2c90457f 100644 --- a/geocontrib/templates/geocontrib/email/notif_suscriber_grouped_events.html +++ b/geocontrib/templates/geocontrib/email/notif_suscriber_grouped_events.html @@ -16,7 +16,7 @@ {% if event.event_type == 'delete' %} {% if event.object_type == 'feature' %} {{ event.created_on }} - "{{ event.data.feature_title }}" - Signalement supprimé par {{ event.user.full_name }} + Signalement supprimé par {{ event.display_user }} {% endif %} {% else %} @@ -29,10 +29,10 @@ {% if event.event_type == 'create' %} {% if event.object_type == 'feature' %} - Signalement créé par {{ event.user.full_name }} + Signalement créé par {{ event.display_user }} {% elif event.object_type == 'comment' %} - - Commentaire créé par {{ event.user.full_name }} + - Commentaire créé par {{ event.display_user }} {{ event.related_comment.comment }} {% if event.related_comment.attachments %} {% for att in event.related_comment.attachments %} @@ -41,16 +41,16 @@ {% endif %} {% elif event.object_type == 'attachment' %} - {{ event.created_on }} - Pièce-jointe ajoutée par {{ event.user.full_name }} + {{ event.created_on }} - Pièce-jointe ajoutée par {{ event.display_user }} {% endif %} {% elif event.event_type == 'update' %} {% if event.object_type == 'feature' %} - Signalement mis à jour par {{ event.user.full_name }} + Signalement mis à jour par {{ event.display_user }} {% elif event.object_type == 'attachment' %} - Pièce-jointe mise à jour par {{ event.user.full_name }} + Pièce-jointe mise à jour par {{ event.display_user }} {% endif %} {% endif %} diff --git a/geocontrib/templates/geocontrib/feature/feature_detail.html b/geocontrib/templates/geocontrib/feature/feature_detail.html index 2c6bf231..27ca3c47 100644 --- a/geocontrib/templates/geocontrib/feature/feature_detail.html +++ b/geocontrib/templates/geocontrib/feature/feature_detail.html @@ -168,7 +168,7 @@

Activité et commentaires

{{ event.created_on }} Création du signalement - {% if user.is_authenticated %} par {{ event.user.full_name }}{% endif %} + {% if user.is_authenticated %} par {{ event.display_user }}{% endif %} @@ -180,7 +180,7 @@

Activité et commentaires

{{ event.created_on }} Commentaire - {% if user.is_authenticated %} par {{ event.user.full_name }}{% endif %} + {% if user.is_authenticated %} par {{ event.display_user }}{% endif %}
{{ event.related_comment.comment }} @@ -201,7 +201,7 @@

Activité et commentaires

{{ event.created_on }}
Signalement mis à jour - {% if user.is_authenticated %} par {{ event.user.full_name }}{% endif %} + {% if user.is_authenticated %} par {{ event.display_user }}{% endif %} diff --git a/geocontrib/templates/geocontrib/my_account.html b/geocontrib/templates/geocontrib/my_account.html index a646a321..a5c136b7 100644 --- a/geocontrib/templates/geocontrib/my_account.html +++ b/geocontrib/templates/geocontrib/my_account.html @@ -139,7 +139,7 @@

MES PROJETS

{% endif %}
- [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.user.full_name }}{% endif %} ] + [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.display_user }}{% endif %} ]
@@ -166,7 +166,7 @@

MES PROJETS

{% endif %}
- [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.user.full_name }}{% endif %} ] + [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.display_user }}{% endif %} ]
@@ -189,7 +189,7 @@

MES PROJETS

"{{ item.related_comment.comment }}"
- [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.user.full_name }}{% endif %} ] + [ {{ item.created_on }}{% if user.is_authenticated %}, par {{ item.display_user }}{% endif %} ]
From c8fbfc62e586c86e6c45ebc91e7e527247c4293c Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Wed, 30 Sep 2020 14:42:40 +0200 Subject: [PATCH 12/31] Fix(LDAPUserSync): Geocontrib authorizations are kept between each sync --- .../management/commands/georchestra_user_sync.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugin_georchestra/management/commands/georchestra_user_sync.py b/plugin_georchestra/management/commands/georchestra_user_sync.py index 769d7af8..3038840c 100644 --- a/plugin_georchestra/management/commands/georchestra_user_sync.py +++ b/plugin_georchestra/management/commands/georchestra_user_sync.py @@ -186,20 +186,25 @@ def sync_ldap_groups(self, user, row): # On liste les projets pour lesquels l'utilisateur n'est ni membre des groupes 'ldap_project_admin_groups' # ni membre des goupes 'ldap_project_contrib_groups' # Les utilisateurs absent de ces groupes se retrouvent simples "utilisateur connecté" + # sauf si ils ont déja un role defini à posteriori dans geocontrib not_admin_and_not_contrib_qs = Project.objects.exclude(ldap_project_admin_groups__overlap=flattened_groups)\ .exclude(ldap_project_contrib_groups__overlap=flattened_groups) if not_admin_and_not_contrib_qs.exists(): for project in not_admin_and_not_contrib_qs or []: - auth, created = Authorization.objects.update_or_create( + auth, created = Authorization.objects.get_or_create( project=project, user=user, defaults={ 'level': UserLevelPermission.objects.get(user_type_id=choices.LOGGED_USER) } ) - - logger.debug("User '{0}' set as {1}'s Project '{2}' ".format( - user.username, auth.level.user_type_id, project.slug) - ) + if not created: + logger.debug("User '{0}' is already {1}'s Project '{2}' ".format( + user.username, auth.level.user_type_id, project.slug) + ) + else: + logger.debug("User '{0}' set as {1}'s Project '{2}' ".format( + user.username, auth.level.user_type_id, project.slug) + ) def user_update_or_create(self, row): try: From abdfc07de05b0b009a045d4152a4d0e25ab4dbac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Charpentier?= <72258247+hcharp@users.noreply.github.com> Date: Fri, 2 Oct 2020 13:57:06 +0200 Subject: [PATCH 13/31] Update forms.py Correction orthographique --- geocontrib/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geocontrib/forms.py b/geocontrib/forms.py index aa5f3e0f..e898446b 100644 --- a/geocontrib/forms.py +++ b/geocontrib/forms.py @@ -114,7 +114,7 @@ def clean(self): continue name = form.cleaned_data.get('name') if name in names: - raise forms.ValidationError("Les champs supplémentaires ne peuvent avoir des nom similaires.") + raise forms.ValidationError("Les champs supplémentaires ne peuvent avoir des noms similaires.") names.append(name) @@ -149,7 +149,7 @@ class CommentForm(forms.ModelForm): attachment_file = forms.FileField(label="Fichier joint", required=False) info = forms.CharField( - label="Information additonelle au fichier joint", required=False, widget=forms.Textarea()) + label="Information additionnelle au fichier joint", required=False, widget=forms.Textarea()) class Meta: model = Comment From fd1dbabf321d92f386ddc2468a04b3c85a6dc745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Charpentier?= <72258247+hcharp@users.noreply.github.com> Date: Fri, 2 Oct 2020 14:29:03 +0200 Subject: [PATCH 14/31] Update emails.py Correction orthographique --- geocontrib/emails.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geocontrib/emails.py b/geocontrib/emails.py index 194af091..ba12a36d 100644 --- a/geocontrib/emails.py +++ b/geocontrib/emails.py @@ -76,7 +76,7 @@ def notif_creator_published_feature(emails, context): context['url_feature'] = urljoin(CURRENT_SITE_DOMAIN, feature.get_view_url()) - subject = "[Collab:{project_slug}] Confirmation de la publication de l'un de vos signalement.".format( + subject = "[Collab:{project_slug}] Confirmation de la publication de l'un de vos signalements.".format( project_slug=feature.project.slug ) From bae74fb63918b20bd20ba178cf6d2b5b713afb26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Charpentier?= <72258247+hcharp@users.noreply.github.com> Date: Fri, 2 Oct 2020 14:56:36 +0200 Subject: [PATCH 15/31] Update login.html Correction orthographique --- geocontrib/templates/geocontrib/registration/login.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geocontrib/templates/geocontrib/registration/login.html b/geocontrib/templates/geocontrib/registration/login.html index 638d4016..c30ead5b 100644 --- a/geocontrib/templates/geocontrib/registration/login.html +++ b/geocontrib/templates/geocontrib/registration/login.html @@ -22,9 +22,9 @@

CONNEXION

{% if form.errors %}
- Les informations d'identifications sont incorrectes. + Les informations d'identification sont incorrectes.
- NB: Seules les comptes actifs peuvent se connecter. + NB: Seuls les comptes actifs peuvent se connecter.
{% endif %}
From 6cb7fb06c55e1ba59dd2a979dd10325767de8192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Charpentier?= <72258247+hcharp@users.noreply.github.com> Date: Tue, 6 Oct 2020 14:43:40 +0200 Subject: [PATCH 16/31] Update users.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Statut équipe --- docs/users.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/users.md b/docs/users.md index 8862affc..de37e52c 100644 --- a/docs/users.md +++ b/docs/users.md @@ -9,6 +9,7 @@ Autorisations attribuables par projet : Autorisations indépendantes des projets : * Super utilisateur * Gestionnaire métier +* Équipe ## Autorisations liées aux projets @@ -89,3 +90,9 @@ Un gestionnaire métier peut : Le créateur d'un nouveau projet en devient automatiquement administrateur projet du projet en question. + +### Équipe + +Un utilisateur avec le statut équipe peut se connecter à l'interface administrateur. +Cependant, l'interface lui apparaît vide puisqu'il n'y a aucun droit ni en lecture, ni en écriture. + From c0b7f9f49fea476332801a3b889e2460b2e979be Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 13 Oct 2020 11:59:20 +0200 Subject: [PATCH 17/31] apply filters on map features --- geocontrib/static/geocontrib/js/map-util.js | 66 +++++++++++-------- .../geocontrib/feature/feature_list.html | 9 ++- 2 files changed, 46 insertions(+), 29 deletions(-) diff --git a/geocontrib/static/geocontrib/js/map-util.js b/geocontrib/static/geocontrib/js/map-util.js index 44fa1289..3915a532 100644 --- a/geocontrib/static/geocontrib/js/map-util.js +++ b/geocontrib/static/geocontrib/js/map-util.js @@ -99,37 +99,47 @@ const mapUtil = { this.addLayers(layers); }, - addFeatures: function (features) { + addFeatures: function (features, filter) { + console.log(features, filter) featureGroup = new L.FeatureGroup(); features.forEach((feature) => { - const geomJSON = turf.flip(feature.geometry); - const popupContent = this._createContentPopup(feature); - - if (geomJSON.type === 'Point') { - L.circleMarker(geomJSON.coordinates, { - color: feature.properties.feature_type.color, - radius: 4, - fillOpacity: 0.3, - weight: 1, - }) - .bindPopup(popupContent) - .addTo(featureGroup); - } else if (geomJSON.type === 'LineString') { - L.polyline(geomJSON.coordinates, { - color: feature.properties.feature_type.color, - weight: 1.5, - }) - .bindPopup(popupContent) - .addTo(featureGroup); - } else if (geomJSON.type === 'Polygon') { - L.polygon(geomJSON.coordinates, { - color: feature.properties.feature_type.color, - weight: 1.5, - fillOpacity: 0.3, - }) - .bindPopup(popupContent) - .addTo(featureGroup); + const typeCheck = filter.featureType && feature.properties.feature_type.slug === filter.featureType; + const statusCheck = filter.featureStatus && feature.properties.status.value === filter.featureStatus; + const titleCheck = filter.featureTitle && feature.properties.title.includes(filter.featureTitle); + const filters = [typeCheck, statusCheck, titleCheck] + + if (!Object.values(filter).some(val => val) || Object.values(filter).some(val => val) && filters.every(val => val !== false)) { + + const geomJSON = turf.flip(feature.geometry); + + const popupContent = this._createContentPopup(feature); + + if (geomJSON.type === 'Point') { + L.circleMarker(geomJSON.coordinates, { + color: feature.properties.feature_type.color, + radius: 4, + fillOpacity: 0.3, + weight: 1, + }) + .bindPopup(popupContent) + .addTo(featureGroup); + } else if (geomJSON.type === 'LineString') { + L.polyline(geomJSON.coordinates, { + color: feature.properties.feature_type.color, + weight: 1.5, + }) + .bindPopup(popupContent) + .addTo(featureGroup); + } else if (geomJSON.type === 'Polygon') { + L.polygon(geomJSON.coordinates, { + color: feature.properties.feature_type.color, + weight: 1.5, + fillOpacity: 0.3, + }) + .bindPopup(popupContent) + .addTo(featureGroup); + } } }); map.addLayer(featureGroup); diff --git a/geocontrib/templates/geocontrib/feature/feature_list.html b/geocontrib/templates/geocontrib/feature/feature_list.html index d949f2bf..c945366a 100644 --- a/geocontrib/templates/geocontrib/feature/feature_list.html +++ b/geocontrib/templates/geocontrib/feature/feature_list.html @@ -242,6 +242,9 @@

{{ features|length }} signalement{% if features|length > 1 %}s{% endif %}{{ features|length }} signalement{% if features|length > 1 %}s{% endif %} 0) { mapUtil.getMap().fitBounds(featureGroup.getBounds()) From c57bca0dd4c26d56d26b00904652ea65df309474 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 13 Oct 2020 15:57:24 +0200 Subject: [PATCH 18/31] make features more visible on map --- geocontrib/static/geocontrib/js/map-util.js | 11 +++++------ .../templates/geocontrib/feature/feature_list.html | 3 --- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/geocontrib/static/geocontrib/js/map-util.js b/geocontrib/static/geocontrib/js/map-util.js index 3915a532..529f9abd 100644 --- a/geocontrib/static/geocontrib/js/map-util.js +++ b/geocontrib/static/geocontrib/js/map-util.js @@ -100,7 +100,6 @@ const mapUtil = { }, addFeatures: function (features, filter) { - console.log(features, filter) featureGroup = new L.FeatureGroup(); features.forEach((feature) => { @@ -119,23 +118,23 @@ const mapUtil = { L.circleMarker(geomJSON.coordinates, { color: feature.properties.feature_type.color, radius: 4, - fillOpacity: 0.3, - weight: 1, + fillOpacity: 0.5, + weight: 3, }) .bindPopup(popupContent) .addTo(featureGroup); } else if (geomJSON.type === 'LineString') { L.polyline(geomJSON.coordinates, { color: feature.properties.feature_type.color, - weight: 1.5, + weight: 3, }) .bindPopup(popupContent) .addTo(featureGroup); } else if (geomJSON.type === 'Polygon') { L.polygon(geomJSON.coordinates, { color: feature.properties.feature_type.color, - weight: 1.5, - fillOpacity: 0.3, + weight: 3, + fillOpacity: 0.5, }) .bindPopup(popupContent) .addTo(featureGroup); diff --git a/geocontrib/templates/geocontrib/feature/feature_list.html b/geocontrib/templates/geocontrib/feature/feature_list.html index c945366a..00424617 100644 --- a/geocontrib/templates/geocontrib/feature/feature_list.html +++ b/geocontrib/templates/geocontrib/feature/feature_list.html @@ -242,9 +242,6 @@

{{ features|length }} signalement{% if features|length > 1 %}s{% endif %} Date: Tue, 13 Oct 2020 16:16:44 +0200 Subject: [PATCH 19/31] header menu fully displayed on small screens --- geocontrib/templates/geocontrib/base.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/geocontrib/templates/geocontrib/base.html b/geocontrib/templates/geocontrib/base.html index d8b91972..4fd641bf 100644 --- a/geocontrib/templates/geocontrib/base.html +++ b/geocontrib/templates/geocontrib/base.html @@ -52,7 +52,7 @@ -
+
diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index ab3eb4f2..cde26e8b 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -171,6 +171,13 @@ def test_func(self): project = feature.project return Authorization.has_permission(user, 'can_create_feature', project) + def get(self, request, slug, feature_type_slug, feature_id): + return redirect( + 'geocontrib:feature_detail', + slug=slug, + feature_type_slug=feature_type_slug, + feature_id=feature_id) + def post(self, request, slug, feature_type_slug, feature_id): feature = self.get_object() project = feature.project @@ -227,7 +234,7 @@ def post(self, request, slug, feature_type_slug, feature_id): events = Event.objects.filter(feature_id=feature.feature_id).order_by('created_on') serialized_events = EventSerializer(events, many=True) - context = {**self.get_context_data(), **{ + context = { 'feature': feature, 'feature_data': feature.custom_fields_as_list, 'feature_types': FeatureType.objects.filter(project=project), @@ -239,8 +246,8 @@ def post(self, request, slug, feature_type_slug, feature_id): 'attachments': Attachment.objects.filter( project=project, feature_id=feature.feature_id, object_type='feature'), 'events': serialized_events.data, - 'comment_form': CommentForm(), - }} + 'comment_form': form, + } return render(request, 'geocontrib/feature/feature_detail.html', context) From 04b59b4f6891f116ce3122ef0d57d8ba50bb8773 Mon Sep 17 00:00:00 2001 From: cbenhabib Date: Wed, 21 Oct 2020 10:44:14 +0200 Subject: [PATCH 23/31] Fix: add serialized instances into context data --- geocontrib/views/content_managment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geocontrib/views/content_managment.py b/geocontrib/views/content_managment.py index cde26e8b..5b908982 100644 --- a/geocontrib/views/content_managment.py +++ b/geocontrib/views/content_managment.py @@ -161,7 +161,7 @@ def post(self, request, slug, feature_type_slug, feature_id): @method_decorator(DECORATORS, name='dispatch') -class CommentCreate(SingleObjectMixin, UserPassesTestMixin, View): +class CommentCreate(BaseMapContextMixin, UserPassesTestMixin, View): queryset = Feature.objects.all() pk_url_kwarg = 'feature_id' @@ -234,7 +234,7 @@ def post(self, request, slug, feature_type_slug, feature_id): events = Event.objects.filter(feature_id=feature.feature_id).order_by('created_on') serialized_events = EventSerializer(events, many=True) - context = { + context = {**self.get_context_data(), **{ 'feature': feature, 'feature_data': feature.custom_fields_as_list, 'feature_types': FeatureType.objects.filter(project=project), @@ -247,7 +247,7 @@ def post(self, request, slug, feature_type_slug, feature_id): project=project, feature_id=feature.feature_id, object_type='feature'), 'events': serialized_events.data, 'comment_form': form, - } + }} return render(request, 'geocontrib/feature/feature_detail.html', context) From 8325a8572856cd82828c611a60e88715258afccc Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 21 Oct 2020 11:07:54 +0200 Subject: [PATCH 24/31] remove commented code --- geocontrib/templates/geocontrib/feature/feature_list.html | 1 - 1 file changed, 1 deletion(-) diff --git a/geocontrib/templates/geocontrib/feature/feature_list.html b/geocontrib/templates/geocontrib/feature/feature_list.html index 5fd504e1..f1395869 100644 --- a/geocontrib/templates/geocontrib/feature/feature_list.html +++ b/geocontrib/templates/geocontrib/feature/feature_list.html @@ -218,7 +218,6 @@

{{ features|length }} signalement{% if features|length > 1 %}s{% endif %} function getDataFilters() { var $form = $("#form-filters").serializeArray() - // var requestURL = `{% url 'geocontrib:feature_list' slug=project.slug %}` var requestURL = ''; for (var field of $form) { if (field.value) { From 0ffd3410bfba98bbf0d8136af991eb5a0e188b32 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 22 Oct 2020 15:04:46 +0200 Subject: [PATCH 25/31] fix addFeatures function for no filter case --- geocontrib/static/geocontrib/js/map-util.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/geocontrib/static/geocontrib/js/map-util.js b/geocontrib/static/geocontrib/js/map-util.js index 529f9abd..42cb4cf5 100644 --- a/geocontrib/static/geocontrib/js/map-util.js +++ b/geocontrib/static/geocontrib/js/map-util.js @@ -103,12 +103,14 @@ const mapUtil = { featureGroup = new L.FeatureGroup(); features.forEach((feature) => { - const typeCheck = filter.featureType && feature.properties.feature_type.slug === filter.featureType; - const statusCheck = filter.featureStatus && feature.properties.status.value === filter.featureStatus; - const titleCheck = filter.featureTitle && feature.properties.title.includes(filter.featureTitle); - const filters = [typeCheck, statusCheck, titleCheck] + if (filter) { + const typeCheck = filter.featureType && feature.properties.feature_type.slug === filter.featureType; + const statusCheck = filter.featureStatus && feature.properties.status.value === filter.featureStatus; + const titleCheck = filter.featureTitle && feature.properties.title.includes(filter.featureTitle); + const filters = [typeCheck, statusCheck, titleCheck]; + } - if (!Object.values(filter).some(val => val) || Object.values(filter).some(val => val) && filters.every(val => val !== false)) { + if (!filter || !Object.values(filter).some(val => val) || Object.values(filter).some(val => val) && filters.length && filters.every(val => val !== false)) { const geomJSON = turf.flip(feature.geometry); From 8d0d246786bac7fb4854f079a8ea912313f781bc Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 22 Oct 2020 17:06:36 +0200 Subject: [PATCH 26/31] fix css for menu not responsive on small screens --- geocontrib/templates/geocontrib/base.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/geocontrib/templates/geocontrib/base.html b/geocontrib/templates/geocontrib/base.html index bab0c723..68a4f3a5 100644 --- a/geocontrib/templates/geocontrib/base.html +++ b/geocontrib/templates/geocontrib/base.html @@ -140,8 +140,8 @@ - \ No newline at end of file From 242247b6f9a8715c7d4bd41d2e2d308561d0de89 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 23 Oct 2020 10:48:46 +0200 Subject: [PATCH 27/31] fix const not accessible --- geocontrib/static/geocontrib/js/map-util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geocontrib/static/geocontrib/js/map-util.js b/geocontrib/static/geocontrib/js/map-util.js index 42cb4cf5..c8307fdd 100644 --- a/geocontrib/static/geocontrib/js/map-util.js +++ b/geocontrib/static/geocontrib/js/map-util.js @@ -103,11 +103,13 @@ const mapUtil = { featureGroup = new L.FeatureGroup(); features.forEach((feature) => { + let filters = []; + if (filter) { const typeCheck = filter.featureType && feature.properties.feature_type.slug === filter.featureType; const statusCheck = filter.featureStatus && feature.properties.status.value === filter.featureStatus; const titleCheck = filter.featureTitle && feature.properties.title.includes(filter.featureTitle); - const filters = [typeCheck, statusCheck, titleCheck]; + filters = [typeCheck, statusCheck, titleCheck]; } if (!filter || !Object.values(filter).some(val => val) || Object.values(filter).some(val => val) && filters.length && filters.every(val => val !== false)) { From a765149d31baad4850e985da3aa122fec474b329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Charpentier?= <72258247+hcharp@users.noreply.github.com> Date: Wed, 28 Oct 2020 14:43:33 +0100 Subject: [PATCH 28/31] Update users.md --- docs/users.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/users.md b/docs/users.md index de37e52c..2d29fe96 100644 --- a/docs/users.md +++ b/docs/users.md @@ -9,7 +9,7 @@ Autorisations attribuables par projet : Autorisations indépendantes des projets : * Super utilisateur * Gestionnaire métier -* Équipe +* Statut équipe ## Autorisations liées aux projets @@ -91,8 +91,8 @@ Un gestionnaire métier peut : Le créateur d'un nouveau projet en devient automatiquement administrateur projet du projet en question. -### Équipe +### Statut équipe Un utilisateur avec le statut équipe peut se connecter à l'interface administrateur. -Cependant, l'interface lui apparaît vide puisqu'il n'y a aucun droit ni en lecture, ni en écriture. +Il accède aux fonctionnalités de l'interface selon les permissions qui lui ont été accordées. From f5c20ab89adc6566fc4325e45e8f08e475dff5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Wed, 28 Oct 2020 16:48:10 +0100 Subject: [PATCH 29/31] Prepared changelog 1.1.1 --- CHANGELOG.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43d02c9a..adb49035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## Unreleased +## [1.1.1] - 2020-10-29 + +### Changed +- increase thickness of segments of features and reduced the transparency of dotted features + ### Fixed - Display creator in feature and feature type - Responsive issue when the layer is very long in the basemap form - Add title in project, feature type and feature -- Access to the project when no project rank defined +- Access to the project when no project rank defined +- Some pages where missing the title in the browser tabs +- The features are now filtered when search on the map +- The search in the list of features now stay in the same page +- The Georchestra plugin now keeps user rights defined in GeoContrib +- Draft features are now hidden on the section "Last features" +- Empty comments are now blocked ## [1.1.0] - 2020-08-28 @@ -23,7 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [1.1.0-rc1] - 2020-08-19 ### Added -- geOrchestra plugin: automatically associate role to users when the user database is synchronised (see +- geOrchestra plugin: automatically associate role to users when the user database is synchronised (see [geOrchestra plugin](plugin_georchestra/README.md)) - add a function to search for places and addresses in the interactive maps. This new feature comes with new settings: `GEOCODER_PROVIDERS` and `SELECTED_GEOCODER` @@ -37,10 +48,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - change the label of the feature type field `title` in the front-end form (Titre -> Nom) - change the data model for basemaps: one basemap may contain several layers. Layers are declared by GéoContrib admin users. Basemaps are created by project admin users by selecting layers, ordering them and setting the opacity -of each of them. End users may switch from one basemap to another in the interactive maps. One user can change -the order of the layers and their opacity in the interactive maps. These personnal adjustments are stored in the +of each of them. End users may switch from one basemap to another in the interactive maps. One user can change +the order of the layers and their opacity in the interactive maps. These personnal adjustments are stored in the web browser of the user (local storage) and do not alter the basemaps as seen by other users. -- change default value for `LOGO_PATH` setting: Neogeo Technologie logo. This new image is located in the media +- change default value for `LOGO_PATH` setting: Neogeo Technologie logo. This new image is located in the media directory. - change all visible names in front-end and docs from `Geocontrib` to `GéoContrib` - set the leaflet background container to white From bdc3f11c77e5e18c2f74fdc3983a53c86750d170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 29 Oct 2020 14:37:27 +0100 Subject: [PATCH 30/31] Elsa sugestions --- CHANGELOG.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adb49035..4edf8b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - increase thickness of segments of features and reduced the transparency of dotted features ### Fixed -- Display creator in feature and feature type -- Responsive issue when the layer is very long in the basemap form -- Add title in project, feature type and feature -- Access to the project when no project rank defined -- Some pages where missing the title in the browser tabs +- The creator is correctly displayed in the features and the feature types +- In the basemaps form, the display of a very long layer name is now responsive +- A browser title (tab) is now displayed for all pages +- Projects with limited access are no longer accessible to everyone - The features are now filtered when search on the map - The search in the list of features now stay in the same page - The Georchestra plugin now keeps user rights defined in GeoContrib From aba0c61e3fc1e612407de018bd24dbcf38ba6c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20DA=20ROCHA?= Date: Thu, 29 Oct 2020 14:50:53 +0100 Subject: [PATCH 31/31] Update README.md --- plugin_georchestra/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin_georchestra/README.md b/plugin_georchestra/README.md index 9a2d9c7c..8856d228 100644 --- a/plugin_georchestra/README.md +++ b/plugin_georchestra/README.md @@ -62,7 +62,8 @@ rôle de contributeur pour le projet. Néanmoins un utilisateur ayant déjà le * les utilisateurs appartenant aux groupes paramétrés dans le champ "Groupes LDAP des administrateurs" du projet (cf. interface d'administrration Django de GéoContrib dans le formulaire du projet) recoivent automatiquement le rôle d'administrateur du projet. - +* les utilisateurs qui ne font pas partis des groupes LDAP mentionnés dans l'interface d'admin, et auxquels des rôles +ont été attribués depuis l'onglet "Membres" d'un projet, conservent bien leurs rôles après une synchronisation. ## Déploiement et configuration