From a01f2c4754c78d070443fb554544a5dd25a140ab Mon Sep 17 00:00:00 2001
From: Alexandre <36194606+AlexandreJunod@users.noreply.github.com>
Date: Mon, 17 Apr 2023 14:33:35 +0200
Subject: [PATCH 01/23] represent list as string for report details (#778)
---
.../reports/sections/sectiondetail.html | 38 ++++++++++++++-----
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/geocity/apps/reports/templates/reports/sections/sectiondetail.html b/geocity/apps/reports/templates/reports/sections/sectiondetail.html
index 24e53049e..4c29aca8e 100644
--- a/geocity/apps/reports/templates/reports/sections/sectiondetail.html
+++ b/geocity/apps/reports/templates/reports/sections/sectiondetail.html
@@ -8,16 +8,28 @@
{% if request_data.properties.submission_fields %}
{% if section.style == 0 %}
- {% for form, fields in request_data.properties.submission_fields.items %}
- {% if section.show_form_name %}
-
{{form}}
+ {% for form, fields in request_data.properties.submission_fields.items %}
+ {% if section.show_form_name %}
+
{{ form }}
+ {% endif %}
+ {% for key, field in fields.items %}
+ {% if not key in section.undesired_properties %}
+
{{key}} :
+ {% for value in field %}
+ {% if value|length > 1 %}
+ {% if not forloop.last %}
+ {{value}};
+ {% else %}
+ {{value}}
+ {% endif %}
+ {% elif forloop.first %}
+ {{field}}
+ {% endif %}
+ {% endfor %}
+
{% endif %}
- {% for key, field in fields.items %}
- {% if not key in section.undesired_properties %}
-
{{key}} : {{field}}
- {% endif %}
- {% endfor %}
{% endfor %}
+ {% endfor %}
{% elif section.style == 1 %}
{% for form, fields in request_data.properties.submission_fields.items %}
{% if section.show_form_name %}
@@ -26,7 +38,15 @@
{% for key, field in fields.items %}
{% if not key in section.undesired_properties %}
{{key}}
-
{{field}}
+
+ {% for value in field %}
+ {% if value|length > 1 %}
+ • {{value}}
+ {% elif forloop.first %}
+ {{field}}
+ {% endif %}
+ {% endfor %}
+
{% endif %}
{% endfor %}
From 27e0757423cf6de05c3e33211a1733daa6c668e1 Mon Sep 17 00:00:00 2001
From: Alexandre <36194606+AlexandreJunod@users.noreply.github.com>
Date: Mon, 17 Apr 2023 14:34:44 +0200
Subject: [PATCH 02/23] yc-1073 (#777)
* Fix number of forms and sites for GroupAdmin. Show administrative_entity of group
* show is_integrator_admin on group
---
geocity/apps/accounts/admin.py | 43 ++++++++++++++++++++++++----------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/geocity/apps/accounts/admin.py b/geocity/apps/accounts/admin.py
index ca31fd16b..ac6aae2bf 100644
--- a/geocity/apps/accounts/admin.py
+++ b/geocity/apps/accounts/admin.py
@@ -436,13 +436,14 @@ class GroupAdmin(admin.ModelAdmin):
list_display = [
"__str__",
"get__integrator",
+ "get__is_integrator",
"get__is_validator",
"get__is_default_validator",
"get__is_backoffice",
"get__mandatory_2fa",
- # FIXME: Causes a crash on prod
- # "get__forms_number",
- # "get__sites_number",
+ "get__administrative_entity",
+ "get__forms_number",
+ "get__sites_number",
]
filter_horizontal = ("permissions",)
@@ -450,6 +451,13 @@ class GroupAdmin(admin.ModelAdmin):
"name",
]
+ @admin.display(boolean=True)
+ def get__is_integrator(self, obj):
+ return obj.permit_department.is_integrator_admin
+
+ get__is_integrator.admin_order_field = "permit_department__is_integrator_admin"
+ get__is_integrator.short_description = _("Intégrateur")
+
@admin.display(boolean=True)
def get__is_validator(self, obj):
return obj.permit_department.is_validator
@@ -486,18 +494,29 @@ def get__mandatory_2fa(self, obj):
get__mandatory_2fa.admin_order_field = "permit_department__mandatory_2fa"
get__mandatory_2fa.short_description = _("2FA obligatoire")
- # FIXME: Causes a crash on prod
- # def get__forms_number(self, obj):
- # if obj.permit_department.is_integrator_admin:
- # return obj.permit_department.administrative_entity.forms.count()
+ def get__administrative_entity(self, obj):
+ if (
+ obj.permit_department.is_integrator_admin
+ and obj.permit_department.administrative_entity
+ ):
+ return obj.permit_department.administrative_entity
+
+ get__administrative_entity.short_description = _("Entité administrative")
+
+ def get__forms_number(self, obj):
+ if (
+ obj.permit_department.is_integrator_admin
+ and obj.permit_department.administrative_entity
+ ):
+ return obj.permit_department.administrative_entity.forms.count()
- # get__forms_number.short_description = _("Nombre de formulaires")
+ get__forms_number.short_description = _("Nombre de formulaires")
- # def get__sites_number(self, obj):
- # if obj.permit_department.is_integrator_admin:
- # return obj.site_profiles.count()
+ def get__sites_number(self, obj):
+ if obj.permit_department.is_integrator_admin and obj.site_profiles:
+ return obj.site_profiles.count()
- # get__sites_number.short_description = _("Nombre de sites")
+ get__sites_number.short_description = _("Nombre de sites")
def get_queryset(self, request):
From 3d0e94a4368ae83b347816306081418990cf90b5 Mon Sep 17 00:00:00 2001
From: Monod Olivier
Date: Mon, 17 Apr 2023 15:33:37 +0200
Subject: [PATCH 03/23] update jquery & jquery ui
---
.../templates/accounts/user_profile_edit.html | 2 +-
.../libs/js/jquery-ui-custom/AUTHORS.txt | 41 +-
.../external/jquery/jquery.js | 8579 ++++---
.../images/ui-icons_444444_256x240.png | Bin 6991 -> 7142 bytes
.../images/ui-icons_555555_256x240.png | Bin 6987 -> 7126 bytes
.../images/ui-icons_777620_256x240.png | Bin 4547 -> 4670 bytes
.../images/ui-icons_777777_256x240.png | Bin 6998 -> 7163 bytes
.../images/ui-icons_cc0000_256x240.png | Bin 4547 -> 4670 bytes
.../images/ui-icons_ffffff_256x240.png | Bin 6298 -> 6539 bytes
.../libs/js/jquery-ui-custom/index.html | 198 +-
.../libs/js/jquery-ui-custom/jquery-ui.css | 753 +-
.../libs/js/jquery-ui-custom/jquery-ui.js | 18699 +++++++++++++++-
.../js/jquery-ui-custom/jquery-ui.min.css | 8 +-
.../libs/js/jquery-ui-custom/jquery-ui.min.js | 6 +-
.../jquery-ui-custom/jquery-ui.structure.css | 734 +-
.../jquery-ui.structure.min.css | 4 +-
.../js/jquery-ui-custom/jquery-ui.theme.css | 19 +-
.../jquery-ui-custom/jquery-ui.theme.min.css | 4 +-
.../libs/js/jquery-ui-custom/package.json | 74 +
geocity/apps/submissions/forms.py | 2 +-
geocity/fields.py | 4 +-
21 files changed, 23553 insertions(+), 5574 deletions(-)
create mode 100644 geocity/apps/core/static/libs/js/jquery-ui-custom/package.json
diff --git a/geocity/apps/accounts/templates/accounts/user_profile_edit.html b/geocity/apps/accounts/templates/accounts/user_profile_edit.html
index ba071de3f..ef855dc52 100644
--- a/geocity/apps/accounts/templates/accounts/user_profile_edit.html
+++ b/geocity/apps/accounts/templates/accounts/user_profile_edit.html
@@ -10,7 +10,7 @@
{% endblock %}
{% block scripts %}
-
+
{% endblock %}
diff --git a/geocity/apps/core/static/libs/js/jquery-ui-custom/AUTHORS.txt b/geocity/apps/core/static/libs/js/jquery-ui-custom/AUTHORS.txt
index a75056b94..0ee3fb31e 100644
--- a/geocity/apps/core/static/libs/js/jquery-ui-custom/AUTHORS.txt
+++ b/geocity/apps/core/static/libs/js/jquery-ui-custom/AUTHORS.txt
@@ -312,7 +312,7 @@ Mani Mishra
Hannah Methvin
Leonardo Balter
Benjamin Albert
-Michał Gołębiowski
+Michał Gołębiowski-Owczarek
Alyosha Pushak
Fahad Ahmad
Matt Brundage
@@ -331,3 +331,42 @@ Peter Dave Hello
Johannes Schäfer
Ville Skyttä
Ryan Oriecuia
+Sergei Ratnikov
+milk54
+Evelyn Masso
+Robin
+Simon Asika
+Kevin Cupp
+Jeremy Mickelson
+Kyle Rosenberg
+Petri Partio
+pallxk
+Luke Brookhart
+claudi
+Eirik Sletteberg
+Albert Johansson
+A. Wells
+Robert Brignull
+Horus68
+Maksymenkov Eugene
+OskarNS
+Gez Quinn
+jigar gala
+Florian Wegscheider
+Fatér Zsolt
+Szabolcs Szabolcsi-Toth
+Jérémy Munsch
+Hrvoje Novosel
+Paul Capron
+Micah Miller
+sakshi87 <53863764+sakshi87@users.noreply.github.com>
+Mikolaj Wolicki
+Patrick McKay
+c-lambert <58025159+c-lambert@users.noreply.github.com>
+Josep Sanz
+Ben Mullins
+Christian Oliff
+dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
+Adam Lidén Hällgren
+James Hinderks
+Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com>
diff --git a/geocity/apps/core/static/libs/js/jquery-ui-custom/external/jquery/jquery.js b/geocity/apps/core/static/libs/js/jquery-ui-custom/external/jquery/jquery.js
index 7fc60fca7..fc6c299b7 100644
--- a/geocity/apps/core/static/libs/js/jquery-ui-custom/external/jquery/jquery.js
+++ b/geocity/apps/core/static/libs/js/jquery-ui-custom/external/jquery/jquery.js
@@ -1,20 +1,22 @@
/*!
- * jQuery JavaScript Library v1.12.4
- * http://jquery.com/
+ * jQuery JavaScript Library v3.6.0
+ * https://jquery.com/
*
* Includes Sizzle.js
- * http://sizzlejs.com/
+ * https://sizzlejs.com/
*
- * Copyright jQuery Foundation and other contributors
+ * Copyright OpenJS Foundation and other contributors
* Released under the MIT license
- * http://jquery.org/license
+ * https://jquery.org/license
*
- * Date: 2016-05-20T17:17Z
+ * Date: 2021-03-02T17:08Z
*/
+( function( global, factory ) {
-(function( global, factory ) {
+ "use strict";
if ( typeof module === "object" && typeof module.exports === "object" ) {
+
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
@@ -35,24 +37,30 @@
}
// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//"use strict";
-var deletedIds = [];
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
-var document = window.document;
+var arr = [];
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
-var slice = deletedIds.slice;
+var flat = arr.flat ? function( array ) {
+ return arr.flat.call( array );
+} : function( array ) {
+ return arr.concat.apply( [], array );
+};
-var concat = deletedIds.concat;
-var push = deletedIds.push;
+var push = arr.push;
-var indexOf = deletedIds.indexOf;
+var indexOf = arr.indexOf;
var class2type = {};
@@ -60,12 +68,90 @@ var toString = class2type.toString;
var hasOwn = class2type.hasOwnProperty;
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
var support = {};
+var isFunction = function isFunction( obj ) {
+
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML