umap-project 1.10.0__py3-none-any.whl → 1.11.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of umap-project might be problematic. Click here for more details.

Files changed (181) hide show
  1. umap/__init__.py +1 -1
  2. umap/admin.py +7 -3
  3. umap/autocomplete.py +3 -5
  4. umap/bin/__init__.py +2 -5
  5. umap/decorators.py +4 -5
  6. umap/forms.py +5 -5
  7. umap/locale/en/LC_MESSAGES/django.po +23 -23
  8. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  9. umap/locale/fr/LC_MESSAGES/django.po +28 -27
  10. umap/management/commands/generate_js_locale.py +9 -11
  11. umap/management/commands/import_pictograms.py +49 -28
  12. umap/managers.py +5 -3
  13. umap/middleware.py +2 -3
  14. umap/migrations/0001_initial.py +204 -56
  15. umap/migrations/0002_tilelayer_tms.py +3 -4
  16. umap/migrations/0003_add_tilelayer.py +13 -9
  17. umap/migrations/0004_add_licence.py +3 -6
  18. umap/migrations/0005_remove_map_tilelayer.py +3 -4
  19. umap/migrations/0006_auto_20190407_0719.py +6 -5
  20. umap/migrations/0007_auto_20190416_1757.py +13 -5
  21. umap/migrations/0008_alter_map_settings.py +0 -1
  22. umap/migrations/0009_star.py +27 -8
  23. umap/migrations/0010_alter_map_edit_status_alter_map_share_status.py +20 -8
  24. umap/migrations/0011_alter_map_edit_status_alter_map_share_status.py +21 -8
  25. umap/migrations/0014_map_created_at.py +1 -1
  26. umap/migrations/0015_alter_pictogram_pictogram.py +17 -0
  27. umap/migrations/0016_pictogram_category.py +17 -0
  28. umap/models.py +9 -7
  29. umap/settings/base.py +1 -4
  30. umap/static/umap/base.css +59 -20
  31. umap/static/umap/content.css +2 -13
  32. umap/static/umap/favicons/apple-touch-icon.png +0 -0
  33. umap/static/umap/favicons/favicon.ico +0 -0
  34. umap/static/umap/favicons/icon-192.png +0 -0
  35. umap/static/umap/favicons/icon-512.png +0 -0
  36. umap/static/umap/favicons/icon.svg +5 -0
  37. umap/static/umap/img/16-white.svg +20 -9
  38. umap/static/umap/img/24-white.svg +2 -2
  39. umap/static/umap/img/source/16-white.svg +25 -13
  40. umap/static/umap/img/source/24-white.svg +5 -5
  41. umap/static/umap/js/umap.controls.js +15 -23
  42. umap/static/umap/js/umap.core.js +33 -24
  43. umap/static/umap/js/umap.features.js +24 -2
  44. umap/static/umap/js/umap.forms.js +182 -84
  45. umap/static/umap/js/umap.icon.js +19 -14
  46. umap/static/umap/js/umap.js +14 -32
  47. umap/static/umap/js/umap.layer.js +13 -2
  48. umap/static/umap/js/umap.popup.js +21 -0
  49. umap/static/umap/locale/am_ET.js +9 -4
  50. umap/static/umap/locale/am_ET.json +9 -4
  51. umap/static/umap/locale/ar.js +9 -4
  52. umap/static/umap/locale/ar.json +9 -4
  53. umap/static/umap/locale/ast.js +9 -4
  54. umap/static/umap/locale/ast.json +9 -4
  55. umap/static/umap/locale/bg.js +9 -4
  56. umap/static/umap/locale/bg.json +9 -4
  57. umap/static/umap/locale/br.js +20 -15
  58. umap/static/umap/locale/br.json +20 -15
  59. umap/static/umap/locale/ca.js +9 -4
  60. umap/static/umap/locale/ca.json +9 -4
  61. umap/static/umap/locale/cs_CZ.js +9 -4
  62. umap/static/umap/locale/cs_CZ.json +9 -4
  63. umap/static/umap/locale/da.js +9 -4
  64. umap/static/umap/locale/da.json +9 -4
  65. umap/static/umap/locale/de.js +9 -4
  66. umap/static/umap/locale/de.json +9 -4
  67. umap/static/umap/locale/el.js +9 -4
  68. umap/static/umap/locale/el.json +9 -4
  69. umap/static/umap/locale/en.js +9 -4
  70. umap/static/umap/locale/en.json +9 -4
  71. umap/static/umap/locale/en_US.json +9 -4
  72. umap/static/umap/locale/es.js +15 -10
  73. umap/static/umap/locale/es.json +15 -10
  74. umap/static/umap/locale/et.js +9 -4
  75. umap/static/umap/locale/et.json +9 -4
  76. umap/static/umap/locale/fa_IR.js +9 -4
  77. umap/static/umap/locale/fa_IR.json +9 -4
  78. umap/static/umap/locale/fi.js +9 -4
  79. umap/static/umap/locale/fi.json +9 -4
  80. umap/static/umap/locale/fr.js +10 -5
  81. umap/static/umap/locale/fr.json +10 -5
  82. umap/static/umap/locale/gl.js +9 -4
  83. umap/static/umap/locale/gl.json +9 -4
  84. umap/static/umap/locale/he.js +9 -4
  85. umap/static/umap/locale/he.json +9 -4
  86. umap/static/umap/locale/hr.js +9 -4
  87. umap/static/umap/locale/hr.json +9 -4
  88. umap/static/umap/locale/hu.js +64 -59
  89. umap/static/umap/locale/hu.json +64 -59
  90. umap/static/umap/locale/id.js +9 -4
  91. umap/static/umap/locale/id.json +9 -4
  92. umap/static/umap/locale/is.js +9 -4
  93. umap/static/umap/locale/is.json +9 -4
  94. umap/static/umap/locale/it.js +9 -4
  95. umap/static/umap/locale/it.json +9 -4
  96. umap/static/umap/locale/ja.js +9 -4
  97. umap/static/umap/locale/ja.json +9 -4
  98. umap/static/umap/locale/ko.js +9 -4
  99. umap/static/umap/locale/ko.json +9 -4
  100. umap/static/umap/locale/lt.js +9 -4
  101. umap/static/umap/locale/lt.json +9 -4
  102. umap/static/umap/locale/ms.js +15 -10
  103. umap/static/umap/locale/ms.json +15 -10
  104. umap/static/umap/locale/nl.js +9 -4
  105. umap/static/umap/locale/nl.json +9 -4
  106. umap/static/umap/locale/no.js +9 -4
  107. umap/static/umap/locale/no.json +9 -4
  108. umap/static/umap/locale/pl.js +9 -4
  109. umap/static/umap/locale/pl.json +9 -4
  110. umap/static/umap/locale/pl_PL.json +9 -4
  111. umap/static/umap/locale/pt.js +9 -4
  112. umap/static/umap/locale/pt.json +9 -4
  113. umap/static/umap/locale/pt_BR.js +9 -4
  114. umap/static/umap/locale/pt_BR.json +9 -4
  115. umap/static/umap/locale/pt_PT.js +9 -4
  116. umap/static/umap/locale/pt_PT.json +9 -4
  117. umap/static/umap/locale/ro.js +9 -4
  118. umap/static/umap/locale/ro.json +9 -4
  119. umap/static/umap/locale/ru.js +9 -4
  120. umap/static/umap/locale/ru.json +9 -4
  121. umap/static/umap/locale/si.js +55 -20
  122. umap/static/umap/locale/si.json +55 -20
  123. umap/static/umap/locale/sk_SK.js +9 -4
  124. umap/static/umap/locale/sk_SK.json +9 -4
  125. umap/static/umap/locale/sl.js +9 -4
  126. umap/static/umap/locale/sl.json +9 -4
  127. umap/static/umap/locale/sr.js +9 -4
  128. umap/static/umap/locale/sr.json +9 -4
  129. umap/static/umap/locale/sv.js +9 -4
  130. umap/static/umap/locale/sv.json +9 -4
  131. umap/static/umap/locale/th_TH.js +9 -4
  132. umap/static/umap/locale/th_TH.json +9 -4
  133. umap/static/umap/locale/tr.js +9 -4
  134. umap/static/umap/locale/tr.json +9 -4
  135. umap/static/umap/locale/uk_UA.js +9 -4
  136. umap/static/umap/locale/uk_UA.json +9 -4
  137. umap/static/umap/locale/vi.js +9 -4
  138. umap/static/umap/locale/vi.json +9 -4
  139. umap/static/umap/locale/vi_VN.json +9 -4
  140. umap/static/umap/locale/zh.js +9 -4
  141. umap/static/umap/locale/zh.json +9 -4
  142. umap/static/umap/locale/zh_CN.json +9 -4
  143. umap/static/umap/locale/zh_TW.Big5.json +9 -4
  144. umap/static/umap/locale/zh_TW.js +9 -4
  145. umap/static/umap/locale/zh_TW.json +9 -4
  146. umap/static/umap/map.css +104 -21
  147. umap/static/umap/nav.css +0 -1
  148. umap/static/umap/test/Controls.js +0 -1
  149. umap/static/umap/test/Feature.js +29 -0
  150. umap/static/umap/test/Map.Export.js +2 -127
  151. umap/static/umap/test/Util.js +10 -0
  152. umap/static/umap/test/_pre.js +2 -3
  153. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +13 -2
  154. umap/static/umap/vendors/leaflet/leaflet-src.js +7144 -7144
  155. umap/templates/auth/user_form.html +2 -2
  156. umap/templates/base.html +11 -0
  157. umap/templates/umap/map_table.html +3 -3
  158. umap/templatetags/umap_tags.py +32 -34
  159. umap/tests/base.py +4 -4
  160. umap/tests/conftest.py +3 -6
  161. umap/tests/fixtures/circle.svg +4 -0
  162. umap/tests/fixtures/star.svg +4 -0
  163. umap/tests/integration/test_export_map.py +5 -18
  164. umap/tests/integration/test_picto.py +217 -0
  165. umap/tests/integration/test_slideshow.py +70 -0
  166. umap/tests/settings.py +11 -5
  167. umap/tests/test_datalayer.py +7 -6
  168. umap/tests/test_map.py +6 -5
  169. umap/tests/test_map_views.py +82 -10
  170. umap/tests/test_tilelayer.py +17 -11
  171. umap/tests/test_views.py +36 -9
  172. umap/urls.py +27 -4
  173. umap/utils.py +1 -2
  174. umap/views.py +67 -35
  175. umap/wsgi.py +2 -2
  176. {umap_project-1.10.0.dist-info → umap_project-1.11.1.dist-info}/METADATA +11 -9
  177. {umap_project-1.10.0.dist-info → umap_project-1.11.1.dist-info}/RECORD +180 -170
  178. umap/static/favicon.ico +0 -0
  179. {umap_project-1.10.0.dist-info → umap_project-1.11.1.dist-info}/WHEEL +0 -0
  180. {umap_project-1.10.0.dist-info → umap_project-1.11.1.dist-info}/entry_points.txt +0 -0
  181. {umap_project-1.10.0.dist-info → umap_project-1.11.1.dist-info}/licenses/LICENSE +0 -0
umap/__init__.py CHANGED
@@ -1 +1 @@
1
- VERSION = "1.10.0"
1
+ VERSION = "1.11.1"
umap/admin.py CHANGED
@@ -1,10 +1,14 @@
1
1
  from django.contrib.gis import admin
2
- from .models import Map, DataLayer, Pictogram, TileLayer, Licence
2
+
3
+ from .models import DataLayer, Licence, Map, Pictogram, TileLayer
3
4
 
4
5
 
5
6
  class TileLayerAdmin(admin.ModelAdmin):
6
- list_display = ('name', 'rank', )
7
- list_editable = ('rank', )
7
+ list_display = (
8
+ "name",
9
+ "rank",
10
+ )
11
+ list_editable = ("rank",)
8
12
 
9
13
 
10
14
  class MapAdmin(admin.GISModelAdmin):
umap/autocomplete.py CHANGED
@@ -1,11 +1,9 @@
1
+ from agnocomplete.core import AgnocompleteModel
2
+ from agnocomplete.register import register
1
3
  from django.conf import settings
2
4
  from django.contrib.auth import get_user_model
3
5
 
4
6
 
5
- from agnocomplete.register import register
6
- from agnocomplete.core import AgnocompleteModel
7
-
8
-
9
7
  @register
10
8
  class AutocompleteUser(AgnocompleteModel):
11
9
  model = get_user_model()
@@ -13,5 +11,5 @@ class AutocompleteUser(AgnocompleteModel):
13
11
 
14
12
  def item(self, current_item):
15
13
  data = super().item(current_item)
16
- data['url'] = current_item.get_url()
14
+ data["url"] = current_item.get_url()
17
15
  return data
umap/bin/__init__.py CHANGED
@@ -5,12 +5,9 @@ from django.core import management
5
5
 
6
6
 
7
7
  def main():
8
- os.environ.setdefault(
9
- "DJANGO_SETTINGS_MODULE",
10
- "umap.settings"
11
- )
8
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "umap.settings")
12
9
  management.execute_from_command_line()
13
10
 
14
11
 
15
- if __name__ == '__main__':
12
+ if __name__ == "__main__":
16
13
  main()
umap/decorators.py CHANGED
@@ -1,13 +1,12 @@
1
1
  from functools import wraps
2
2
 
3
- from django.urls import reverse_lazy
4
- from django.shortcuts import get_object_or_404
5
- from django.http import HttpResponseForbidden
6
3
  from django.conf import settings
4
+ from django.http import HttpResponseForbidden
5
+ from django.shortcuts import get_object_or_404
6
+ from django.urls import reverse_lazy
7
7
 
8
- from .views import simple_json_response
9
8
  from .models import Map
10
-
9
+ from .views import simple_json_response
11
10
 
12
11
  LOGIN_URL = getattr(settings, "LOGIN_URL", "login")
13
12
  LOGIN_URL = reverse_lazy(LOGIN_URL) if not LOGIN_URL.startswith("/") else LOGIN_URL
umap/forms.py CHANGED
@@ -1,12 +1,12 @@
1
1
  from django import forms
2
- from django.contrib.gis.geos import Point
3
- from django.contrib.auth import get_user_model
4
- from django.utils.translation import gettext_lazy as _
5
- from django.template.defaultfilters import slugify
6
2
  from django.conf import settings
3
+ from django.contrib.auth import get_user_model
4
+ from django.contrib.gis.geos import Point
7
5
  from django.forms.utils import ErrorList
6
+ from django.template.defaultfilters import slugify
7
+ from django.utils.translation import gettext_lazy as _
8
8
 
9
- from .models import Map, DataLayer
9
+ from .models import DataLayer, Map
10
10
 
11
11
  DEFAULT_LATITUDE = (
12
12
  settings.LEAFLET_LATITUDE if hasattr(settings, "LEAFLET_LATITUDE") else 51
@@ -8,7 +8,7 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: PACKAGE VERSION\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2023-10-12 06:55+0000\n"
11
+ "POT-Creation-Date: 2023-11-27 08:30+0000\n"
12
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -25,11 +25,11 @@ msgstr ""
25
25
  msgid "Everyone can edit"
26
26
  msgstr ""
27
27
 
28
- #: forms.py:69 models.py:318
28
+ #: forms.py:69 models.py:320
29
29
  msgid "Inherit"
30
30
  msgstr ""
31
31
 
32
- #: middleware.py:14
32
+ #: middleware.py:13
33
33
  msgid "Site is readonly for maintenance"
34
34
  msgstr ""
35
35
 
@@ -53,15 +53,15 @@ msgstr ""
53
53
  msgid "Order of the tilelayers in the edit box"
54
54
  msgstr ""
55
55
 
56
- #: models.py:142 models.py:319
56
+ #: models.py:142 models.py:321
57
57
  msgid "Everyone"
58
58
  msgstr ""
59
59
 
60
- #: models.py:143 models.py:149 models.py:320
60
+ #: models.py:143 models.py:149 models.py:322
61
61
  msgid "Editors only"
62
62
  msgstr ""
63
63
 
64
- #: models.py:144 models.py:321
64
+ #: models.py:144 models.py:323
65
65
  msgid "Owner only"
66
66
  msgstr ""
67
67
 
@@ -77,7 +77,7 @@ msgstr ""
77
77
  msgid "Blocked"
78
78
  msgstr ""
79
79
 
80
- #: models.py:153 models.py:325
80
+ #: models.py:153 models.py:327
81
81
  msgid "description"
82
82
  msgstr ""
83
83
 
@@ -113,7 +113,7 @@ msgstr ""
113
113
  msgid "editors"
114
114
  msgstr ""
115
115
 
116
- #: models.py:182 models.py:339
116
+ #: models.py:182 models.py:341
117
117
  msgid "edit status"
118
118
  msgstr ""
119
119
 
@@ -121,7 +121,7 @@ msgstr ""
121
121
  msgid "share status"
122
122
  msgstr ""
123
123
 
124
- #: models.py:190 models.py:334
124
+ #: models.py:190 models.py:336
125
125
  msgid "settings"
126
126
  msgstr ""
127
127
 
@@ -129,11 +129,11 @@ msgstr ""
129
129
  msgid "Clone of"
130
130
  msgstr ""
131
131
 
132
- #: models.py:329
132
+ #: models.py:331
133
133
  msgid "display on load"
134
134
  msgstr ""
135
135
 
136
- #: models.py:330
136
+ #: models.py:332
137
137
  msgid "Display this layer on load."
138
138
  msgstr ""
139
139
 
@@ -290,7 +290,7 @@ msgstr ""
290
290
  msgid "You are logged in. Continuing..."
291
291
  msgstr ""
292
292
 
293
- #: templates/umap/map_list.html:9 views.py:303
293
+ #: templates/umap/map_list.html:9 views.py:290
294
294
  msgid "by"
295
295
  msgstr ""
296
296
 
@@ -431,52 +431,52 @@ msgstr ""
431
431
  msgid "You have no map yet."
432
432
  msgstr ""
433
433
 
434
- #: views.py:308
434
+ #: views.py:295
435
435
  msgid "View the map"
436
436
  msgstr ""
437
437
 
438
- #: views.py:659
438
+ #: views.py:670
439
439
  msgid "Map has been updated!"
440
440
  msgstr ""
441
441
 
442
- #: views.py:684
442
+ #: views.py:695
443
443
  msgid "Map editors updated with success!"
444
444
  msgstr ""
445
445
 
446
- #: views.py:722
446
+ #: views.py:733
447
447
  #, python-format
448
448
  msgid "The uMap edit link for your map: %(map_name)s"
449
449
  msgstr ""
450
450
 
451
- #: views.py:725
451
+ #: views.py:736
452
452
  #, python-format
453
453
  msgid "Here is your secret edit link: %(link)s"
454
454
  msgstr ""
455
455
 
456
- #: views.py:731
456
+ #: views.py:742
457
457
  #, python-format
458
458
  msgid "Email sent to %(email)s"
459
459
  msgstr ""
460
460
 
461
- #: views.py:742
461
+ #: views.py:753
462
462
  msgid "Only its owner can delete the map."
463
463
  msgstr ""
464
464
 
465
- #: views.py:765
465
+ #: views.py:776
466
466
  #, python-format
467
467
  msgid ""
468
468
  "Your map has been cloned! If you want to edit this map from another "
469
469
  "computer, please use this link: %(anonymous_url)s"
470
470
  msgstr ""
471
471
 
472
- #: views.py:770
472
+ #: views.py:781
473
473
  msgid "Congratulations, your map has been cloned!"
474
474
  msgstr ""
475
475
 
476
- #: views.py:959
476
+ #: views.py:970
477
477
  msgid "Layer successfully deleted."
478
478
  msgstr ""
479
479
 
480
- #: views.py:981
480
+ #: views.py:992
481
481
  msgid "Permissions updated with success!"
482
482
  msgstr ""
Binary file
@@ -14,6 +14,7 @@
14
14
  # severin.menard <severin.menard@protonmail.com>, 2014
15
15
  # spf, 2019
16
16
  # spf, 2019
17
+ # Syl Martin, 2023
17
18
  # Philippe Verdy, 2017
18
19
  # yohanboniface <yohanboniface@free.fr>, 2013-2014,2018-2019,2023
19
20
  # YOHAN BONIFACE <yb@enix.org>, 2012
@@ -22,9 +23,9 @@ msgid ""
22
23
  msgstr ""
23
24
  "Project-Id-Version: uMap\n"
24
25
  "Report-Msgid-Bugs-To: \n"
25
- "POT-Creation-Date: 2023-09-22 16:21+0000\n"
26
+ "POT-Creation-Date: 2023-10-12 06:55+0000\n"
26
27
  "PO-Revision-Date: 2013-11-22 14:00+0000\n"
27
- "Last-Translator: yohanboniface <yohanboniface@free.fr>, 2013-2014,2018-2019,2023\n"
28
+ "Last-Translator: Syl Martin, 2023\n"
28
29
  "Language-Team: French (http://app.transifex.com/openstreetmap/umap/language/fr/)\n"
29
30
  "MIME-Version: 1.0\n"
30
31
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -40,7 +41,7 @@ msgstr "Modifiable seulement avec le lien de modification secret"
40
41
  msgid "Everyone can edit"
41
42
  msgstr "Tout le monde peut modifier"
42
43
 
43
- #: forms.py:69 models.py:317
44
+ #: forms.py:69 models.py:318
44
45
  msgid "Inherit"
45
46
  msgstr "Par défaut"
46
47
 
@@ -68,15 +69,15 @@ msgstr "Modèle d'URL au format des tuiles OSM"
68
69
  msgid "Order of the tilelayers in the edit box"
69
70
  msgstr "Ordre des calques de tuiles dans le panneau de modification"
70
71
 
71
- #: models.py:142 models.py:318
72
+ #: models.py:142 models.py:319
72
73
  msgid "Everyone"
73
74
  msgstr "Tout le monde"
74
75
 
75
- #: models.py:143 models.py:149 models.py:319
76
+ #: models.py:143 models.py:149 models.py:320
76
77
  msgid "Editors only"
77
78
  msgstr "Éditeurs uniquement"
78
79
 
79
- #: models.py:144 models.py:320
80
+ #: models.py:144 models.py:321
80
81
  msgid "Owner only"
81
82
  msgstr "Propriétaire uniquement"
82
83
 
@@ -92,7 +93,7 @@ msgstr "Quiconque a le lien"
92
93
  msgid "Blocked"
93
94
  msgstr "Bloquée"
94
95
 
95
- #: models.py:153 models.py:324
96
+ #: models.py:153 models.py:325
96
97
  msgid "description"
97
98
  msgstr "description"
98
99
 
@@ -120,35 +121,35 @@ msgstr "Choisir une licence pour la carte"
120
121
  msgid "licence"
121
122
  msgstr "licence"
122
123
 
123
- #: models.py:172
124
+ #: models.py:173
124
125
  msgid "owner"
125
126
  msgstr "créateur"
126
127
 
127
- #: models.py:176
128
+ #: models.py:177
128
129
  msgid "editors"
129
130
  msgstr "éditeurs"
130
131
 
131
- #: models.py:181 models.py:338
132
+ #: models.py:182 models.py:339
132
133
  msgid "edit status"
133
134
  msgstr "statut de modification"
134
135
 
135
- #: models.py:186
136
+ #: models.py:187
136
137
  msgid "share status"
137
138
  msgstr "qui a accès"
138
139
 
139
- #: models.py:189 models.py:333
140
+ #: models.py:190 models.py:334
140
141
  msgid "settings"
141
142
  msgstr "réglages"
142
143
 
143
- #: models.py:268
144
+ #: models.py:269
144
145
  msgid "Clone of"
145
146
  msgstr "Clone de"
146
147
 
147
- #: models.py:328
148
+ #: models.py:329
148
149
  msgid "display on load"
149
150
  msgstr "afficher au chargement."
150
151
 
151
- #: models.py:329
152
+ #: models.py:330
152
153
  msgid "Display this layer on load."
153
154
  msgstr "Afficher ce calque au chargement."
154
155
 
@@ -254,7 +255,7 @@ msgstr "Gérer les options de la carte : afficher une minicarte, géolocaliser l
254
255
 
255
256
  #: templates/umap/about_summary.html:25
256
257
  msgid "Batch import geostructured data (geojson, gpx, kml, osm...)"
257
- msgstr "Import des données géographiques en masse (geojson, gpx, kml, osm...)"
258
+ msgstr "Importer des données géographiques en masse (geojson, gpx, kml, osm...)"
258
259
 
259
260
  #: templates/umap/about_summary.html:26
260
261
  msgid "Choose the license for your data"
@@ -282,7 +283,7 @@ msgstr "Tester la démo"
282
283
  msgid ""
283
284
  "This instance of uMap is currently in read only mode, no creation/edit is "
284
285
  "allowed."
285
- msgstr "uMap est actuelle en mode lecture seule, aucune création ou modification n'est possible."
286
+ msgstr "uMap est actuellement en mode lecture seule, aucune création ou modification n'est possible."
286
287
 
287
288
  #: templates/umap/content.html:31
288
289
  #, python-format
@@ -451,48 +452,48 @@ msgstr "Vous n'avez pas encore de carte."
451
452
  msgid "View the map"
452
453
  msgstr "Voir la carte"
453
454
 
454
- #: views.py:658
455
+ #: views.py:659
455
456
  msgid "Map has been updated!"
456
457
  msgstr "La carte a été mise à jour !"
457
458
 
458
- #: views.py:683
459
+ #: views.py:684
459
460
  msgid "Map editors updated with success!"
460
461
  msgstr "Éditeurs de la carte mis à jour !"
461
462
 
462
- #: views.py:721
463
+ #: views.py:722
463
464
  #, python-format
464
465
  msgid "The uMap edit link for your map: %(map_name)s"
465
466
  msgstr "La lien d'édition uMap pour votre carte %(map_name)s"
466
467
 
467
- #: views.py:724
468
+ #: views.py:725
468
469
  #, python-format
469
470
  msgid "Here is your secret edit link: %(link)s"
470
471
  msgstr "Voici votre lien d'édition secret: %(link)s"
471
472
 
472
- #: views.py:730
473
+ #: views.py:731
473
474
  #, python-format
474
475
  msgid "Email sent to %(email)s"
475
476
  msgstr "Courriel envoyé à %(email)s"
476
477
 
477
- #: views.py:741
478
+ #: views.py:742
478
479
  msgid "Only its owner can delete the map."
479
480
  msgstr "Seul le créateur de la carte peut la supprimer."
480
481
 
481
- #: views.py:764
482
+ #: views.py:765
482
483
  #, python-format
483
484
  msgid ""
484
485
  "Your map has been cloned! If you want to edit this map from another "
485
486
  "computer, please use this link: %(anonymous_url)s"
486
487
  msgstr "Votre carte a été dupliquée ! Si vous souhaitez la modifier depuis un autre ordinateur, veuillez utiliser ce lien : %(anonymous_url)s"
487
488
 
488
- #: views.py:769
489
+ #: views.py:770
489
490
  msgid "Congratulations, your map has been cloned!"
490
491
  msgstr "Votre carte a été dupliquée !"
491
492
 
492
- #: views.py:958
493
+ #: views.py:959
493
494
  msgid "Layer successfully deleted."
494
495
  msgstr "Calque supprimé."
495
496
 
496
- #: views.py:980
497
+ #: views.py:981
497
498
  msgid "Permissions updated with success!"
498
499
  msgstr "Les permissions ont bien été modifiées !"
@@ -1,24 +1,23 @@
1
1
  from pathlib import Path
2
2
 
3
- from django.core.management.base import BaseCommand
4
3
  from django.conf import settings
4
+ from django.core.management.base import BaseCommand
5
5
  from django.template.loader import render_to_string
6
6
  from django.utils.translation import to_locale
7
7
 
8
- ROOT = Path(settings.PROJECT_DIR) / 'static/umap/locale/'
8
+ ROOT = Path(settings.PROJECT_DIR) / "static/umap/locale/"
9
9
 
10
10
 
11
11
  class Command(BaseCommand):
12
-
13
12
  def handle(self, *args, **options):
14
- self.verbosity = options['verbosity']
13
+ self.verbosity = options["verbosity"]
15
14
  for code, name in settings.LANGUAGES:
16
15
  code = to_locale(code)
17
16
  if self.verbosity > 0:
18
17
  print("Processing", name)
19
- path = ROOT / '{code}.json'.format(code=code)
18
+ path = ROOT / "{code}.json".format(code=code)
20
19
  if not path.exists():
21
- print(path, 'does not exist.', 'Skipping')
20
+ print(path, "does not exist.", "Skipping")
22
21
  else:
23
22
  with path.open(encoding="utf-8") as f:
24
23
  if self.verbosity > 1:
@@ -26,12 +25,11 @@ class Command(BaseCommand):
26
25
  self.render(code, f.read())
27
26
 
28
27
  def render(self, code, json):
29
- path = ROOT / '{code}.js'.format(code=code)
28
+ path = ROOT / "{code}.js".format(code=code)
30
29
  with path.open("w", encoding="utf-8") as f:
31
- content = render_to_string('umap/locale.js', {
32
- "locale": json,
33
- "locale_code": code
34
- })
30
+ content = render_to_string(
31
+ "umap/locale.js", {"locale": json, "locale_code": code}
32
+ )
35
33
  if self.verbosity > 1:
36
34
  print("Exporting to", path)
37
35
  f.write(content)
@@ -1,4 +1,4 @@
1
- import os
1
+ from pathlib import Path
2
2
 
3
3
  from django.core.files import File
4
4
  from django.core.management.base import BaseCommand
@@ -7,40 +7,61 @@ from umap.models import Pictogram
7
7
 
8
8
 
9
9
  class Command(BaseCommand):
10
- help = 'Import pictograms from a folder'
10
+ help = "Import pictograms from a folder"
11
11
 
12
12
  def add_arguments(self, parser):
13
- parser.add_argument('path')
14
- parser.add_argument('--attribution', required=True,
15
- help='Attribution of the imported pictograms')
16
- parser.add_argument('--suffix',
17
- help='Optional suffix to add to each name')
18
- parser.add_argument('--force', action='store_true',
19
- help='Update picto if it already exists.')
13
+ parser.add_argument("path")
14
+ parser.add_argument(
15
+ "--attribution",
16
+ required=True,
17
+ help="Attribution of the imported pictograms",
18
+ )
19
+ parser.add_argument(
20
+ "--extensions",
21
+ help="Optional list of extensins to process",
22
+ nargs="+",
23
+ default=[".svg"],
24
+ )
25
+ parser.add_argument(
26
+ "--exclude",
27
+ help="Optional list of files or dirs to exclude",
28
+ nargs="+",
29
+ default=["font"],
30
+ )
31
+ parser.add_argument(
32
+ "--force", action="store_true", help="Update picto if it already exists."
33
+ )
20
34
 
21
35
  def handle(self, *args, **options):
22
- path = options['path']
23
- attribution = options['attribution']
24
- suffix = options['suffix']
25
- force = options['force']
26
- for filename in os.listdir(path):
27
- if filename.endswith("-24.png"):
28
- name = self.extract_name(filename)
29
- if suffix:
30
- name = '{name}{suffix}'.format(name=name, suffix=suffix)
36
+ self.path = Path(options["path"])
37
+ self.attribution = options["attribution"]
38
+ self.extensions = options["extensions"]
39
+ self.force = options["force"]
40
+ self.exclude = options["exclude"]
41
+ self.handle_directory(self.path)
42
+
43
+ def handle_directory(self, path):
44
+ for filename in path.iterdir():
45
+ if filename.name in self.exclude:
46
+ continue
47
+ if filename.is_dir():
48
+ self.handle_directory(filename)
49
+ continue
50
+ if filename.suffix in self.extensions:
51
+ name = filename.stem
31
52
  picto = Pictogram.objects.filter(name=name).last()
32
53
  if picto:
33
- if not force:
34
- self.stdout.write(u"⚠ Pictogram with name '{name}' already exists. Skipping.".format(name=name)) # noqa
54
+ if not self.force:
55
+ self.stdout.write(
56
+ f"⚠ Pictogram with name '{name}' already exists. Skipping."
57
+ )
35
58
  continue
36
59
  else:
37
60
  picto = Pictogram()
38
61
  picto.name = name
39
- filepath = os.path.join(path, filename)
40
- with open(filepath, 'rb') as f:
41
- picto.attribution = attribution
42
- picto.pictogram.save(filename, File(f), save=True)
43
- self.stdout.write(u"✔ Imported pictogram {filename}.".format(filename=filename)) # noqa
44
-
45
- def extract_name(self, filename):
46
- return filename[:-7].replace('-', ' ')
62
+ if path.name != self.path.name: # Subfolders only
63
+ picto.category = path.name
64
+ picto.attribution = self.attribution
65
+ with (path / filename).open("rb") as f:
66
+ picto.pictogram.save(filename.name, File(f), save=True)
67
+ self.stdout.write(f"✔ Imported pictogram {filename}.")
umap/managers.py CHANGED
@@ -2,7 +2,9 @@ from django.db.models import Manager
2
2
 
3
3
 
4
4
  class PublicManager(Manager):
5
-
6
5
  def get_queryset(self):
7
- return super(PublicManager, self).get_queryset().filter(
8
- share_status=self.model.PUBLIC)
6
+ return (
7
+ super(PublicManager, self)
8
+ .get_queryset()
9
+ .filter(share_status=self.model.PUBLIC)
10
+ )
umap/middleware.py CHANGED
@@ -5,13 +5,12 @@ from django.utils.translation import gettext as _
5
5
 
6
6
 
7
7
  def readonly_middleware(get_response):
8
-
9
8
  if not settings.UMAP_READONLY:
10
9
  raise MiddlewareNotUsed
11
10
 
12
11
  def middleware(request):
13
- if request.method not in ['GET', 'OPTIONS']:
14
- return HttpResponseForbidden(_('Site is readonly for maintenance'))
12
+ if request.method not in ["GET", "OPTIONS"]:
13
+ return HttpResponseForbidden(_("Site is readonly for maintenance"))
15
14
 
16
15
  return get_response(request)
17
16