umap-project 3.0.6__py3-none-any.whl → 3.1.0__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 (142) hide show
  1. umap/__init__.py +1 -1
  2. umap/forms.py +1 -1
  3. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/br/LC_MESSAGES/django.po +219 -72
  5. umap/locale/ca/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/ca/LC_MESSAGES/django.po +286 -95
  7. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  8. umap/locale/cs_CZ/LC_MESSAGES/django.po +211 -65
  9. umap/locale/da/LC_MESSAGES/django.mo +0 -0
  10. umap/locale/da/LC_MESSAGES/django.po +394 -202
  11. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  12. umap/locale/de/LC_MESSAGES/django.po +146 -75
  13. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  14. umap/locale/el/LC_MESSAGES/django.po +125 -59
  15. umap/locale/en/LC_MESSAGES/django.po +124 -58
  16. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  17. umap/locale/es/LC_MESSAGES/django.po +125 -59
  18. umap/locale/et/LC_MESSAGES/django.mo +0 -0
  19. umap/locale/et/LC_MESSAGES/django.po +210 -64
  20. umap/locale/eu/LC_MESSAGES/django.mo +0 -0
  21. umap/locale/eu/LC_MESSAGES/django.po +212 -65
  22. umap/locale/fa_IR/LC_MESSAGES/django.mo +0 -0
  23. umap/locale/fa_IR/LC_MESSAGES/django.po +286 -95
  24. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  25. umap/locale/fr/LC_MESSAGES/django.po +125 -59
  26. umap/locale/gl/LC_MESSAGES/django.mo +0 -0
  27. umap/locale/gl/LC_MESSAGES/django.po +212 -66
  28. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  29. umap/locale/hu/LC_MESSAGES/django.po +148 -78
  30. umap/locale/is/LC_MESSAGES/django.mo +0 -0
  31. umap/locale/is/LC_MESSAGES/django.po +130 -60
  32. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  33. umap/locale/it/LC_MESSAGES/django.po +125 -59
  34. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  35. umap/locale/ms/LC_MESSAGES/django.po +289 -98
  36. umap/locale/nl/LC_MESSAGES/django.mo +0 -0
  37. umap/locale/nl/LC_MESSAGES/django.po +128 -61
  38. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  39. umap/locale/pl/LC_MESSAGES/django.po +287 -96
  40. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  41. umap/locale/pt/LC_MESSAGES/django.po +211 -65
  42. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  43. umap/locale/zh_TW/LC_MESSAGES/django.po +212 -66
  44. umap/management/commands/migrate_to_S3.py +42 -20
  45. umap/management/commands/purge_old_versions.py +63 -0
  46. umap/management/commands/switch_user.py +52 -0
  47. umap/managers.py +29 -2
  48. umap/middleware.py +1 -1
  49. umap/migrations/0028_map_is_template.py +21 -0
  50. umap/models.py +14 -4
  51. umap/settings/base.py +22 -0
  52. umap/static/umap/base.css +4 -2
  53. umap/static/umap/content.css +1 -1
  54. umap/static/umap/css/dialog.css +5 -2
  55. umap/static/umap/css/form.css +19 -12
  56. umap/static/umap/css/icon.css +6 -0
  57. umap/static/umap/css/importers.css +4 -0
  58. umap/static/umap/css/panel.css +2 -0
  59. umap/static/umap/img/16-white.svg +5 -1
  60. umap/static/umap/img/16.svg +1 -1
  61. umap/static/umap/img/24-white.svg +3 -2
  62. umap/static/umap/img/24.svg +3 -4
  63. umap/static/umap/img/importers/opendata.svg +1 -0
  64. umap/static/umap/img/source/16-white.svg +8 -4
  65. umap/static/umap/img/source/16.svg +1 -1
  66. umap/static/umap/img/source/24-white.svg +5 -4
  67. umap/static/umap/img/source/24.svg +5 -6
  68. umap/static/umap/js/components/modal.js +27 -0
  69. umap/static/umap/js/modules/caption.js +4 -4
  70. umap/static/umap/js/modules/data/features.js +40 -4
  71. umap/static/umap/js/modules/data/layer.js +208 -138
  72. umap/static/umap/js/modules/form/builder.js +6 -14
  73. umap/static/umap/js/modules/form/fields.js +2 -2
  74. umap/static/umap/js/modules/help.js +11 -3
  75. umap/static/umap/js/modules/importer.js +7 -4
  76. umap/static/umap/js/modules/importers/opendata.js +142 -0
  77. umap/static/umap/js/modules/permissions.js +3 -3
  78. umap/static/umap/js/modules/rendering/controls.js +34 -2
  79. umap/static/umap/js/modules/rendering/icon.js +2 -2
  80. umap/static/umap/js/modules/rendering/layers/base.js +1 -1
  81. umap/static/umap/js/modules/rendering/layers/classified.js +55 -49
  82. umap/static/umap/js/modules/rendering/layers/cluster.js +16 -9
  83. umap/static/umap/js/modules/rendering/layers/heat.js +13 -11
  84. umap/static/umap/js/modules/rendering/map.js +5 -0
  85. umap/static/umap/js/modules/rendering/ui.js +23 -0
  86. umap/static/umap/js/modules/rules.js +24 -23
  87. umap/static/umap/js/modules/schema.js +60 -4
  88. umap/static/umap/js/modules/sync/updaters.js +7 -3
  89. umap/static/umap/js/modules/tableeditor.js +7 -30
  90. umap/static/umap/js/modules/templates.js +122 -0
  91. umap/static/umap/js/modules/ui/bar.js +13 -3
  92. umap/static/umap/js/modules/ui/panel.js +1 -1
  93. umap/static/umap/js/modules/umap.js +28 -13
  94. umap/static/umap/js/umap.controls.js +11 -4
  95. umap/static/umap/locale/br.js +51 -18
  96. umap/static/umap/locale/br.json +51 -18
  97. umap/static/umap/locale/da.js +343 -310
  98. umap/static/umap/locale/da.json +343 -310
  99. umap/static/umap/locale/de.js +40 -7
  100. umap/static/umap/locale/de.json +40 -7
  101. umap/static/umap/locale/el.js +31 -4
  102. umap/static/umap/locale/el.json +31 -4
  103. umap/static/umap/locale/en.js +33 -1
  104. umap/static/umap/locale/en.json +33 -1
  105. umap/static/umap/locale/es.js +37 -4
  106. umap/static/umap/locale/es.json +37 -4
  107. umap/static/umap/locale/fr.js +34 -1
  108. umap/static/umap/locale/fr.json +34 -1
  109. umap/static/umap/locale/hu.js +44 -17
  110. umap/static/umap/locale/hu.json +44 -17
  111. umap/static/umap/locale/it.js +74 -41
  112. umap/static/umap/locale/it.json +74 -41
  113. umap/static/umap/locale/nl.js +42 -9
  114. umap/static/umap/locale/nl.json +42 -9
  115. umap/static/umap/map.css +3 -23
  116. umap/static/umap/vendors/textpath/leaflet.textpath.js +184 -0
  117. umap/storage/fs.py +19 -9
  118. umap/templates/umap/dashboard_menu.html +5 -0
  119. umap/templates/umap/design_system.html +9 -0
  120. umap/templates/umap/js.html +3 -0
  121. umap/templates/umap/map_list.html +2 -2
  122. umap/templates/umap/map_table.html +18 -18
  123. umap/templates/umap/user_dashboard.html +9 -58
  124. umap/templates/umap/user_map_table.html +36 -0
  125. umap/templates/umap/user_templates.html +19 -0
  126. umap/templatetags/umap_tags.py +5 -0
  127. umap/tests/integration/test_conditional_rules.py +57 -0
  128. umap/tests/integration/test_datalayer.py +16 -9
  129. umap/tests/integration/test_edit_marker.py +11 -0
  130. umap/tests/integration/test_tableeditor.py +42 -7
  131. umap/tests/integration/test_templates.py +44 -0
  132. umap/tests/test_dashboard.py +19 -0
  133. umap/tests/test_purge_old_versions.py +91 -0
  134. umap/tests/test_switch_user.py +31 -0
  135. umap/tests/test_views.py +67 -0
  136. umap/urls.py +7 -1
  137. umap/views.py +64 -18
  138. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/METADATA +14 -14
  139. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/RECORD +142 -129
  140. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/WHEEL +0 -0
  141. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/entry_points.txt +0 -0
  142. {umap_project-3.0.6.dist-info → umap_project-3.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -15,7 +15,7 @@ msgid ""
15
15
  msgstr ""
16
16
  "Project-Id-Version: uMap\n"
17
17
  "Report-Msgid-Bugs-To: \n"
18
- "POT-Creation-Date: 2025-03-03 17:36+0000\n"
18
+ "POT-Creation-Date: 2025-06-10 09:19+0000\n"
19
19
  "PO-Revision-Date: 2013-11-22 14:00+0000\n"
20
20
  "Last-Translator: Supaplex <bejokeup@gmail.com>, 2019,2023-2025\n"
21
21
  "Language-Team: Chinese (Taiwan) (http://app.transifex.com/openstreetmap/umap/language/zh_TW/)\n"
@@ -42,137 +42,229 @@ msgstr "網站目前因維護中設定為唯讀狀態"
42
42
  msgid ""
43
43
  "Using “%(name)s” to authenticate is deprecated and will be removed soon. "
44
44
  "Please configure another provider below before losing access to your account"
45
- " and maps."
46
- msgstr ""
45
+ " and maps. Then, please logout and login again with the new provider."
46
+ msgstr "使用 \"%(name)s\" 來認證已經棄用並且很快將移除。請設定下列其他的服務商,免 得使用你帳號與地圖的連結。接著,請用新的服務商登出與再次登入。"
47
47
 
48
- #: models.py:60 models.py:79
48
+ #: models.py:61 models.py:80
49
49
  msgid "name"
50
50
  msgstr "名稱"
51
51
 
52
- #: models.py:62 models.py:485
52
+ #: models.py:63 models.py:503
53
53
  msgid "description"
54
54
  msgstr "描述"
55
55
 
56
- #: models.py:110
56
+ #: models.py:111
57
57
  msgid "details"
58
58
  msgstr "詳情"
59
59
 
60
- #: models.py:111
60
+ #: models.py:112
61
61
  msgid "Link to a page where the licence is detailed."
62
62
  msgstr "連結至授權條款說明網址"
63
63
 
64
- #: models.py:121
64
+ #: models.py:122
65
65
  msgid "URL template using OSM tile format"
66
66
  msgstr "URL 樣板,使用 OSM 地圖磚格式"
67
67
 
68
- #: models.py:127
68
+ #: models.py:128
69
69
  msgid "Order of the tilelayers in the edit box"
70
70
  msgstr "編輯方塊中地圖磚的圖層順序"
71
71
 
72
- #: models.py:175 models.py:479
72
+ #: models.py:176 models.py:497
73
73
  msgid "Only editable with secret edit link"
74
74
  msgstr "僅能由私密連結編輯"
75
75
 
76
- #: models.py:176 models.py:480
76
+ #: models.py:177 models.py:498
77
77
  msgid "Everyone can edit"
78
78
  msgstr "所有人皆可編輯"
79
79
 
80
- #: models.py:179 models.py:473
80
+ #: models.py:180 models.py:491
81
81
  msgid "Everyone"
82
82
  msgstr "所有人"
83
83
 
84
- #: models.py:180 models.py:189 models.py:474
84
+ #: models.py:181 models.py:190 models.py:492
85
85
  msgid "Editors and team only"
86
86
  msgstr "只有編輯者與團隊"
87
87
 
88
- #: models.py:181 models.py:475
88
+ #: models.py:182 models.py:493
89
89
  msgid "Owner only"
90
90
  msgstr "只有擁有者"
91
91
 
92
- #: models.py:184
92
+ #: models.py:185
93
93
  msgid "Draft (private)"
94
94
  msgstr "草稿 (私人)"
95
95
 
96
- #: models.py:185
96
+ #: models.py:186
97
97
  msgid "Everyone (public)"
98
98
  msgstr "所有人 (公開)"
99
99
 
100
- #: models.py:188
100
+ #: models.py:189
101
101
  msgid "Anyone with link"
102
102
  msgstr "任何有連結的人"
103
103
 
104
- #: models.py:190
104
+ #: models.py:191
105
105
  msgid "Blocked"
106
106
  msgstr "已經封銷了"
107
107
 
108
- #: models.py:191 models.py:469
108
+ #: models.py:192 models.py:487
109
109
  msgid "Deleted"
110
110
  msgstr "已刪除"
111
111
 
112
- #: models.py:194
112
+ #: models.py:195
113
113
  msgid "center"
114
114
  msgstr "中心"
115
115
 
116
- #: models.py:195
116
+ #: models.py:196
117
117
  msgid "zoom"
118
118
  msgstr "縮放"
119
119
 
120
- #: models.py:197
120
+ #: models.py:198
121
121
  msgid "locate"
122
122
  msgstr "定位"
123
123
 
124
- #: models.py:197
124
+ #: models.py:198
125
125
  msgid "Locate user on load?"
126
126
  msgstr "載入時使用定位功能?"
127
127
 
128
- #: models.py:201
128
+ #: models.py:202
129
129
  msgid "Choose the map licence."
130
130
  msgstr "選擇地圖授權"
131
131
 
132
- #: models.py:202
132
+ #: models.py:203
133
133
  msgid "licence"
134
134
  msgstr "授權"
135
135
 
136
- #: models.py:213
136
+ #: models.py:214
137
137
  msgid "owner"
138
138
  msgstr "擁有者"
139
139
 
140
- #: models.py:217
140
+ #: models.py:218
141
141
  msgid "editors"
142
142
  msgstr "編輯者"
143
143
 
144
- #: models.py:223
144
+ #: models.py:224
145
145
  msgid "team"
146
146
  msgstr "團隊"
147
147
 
148
- #: models.py:229 models.py:501
148
+ #: models.py:230 models.py:519
149
149
  msgid "edit status"
150
150
  msgstr "編輯狀態"
151
151
 
152
- #: models.py:234 models.py:506
152
+ #: models.py:235 models.py:524
153
153
  msgid "share status"
154
154
  msgstr "分享狀態"
155
155
 
156
- #: models.py:237 models.py:496
156
+ #: models.py:238 models.py:514
157
157
  msgid "settings"
158
158
  msgstr "設定"
159
159
 
160
- #: models.py:407
160
+ #: models.py:243
161
+ msgid "save as template"
162
+ msgstr ""
163
+
164
+ #: models.py:244
165
+ msgid "This map is a template map."
166
+ msgstr ""
167
+
168
+ #: models.py:420
161
169
  msgid "Clone of"
162
170
  msgstr "複製"
163
171
 
164
- #: models.py:468 models.py:472 models.py:478
172
+ #: models.py:486 models.py:490 models.py:496
165
173
  msgid "Inherit"
166
174
  msgstr "繼承"
167
175
 
168
- #: models.py:491
176
+ #: models.py:509
169
177
  msgid "display on load"
170
178
  msgstr "載入時顯示"
171
179
 
172
- #: models.py:492
180
+ #: models.py:510
173
181
  msgid "Display this layer on load."
174
182
  msgstr "載入此圖層時顯示"
175
183
 
184
+ #: settings/base.py:283
185
+ msgid "uMap user documentation"
186
+ msgstr ""
187
+
188
+ #: settings/base.py:288
189
+ msgid "Video tutorials"
190
+ msgstr ""
191
+
192
+ #: settings/base.py:293
193
+ msgid "OpenStreetMap.org forum"
194
+ msgstr ""
195
+
196
+ #: settings/base.py:298
197
+ msgid "OpenStreetMap France forum"
198
+ msgstr ""
199
+
200
+ #: settings/base.py:318
201
+ msgid "Art and Culture"
202
+ msgstr ""
203
+
204
+ #: settings/base.py:319
205
+ msgid "Cycling"
206
+ msgstr ""
207
+
208
+ #: settings/base.py:320
209
+ msgid "Business"
210
+ msgstr ""
211
+
212
+ #: settings/base.py:321
213
+ msgid "Environment"
214
+ msgstr ""
215
+
216
+ #: settings/base.py:322
217
+ msgid "Education"
218
+ msgstr ""
219
+
220
+ #: settings/base.py:323
221
+ msgid "Food and Agriculture"
222
+ msgstr ""
223
+
224
+ #: settings/base.py:324
225
+ msgid "Geopolitics"
226
+ msgstr ""
227
+
228
+ #: settings/base.py:325
229
+ msgid "Health"
230
+ msgstr ""
231
+
232
+ #: settings/base.py:326
233
+ msgid "Hiking"
234
+ msgstr ""
235
+
236
+ #: settings/base.py:327
237
+ msgid "History"
238
+ msgstr ""
239
+
240
+ #: settings/base.py:328
241
+ msgid "Public sector"
242
+ msgstr ""
243
+
244
+ #: settings/base.py:329
245
+ msgid "Science"
246
+ msgstr ""
247
+
248
+ #: settings/base.py:330
249
+ msgid "Shopping"
250
+ msgstr ""
251
+
252
+ #: settings/base.py:331
253
+ msgid "Sport and Leisure"
254
+ msgstr ""
255
+
256
+ #: settings/base.py:332
257
+ msgid "Travel"
258
+ msgstr ""
259
+
260
+ #: settings/base.py:333
261
+ msgid "Transports"
262
+ msgstr ""
263
+
264
+ #: settings/base.py:334
265
+ msgid "Tourism"
266
+ msgstr ""
267
+
176
268
  #: templates/403.html:8
177
269
  msgid ""
178
270
  "<a href=\"https://discover.umap-project.org/support/faq/#map-statuses\" "
@@ -315,7 +407,7 @@ msgid "And it's <a href=\"%(repo_url)s\">open source</a>!"
315
407
  msgstr "而且是 <a href=\"%(repo_url)s\">開放原始碼</a> 的!"
316
408
 
317
409
  #: templates/umap/about_summary.html:63 templates/umap/navigation.html:39
318
- #: templates/umap/user_dashboard.html:40
410
+ #: templates/umap/user_dashboard.html:16
319
411
  msgid "Create a map"
320
412
  msgstr "建立地圖"
321
413
 
@@ -413,11 +505,20 @@ msgstr "我的地圖 (%(count)s)"
413
505
  msgid "My Maps"
414
506
  msgstr "我的地圖"
415
507
 
416
- #: templates/umap/dashboard_menu.html:12
508
+ #: templates/umap/dashboard_menu.html:11
509
+ #, python-format
510
+ msgid "My Templates (%(count)s)"
511
+ msgstr ""
512
+
513
+ #: templates/umap/dashboard_menu.html:13 templates/umap/user_templates.html:6
514
+ msgid "My Templates"
515
+ msgstr ""
516
+
517
+ #: templates/umap/dashboard_menu.html:17
417
518
  msgid "My profile"
418
519
  msgstr "我的個人檔案"
419
520
 
420
- #: templates/umap/dashboard_menu.html:15
521
+ #: templates/umap/dashboard_menu.html:20
421
522
  msgid "My teams"
422
523
  msgstr "我的團隊"
423
524
 
@@ -425,7 +526,7 @@ msgstr "我的團隊"
425
526
  msgid "Map of the uMaps"
426
527
  msgstr "uMaps 地圖"
427
528
 
428
- #: templates/umap/home.html:24
529
+ #: templates/umap/home.html:25
429
530
  msgid "Get inspired, browse maps"
430
531
  msgstr "找點子,瀏覽其他地圖"
431
532
 
@@ -433,11 +534,23 @@ msgstr "找點子,瀏覽其他地圖"
433
534
  msgid "You are logged in. Continuing..."
434
535
  msgstr "您已登入,繼續中..."
435
536
 
436
- #: templates/umap/map_list.html:11 views.py:437
537
+ #: templates/umap/map_list.html:15
538
+ msgid "template"
539
+ msgstr ""
540
+
541
+ #: templates/umap/map_list.html:18 views.py:458
437
542
  msgid "by"
438
543
  msgstr "由"
439
544
 
440
- #: templates/umap/map_list.html:20
545
+ #: templates/umap/map_list.html:22
546
+ msgid "See the template"
547
+ msgstr ""
548
+
549
+ #: templates/umap/map_list.html:22
550
+ msgid "See the map"
551
+ msgstr ""
552
+
553
+ #: templates/umap/map_list.html:28
441
554
  msgid "More"
442
555
  msgstr "更多"
443
556
 
@@ -469,7 +582,7 @@ msgstr "擁有者"
469
582
  msgid "Actions"
470
583
  msgstr "動作"
471
584
 
472
- #: templates/umap/map_table.html:41 templates/umap/map_table.html:43
585
+ #: templates/umap/map_table.html:40 templates/umap/map_table.html:42
473
586
  msgid "Open preview"
474
587
  msgstr "開啟預纜"
475
588
 
@@ -595,11 +708,15 @@ msgid "%(count)s map found:"
595
708
  msgid_plural "%(count)s maps found:"
596
709
  msgstr[0] "已找到%(count)s份地圖:"
597
710
 
598
- #: templates/umap/search.html:28
711
+ #: templates/umap/search.html:30 templates/umap/user_dashboard.html:17
599
712
  msgid "No map found."
600
713
  msgstr "找不到地圖。"
601
714
 
602
- #: templates/umap/search.html:33
715
+ #: templates/umap/search.html:36
716
+ msgid "Latest created maps in category"
717
+ msgstr ""
718
+
719
+ #: templates/umap/search.html:43
603
720
  msgid "Latest created maps"
604
721
  msgstr "最新創建地圖"
605
722
 
@@ -607,7 +724,11 @@ msgstr "最新創建地圖"
607
724
  msgid "Search maps"
608
725
  msgstr "搜尋地圖"
609
726
 
610
- #: templates/umap/search_bar.html:16
727
+ #: templates/umap/search_bar.html:14
728
+ msgid "Any category"
729
+ msgstr ""
730
+
731
+ #: templates/umap/search_bar.html:19
611
732
  msgid "Search"
612
733
  msgstr "搜尋"
613
734
 
@@ -642,20 +763,20 @@ msgstr "刪除這個團隊"
642
763
  msgid "Add user"
643
764
  msgstr "新增使用者"
644
765
 
645
- #: templates/umap/user_dashboard.html:9 templates/umap/user_dashboard.html:25
766
+ #: templates/umap/user_dashboard.html:10
646
767
  msgid "Search my maps"
647
768
  msgstr "搜尋我的地圖"
648
769
 
649
- #: templates/umap/user_dashboard.html:17 templates/umap/user_dashboard.html:22
650
- msgid "Map’s title"
651
- msgstr "地圖標題"
770
+ #: templates/umap/user_dashboard.html:11
771
+ msgid "Map’s name"
772
+ msgstr ""
652
773
 
653
- #: templates/umap/user_dashboard.html:30
774
+ #: templates/umap/user_dashboard.html:12
654
775
  #, python-format
655
776
  msgid "Download %(count)s maps"
656
777
  msgstr "下載%(count)s地圖"
657
778
 
658
- #: templates/umap/user_dashboard.html:40
779
+ #: templates/umap/user_dashboard.html:15
659
780
  msgid "You have no map yet."
660
781
  msgstr "你目前還沒有地圖。"
661
782
 
@@ -671,70 +792,95 @@ msgstr "使用者"
671
792
  msgid "New team"
672
793
  msgstr "新的團隊"
673
794
 
674
- #: views.py:234
795
+ #: templates/umap/user_templates.html:10
796
+ msgid "Search my templates"
797
+ msgstr ""
798
+
799
+ #: templates/umap/user_templates.html:11
800
+ msgid "Template’s name"
801
+ msgstr ""
802
+
803
+ #: templates/umap/user_templates.html:12
804
+ #, python-format
805
+ msgid "Download %(count)s templates"
806
+ msgstr ""
807
+
808
+ #: templates/umap/user_templates.html:15
809
+ msgid "You have no template yet."
810
+ msgstr ""
811
+
812
+ #: templates/umap/user_templates.html:16
813
+ msgid "Create a template"
814
+ msgstr ""
815
+
816
+ #: templates/umap/user_templates.html:17
817
+ msgid "No template found."
818
+ msgstr ""
819
+
820
+ #: views.py:233
675
821
  msgid "Cannot delete a team with more than one member"
676
822
  msgstr "無法刪除超過一位成員的團隊"
677
823
 
678
- #: views.py:238
824
+ #: views.py:237
679
825
  #, python-format
680
826
  msgid "Team “%(name)s” has been deleted"
681
827
  msgstr "已經刪除團隊 \"%(name)s\" "
682
828
 
683
- #: views.py:442
829
+ #: views.py:463
684
830
  msgid "View the map"
685
831
  msgstr "檢視地圖"
686
832
 
687
- #: views.py:838
833
+ #: views.py:864
688
834
  msgid "See full screen"
689
835
  msgstr "檢視全螢幕"
690
836
 
691
- #: views.py:981
837
+ #: views.py:1007
692
838
  msgid "Map editors updated with success!"
693
839
  msgstr "地圖編輯者更新完成"
694
840
 
695
- #: views.py:1017
841
+ #: views.py:1043
696
842
  #, python-format
697
843
  msgid "The uMap edit link for your map: %(map_name)s"
698
844
  msgstr "你的地圖 uMap 編輯連結:%(map_name)s"
699
845
 
700
- #: views.py:1020
846
+ #: views.py:1046
701
847
  #, python-format
702
848
  msgid "Here is your secret edit link: %(link)s"
703
849
  msgstr "這是你的祕密編輯連結:%(link)s"
704
850
 
705
- #: views.py:1027
851
+ #: views.py:1053
706
852
  #, python-format
707
853
  msgid "Can't send email to %(email)s"
708
854
  msgstr "無法傳送電子郵件到%(email)s"
709
855
 
710
- #: views.py:1030
856
+ #: views.py:1056
711
857
  #, python-format
712
858
  msgid "Email sent to %(email)s"
713
859
  msgstr "電子郵件寄至 %(email)s"
714
860
 
715
- #: views.py:1041
861
+ #: views.py:1067
716
862
  msgid "Only its owner can delete the map."
717
863
  msgstr "只有擁有者可以刪除此地圖"
718
864
 
719
- #: views.py:1044
865
+ #: views.py:1073
720
866
  msgid "Map successfully deleted."
721
867
  msgstr "成功刪除地圖"
722
868
 
723
- #: views.py:1070
869
+ #: views.py:1099
724
870
  #, python-format
725
871
  msgid ""
726
872
  "Your map has been cloned! If you want to edit this map from another "
727
873
  "computer, please use this link: %(anonymous_url)s"
728
874
  msgstr "您的地圖已複製完成!如果您想在不同的機器編輯這個地圖,請使用這個連結:%(anonymous_url)s"
729
875
 
730
- #: views.py:1075
876
+ #: views.py:1104
731
877
  msgid "Congratulations, your map has been cloned!"
732
878
  msgstr "恭喜,您的地圖已被複製!"
733
879
 
734
- #: views.py:1329
880
+ #: views.py:1358
735
881
  msgid "Layer successfully deleted."
736
882
  msgstr "圖層已刪除"
737
883
 
738
- #: views.py:1351
884
+ #: views.py:1380
739
885
  msgid "Permissions updated with success!"
740
886
  msgstr "權限更新完成"
@@ -1,29 +1,51 @@
1
1
  from django.conf import settings
2
+ from django.core.files.storage import FileSystemStorage
2
3
  from django.core.management.base import BaseCommand
3
4
 
4
- from umap.models import DataLayer
5
+ from umap.models import DataLayer, Pictogram
5
6
  from umap.storage.fs import FSDataStorage
6
7
 
7
8
 
8
9
  class Command(BaseCommand):
9
- help = "Migrate latest datalayers from filesystem to S3."
10
+ help = "Migrate latest datalayers or pictograms from filesystem to S3."
11
+
12
+ def add_arguments(self, parser):
13
+ parser.add_argument(
14
+ "--pictograms",
15
+ help="Migrate pictograms instead of datalayers",
16
+ action="store_true",
17
+ )
10
18
 
11
19
  def handle(self, *args, **options):
12
- assert settings.UMAP_READONLY, "You must run that script with a read-only uMap."
13
- assert (
14
- settings.STORAGES["data"]["BACKEND"] == "umap.storage.s3.S3DataStorage"
15
- ), "You must configure your storages to point to S3"
16
- fs_storage = FSDataStorage()
17
- for datalayer in DataLayer.objects.all():
18
- geojson_fs_path = str(datalayer.geojson)
19
- try:
20
- datalayer.geojson.save(
21
- datalayer.geojson.name, fs_storage.open(geojson_fs_path)
22
- )
23
- except FileNotFoundError as e:
24
- print(e)
25
- print(geojson_fs_path, "not found on disk")
26
- continue
27
- if options["verbosity"] > 1:
28
- print("Migrated:", geojson_fs_path)
29
- datalayer.save(force_update=True)
20
+ if options["pictograms"]:
21
+ assert (
22
+ settings.STORAGES["default"]["BACKEND"]
23
+ == "storages.backends.s3.S3Storage"
24
+ ), "You must configure your default storage to point to S3"
25
+ fs_storage = FileSystemStorage()
26
+ for picto in Pictogram.objects.all():
27
+ fs_path = str(picto.pictogram)
28
+ picto.pictogram.save(picto.pictogram.name, fs_storage.open(fs_path))
29
+ if options["verbosity"] > 1:
30
+ print("Migrated:", fs_path)
31
+ else:
32
+ assert settings.UMAP_READONLY, (
33
+ "You must run that script with a read-only uMap."
34
+ )
35
+ assert (
36
+ settings.STORAGES["data"]["BACKEND"] == "umap.storage.s3.S3DataStorage"
37
+ ), "You must configure your storages to point to S3"
38
+ fs_storage = FSDataStorage()
39
+ for datalayer in DataLayer.objects.all():
40
+ geojson_fs_path = str(datalayer.geojson)
41
+ try:
42
+ datalayer.geojson.save(
43
+ datalayer.geojson.name, fs_storage.open(geojson_fs_path)
44
+ )
45
+ except FileNotFoundError as e:
46
+ print(e)
47
+ print(geojson_fs_path, "not found on disk")
48
+ continue
49
+ if options["verbosity"] > 1:
50
+ print("Migrated:", geojson_fs_path)
51
+ datalayer.save(force_update=True)
@@ -0,0 +1,63 @@
1
+ import sys
2
+ from datetime import datetime, timedelta
3
+
4
+ from django.conf import settings
5
+ from django.core.management.base import BaseCommand
6
+
7
+ from umap.models import DataLayer
8
+
9
+
10
+ class Command(BaseCommand):
11
+ help = "Delete versions from datalayers which last modified date is x days ago. Eg.: umap purge_old_versions --days-ago 30"
12
+
13
+ def add_arguments(self, parser):
14
+ parser.add_argument(
15
+ "--days-ago",
16
+ help="Select datalayers which where last modified that many days ago",
17
+ default=360,
18
+ type=int,
19
+ )
20
+ parser.add_argument(
21
+ "--days-to-select",
22
+ help="How many days before `days-ago` to consider",
23
+ default=1,
24
+ type=int,
25
+ )
26
+ parser.add_argument(
27
+ "--dry-run",
28
+ help="Pretend to delete but just report",
29
+ action="store_true",
30
+ )
31
+
32
+ def handle(self, *args, **options):
33
+ if settings.STORAGES["data"]["BACKEND"] != "umap.storage.fs.FSDataStorage":
34
+ msg = (
35
+ "This command is only available for filesystem storage. "
36
+ "For S3 storage, use lifecycle rule in the bucket."
37
+ )
38
+ sys.exit(msg)
39
+ end = (datetime.utcnow() - timedelta(days=options["days_ago"] - 1)).date()
40
+ print(f"Deleting versions for datalayer unmodified since {end}")
41
+ filters = {"modified_at__lt": end}
42
+ if options["days_to_select"]:
43
+ start = end - timedelta(days=options["days_to_select"])
44
+ filters = {"modified_at__date__range": [start, end]}
45
+ datalayers = DataLayer.objects.filter(**filters)
46
+ print(f"Selected {len(datalayers)} datalayers")
47
+ total_deleted = 0
48
+ for layer in datalayers:
49
+ layer_id = layer.uuid
50
+ layer_name = layer.name
51
+ last_modified = layer.modified_at.date()
52
+ deleted = 0
53
+ if not options["dry_run"]:
54
+ deleted = layer.geojson.storage.purge_old_versions(layer, keep=1)
55
+ layer.geojson.storage.purge_gzip(layer)
56
+ total_deleted += deleted
57
+ print(
58
+ f"Deleted {deleted} old versions of `{layer_name}` ({layer_id}), unmodified since {last_modified}"
59
+ )
60
+ if not options["dry_run"]:
61
+ print(f"Successfully deleted {total_deleted} geojson files.")
62
+ else:
63
+ print(f"The command would delete {total_deleted} geojson files.")