umap-project 2.5.1__py3-none-any.whl → 2.6.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 (276) hide show
  1. umap/__init__.py +1 -1
  2. umap/admin.py +6 -1
  3. umap/context_processors.py +2 -1
  4. umap/decorators.py +13 -2
  5. umap/forms.py +26 -2
  6. umap/locale/br/LC_MESSAGES/django.mo +0 -0
  7. umap/locale/br/LC_MESSAGES/django.po +252 -146
  8. umap/locale/ca/LC_MESSAGES/django.mo +0 -0
  9. umap/locale/ca/LC_MESSAGES/django.po +274 -162
  10. umap/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
  11. umap/locale/cs_CZ/LC_MESSAGES/django.po +261 -150
  12. umap/locale/de/LC_MESSAGES/django.mo +0 -0
  13. umap/locale/de/LC_MESSAGES/django.po +299 -187
  14. umap/locale/el/LC_MESSAGES/django.mo +0 -0
  15. umap/locale/el/LC_MESSAGES/django.po +215 -159
  16. umap/locale/en/LC_MESSAGES/django.po +211 -155
  17. umap/locale/es/LC_MESSAGES/django.mo +0 -0
  18. umap/locale/es/LC_MESSAGES/django.po +255 -144
  19. umap/locale/eu/LC_MESSAGES/django.mo +0 -0
  20. umap/locale/eu/LC_MESSAGES/django.po +254 -198
  21. umap/locale/fa_IR/LC_MESSAGES/django.mo +0 -0
  22. umap/locale/fa_IR/LC_MESSAGES/django.po +347 -235
  23. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  24. umap/locale/fr/LC_MESSAGES/django.po +216 -160
  25. umap/locale/hu/LC_MESSAGES/django.mo +0 -0
  26. umap/locale/hu/LC_MESSAGES/django.po +215 -159
  27. umap/locale/it/LC_MESSAGES/django.mo +0 -0
  28. umap/locale/it/LC_MESSAGES/django.po +252 -146
  29. umap/locale/ms/LC_MESSAGES/django.mo +0 -0
  30. umap/locale/ms/LC_MESSAGES/django.po +252 -146
  31. umap/locale/pl/LC_MESSAGES/django.mo +0 -0
  32. umap/locale/pl/LC_MESSAGES/django.po +254 -148
  33. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  34. umap/locale/pt/LC_MESSAGES/django.po +215 -159
  35. umap/locale/sv/LC_MESSAGES/django.mo +0 -0
  36. umap/locale/sv/LC_MESSAGES/django.po +254 -143
  37. umap/locale/th_TH/LC_MESSAGES/django.mo +0 -0
  38. umap/locale/th_TH/LC_MESSAGES/django.po +125 -70
  39. umap/locale/zh_TW/LC_MESSAGES/django.mo +0 -0
  40. umap/locale/zh_TW/LC_MESSAGES/django.po +256 -145
  41. umap/migrations/0022_add_team.py +94 -0
  42. umap/models.py +45 -10
  43. umap/settings/__init__.py +2 -0
  44. umap/settings/base.py +9 -2
  45. umap/static/umap/base.css +32 -41
  46. umap/static/umap/content.css +19 -25
  47. umap/static/umap/css/icon.css +63 -37
  48. umap/static/umap/css/importers.css +1 -1
  49. umap/static/umap/css/slideshow.css +7 -5
  50. umap/static/umap/css/tableeditor.css +4 -3
  51. umap/static/umap/img/16-white.svg +1 -4
  52. umap/static/umap/img/16.svg +2 -6
  53. umap/static/umap/img/24-white.svg +4 -4
  54. umap/static/umap/img/24.svg +6 -6
  55. umap/static/umap/img/source/16-white.svg +2 -5
  56. umap/static/umap/img/source/16.svg +3 -7
  57. umap/static/umap/img/source/24-white.svg +7 -14
  58. umap/static/umap/img/source/24.svg +10 -17
  59. umap/static/umap/js/components/alerts/alert.css +20 -8
  60. umap/static/umap/js/modules/autocomplete.js +8 -12
  61. umap/static/umap/js/modules/browser.js +4 -3
  62. umap/static/umap/js/modules/caption.js +9 -11
  63. umap/static/umap/js/modules/data/features.js +993 -0
  64. umap/static/umap/js/modules/data/layer.js +1210 -0
  65. umap/static/umap/js/modules/formatter.js +12 -3
  66. umap/static/umap/js/modules/global.js +21 -5
  67. umap/static/umap/js/modules/importers/overpass.js +22 -8
  68. umap/static/umap/js/modules/permissions.js +280 -0
  69. umap/static/umap/js/{umap.icon.js → modules/rendering/icon.js} +77 -56
  70. umap/static/umap/js/modules/rendering/layers/base.js +105 -0
  71. umap/static/umap/js/modules/rendering/layers/classified.js +484 -0
  72. umap/static/umap/js/modules/rendering/layers/cluster.js +103 -0
  73. umap/static/umap/js/modules/rendering/layers/heat.js +182 -0
  74. umap/static/umap/js/modules/rendering/popup.js +99 -0
  75. umap/static/umap/js/modules/rendering/template.js +217 -0
  76. umap/static/umap/js/modules/rendering/ui.js +610 -0
  77. umap/static/umap/js/modules/rules.js +16 -3
  78. umap/static/umap/js/modules/schema.js +25 -1
  79. umap/static/umap/js/modules/share.js +66 -45
  80. umap/static/umap/js/modules/sync/updaters.js +9 -10
  81. umap/static/umap/js/modules/tableeditor.js +7 -7
  82. umap/static/umap/js/modules/ui/dialog.js +8 -4
  83. umap/static/umap/js/modules/utils.js +22 -13
  84. umap/static/umap/js/umap.controls.js +80 -146
  85. umap/static/umap/js/umap.core.js +9 -9
  86. umap/static/umap/js/umap.forms.js +41 -17
  87. umap/static/umap/js/umap.js +72 -65
  88. umap/static/umap/locale/am_ET.js +8 -2
  89. umap/static/umap/locale/am_ET.json +8 -2
  90. umap/static/umap/locale/ar.js +8 -2
  91. umap/static/umap/locale/ar.json +8 -2
  92. umap/static/umap/locale/ast.js +8 -2
  93. umap/static/umap/locale/ast.json +8 -2
  94. umap/static/umap/locale/bg.js +8 -2
  95. umap/static/umap/locale/bg.json +8 -2
  96. umap/static/umap/locale/br.js +42 -36
  97. umap/static/umap/locale/br.json +42 -36
  98. umap/static/umap/locale/ca.js +67 -61
  99. umap/static/umap/locale/ca.json +67 -61
  100. umap/static/umap/locale/cs_CZ.js +8 -2
  101. umap/static/umap/locale/cs_CZ.json +8 -2
  102. umap/static/umap/locale/da.js +8 -2
  103. umap/static/umap/locale/da.json +8 -2
  104. umap/static/umap/locale/de.js +143 -137
  105. umap/static/umap/locale/de.json +143 -137
  106. umap/static/umap/locale/el.js +54 -48
  107. umap/static/umap/locale/el.json +54 -48
  108. umap/static/umap/locale/en.js +10 -2
  109. umap/static/umap/locale/en.json +10 -2
  110. umap/static/umap/locale/en_US.json +8 -2
  111. umap/static/umap/locale/es.js +8 -2
  112. umap/static/umap/locale/es.json +8 -2
  113. umap/static/umap/locale/et.js +8 -2
  114. umap/static/umap/locale/et.json +8 -2
  115. umap/static/umap/locale/eu.js +346 -338
  116. umap/static/umap/locale/eu.json +346 -338
  117. umap/static/umap/locale/fa_IR.js +415 -407
  118. umap/static/umap/locale/fa_IR.json +415 -407
  119. umap/static/umap/locale/fi.js +8 -2
  120. umap/static/umap/locale/fi.json +8 -2
  121. umap/static/umap/locale/fr.js +11 -3
  122. umap/static/umap/locale/fr.json +11 -3
  123. umap/static/umap/locale/gl.js +8 -2
  124. umap/static/umap/locale/gl.json +8 -2
  125. umap/static/umap/locale/he.js +8 -2
  126. umap/static/umap/locale/he.json +8 -2
  127. umap/static/umap/locale/hr.js +8 -2
  128. umap/static/umap/locale/hr.json +8 -2
  129. umap/static/umap/locale/hu.js +31 -23
  130. umap/static/umap/locale/hu.json +31 -23
  131. umap/static/umap/locale/id.js +8 -2
  132. umap/static/umap/locale/id.json +8 -2
  133. umap/static/umap/locale/is.js +8 -2
  134. umap/static/umap/locale/is.json +8 -2
  135. umap/static/umap/locale/it.js +8 -2
  136. umap/static/umap/locale/it.json +8 -2
  137. umap/static/umap/locale/ja.js +8 -2
  138. umap/static/umap/locale/ja.json +8 -2
  139. umap/static/umap/locale/ko.js +8 -2
  140. umap/static/umap/locale/ko.json +8 -2
  141. umap/static/umap/locale/lt.js +8 -2
  142. umap/static/umap/locale/lt.json +8 -2
  143. umap/static/umap/locale/ms.js +8 -2
  144. umap/static/umap/locale/ms.json +8 -2
  145. umap/static/umap/locale/nl.js +8 -2
  146. umap/static/umap/locale/nl.json +8 -2
  147. umap/static/umap/locale/no.js +8 -2
  148. umap/static/umap/locale/no.json +8 -2
  149. umap/static/umap/locale/pl.js +54 -48
  150. umap/static/umap/locale/pl.json +54 -48
  151. umap/static/umap/locale/pl_PL.json +8 -2
  152. umap/static/umap/locale/pt.js +24 -18
  153. umap/static/umap/locale/pt.json +24 -18
  154. umap/static/umap/locale/pt_BR.js +8 -2
  155. umap/static/umap/locale/pt_BR.json +8 -2
  156. umap/static/umap/locale/pt_PT.js +214 -208
  157. umap/static/umap/locale/pt_PT.json +214 -208
  158. umap/static/umap/locale/ro.js +8 -2
  159. umap/static/umap/locale/ro.json +8 -2
  160. umap/static/umap/locale/ru.js +8 -2
  161. umap/static/umap/locale/ru.json +8 -2
  162. umap/static/umap/locale/sk_SK.js +8 -2
  163. umap/static/umap/locale/sk_SK.json +8 -2
  164. umap/static/umap/locale/sl.js +8 -2
  165. umap/static/umap/locale/sl.json +8 -2
  166. umap/static/umap/locale/sr.js +8 -2
  167. umap/static/umap/locale/sr.json +8 -2
  168. umap/static/umap/locale/sv.js +8 -2
  169. umap/static/umap/locale/sv.json +8 -2
  170. umap/static/umap/locale/th_TH.js +33 -27
  171. umap/static/umap/locale/th_TH.json +33 -27
  172. umap/static/umap/locale/tr.js +8 -2
  173. umap/static/umap/locale/tr.json +8 -2
  174. umap/static/umap/locale/uk_UA.js +8 -2
  175. umap/static/umap/locale/uk_UA.json +8 -2
  176. umap/static/umap/locale/vi.js +8 -2
  177. umap/static/umap/locale/vi.json +8 -2
  178. umap/static/umap/locale/vi_VN.json +8 -2
  179. umap/static/umap/locale/zh.js +8 -2
  180. umap/static/umap/locale/zh.json +8 -2
  181. umap/static/umap/locale/zh_CN.json +8 -2
  182. umap/static/umap/locale/zh_TW.Big5.json +8 -2
  183. umap/static/umap/locale/zh_TW.js +102 -96
  184. umap/static/umap/locale/zh_TW.json +102 -96
  185. umap/static/umap/map.css +111 -108
  186. umap/static/umap/nav.css +19 -10
  187. umap/static/umap/unittests/utils.js +230 -107
  188. umap/static/umap/vars.css +1 -0
  189. umap/static/umap/vendors/csv2geojson/csv2geojson.js +62 -40
  190. umap/static/umap/vendors/editable/Leaflet.Editable.js +2079 -1937
  191. umap/storage.py +1 -0
  192. umap/templates/404.html +5 -1
  193. umap/templates/500.html +3 -1
  194. umap/templates/auth/user_detail.html +8 -2
  195. umap/templates/auth/user_form.html +19 -10
  196. umap/templates/auth/user_stars.html +8 -2
  197. umap/templates/base.html +1 -0
  198. umap/templates/registration/login.html +18 -3
  199. umap/templates/umap/about.html +1 -0
  200. umap/templates/umap/about_summary.html +22 -7
  201. umap/templates/umap/components/alerts/alert.html +42 -21
  202. umap/templates/umap/content.html +2 -0
  203. umap/templates/umap/content_footer.html +7 -3
  204. umap/templates/umap/css.html +1 -0
  205. umap/templates/umap/dashboard_menu.html +15 -0
  206. umap/templates/umap/home.html +14 -4
  207. umap/templates/umap/js.html +4 -9
  208. umap/templates/umap/login_popup_end.html +10 -4
  209. umap/templates/umap/map_detail.html +8 -2
  210. umap/templates/umap/map_fragment.html +3 -1
  211. umap/templates/umap/map_init.html +2 -1
  212. umap/templates/umap/map_list.html +6 -3
  213. umap/templates/umap/map_table.html +36 -12
  214. umap/templates/umap/messages.html +0 -1
  215. umap/templates/umap/navigation.html +2 -1
  216. umap/templates/umap/password_change.html +5 -1
  217. umap/templates/umap/password_change_done.html +8 -2
  218. umap/templates/umap/search.html +8 -2
  219. umap/templates/umap/search_bar.html +1 -0
  220. umap/templates/umap/team_confirm_delete.html +19 -0
  221. umap/templates/umap/team_detail.html +27 -0
  222. umap/templates/umap/team_form.html +60 -0
  223. umap/templates/umap/user_dashboard.html +7 -9
  224. umap/templates/umap/user_teams.html +51 -0
  225. umap/tests/base.py +8 -1
  226. umap/tests/conftest.py +6 -0
  227. umap/tests/fixtures/test_circles_layer.geojson +219 -0
  228. umap/tests/fixtures/test_upload_georss.xml +20 -0
  229. umap/tests/integration/conftest.py +18 -4
  230. umap/tests/integration/helpers.py +12 -0
  231. umap/tests/integration/test_anonymous_owned_map.py +23 -0
  232. umap/tests/integration/test_basics.py +29 -0
  233. umap/tests/integration/test_browser.py +20 -0
  234. umap/tests/integration/test_caption.py +20 -0
  235. umap/tests/integration/test_circles_layer.py +69 -0
  236. umap/tests/integration/test_conditional_rules.py +102 -17
  237. umap/tests/integration/test_draw_polygon.py +138 -13
  238. umap/tests/integration/test_draw_polyline.py +8 -18
  239. umap/tests/integration/test_edit_datalayer.py +3 -3
  240. umap/tests/integration/test_import.py +124 -5
  241. umap/tests/integration/test_owned_map.py +21 -13
  242. umap/tests/integration/test_querystring.py +7 -0
  243. umap/tests/integration/test_team.py +47 -0
  244. umap/tests/integration/test_tilelayer.py +19 -2
  245. umap/tests/integration/test_view_marker.py +28 -1
  246. umap/tests/integration/test_websocket_sync.py +5 -5
  247. umap/tests/test_datalayer.py +32 -7
  248. umap/tests/test_datalayer_views.py +1 -1
  249. umap/tests/test_map.py +30 -4
  250. umap/tests/test_map_views.py +2 -2
  251. umap/tests/test_statics.py +40 -0
  252. umap/tests/test_team_views.py +131 -0
  253. umap/tests/test_views.py +15 -1
  254. umap/urls.py +23 -13
  255. umap/views.py +116 -10
  256. {umap_project-2.5.1.dist-info → umap_project-2.6.0.dist-info}/METADATA +14 -14
  257. {umap_project-2.5.1.dist-info → umap_project-2.6.0.dist-info}/RECORD +260 -253
  258. umap/static/umap/js/umap.datalayer.permissions.js +0 -70
  259. umap/static/umap/js/umap.features.js +0 -1290
  260. umap/static/umap/js/umap.layer.js +0 -1837
  261. umap/static/umap/js/umap.permissions.js +0 -208
  262. umap/static/umap/js/umap.popup.js +0 -341
  263. umap/static/umap/test/TableEditor.js +0 -104
  264. umap/static/umap/vendors/leaflet/leaflet-src.js +0 -14512
  265. umap/static/umap/vendors/leaflet/leaflet-src.js.map +0 -1
  266. umap/static/umap/vendors/leaflet/leaflet.js +0 -6
  267. umap/static/umap/vendors/leaflet/leaflet.js.map +0 -1
  268. umap/static/umap/vendors/markercluster/WhereAreTheJavascriptFiles.txt +0 -5
  269. umap/static/umap/vendors/markercluster/leaflet.markercluster-src.js +0 -2718
  270. umap/static/umap/vendors/markercluster/leaflet.markercluster-src.js.map +0 -1
  271. umap/static/umap/vendors/toolbar/leaflet.toolbar-src.css +0 -117
  272. umap/static/umap/vendors/toolbar/leaflet.toolbar-src.js +0 -365
  273. umap/tests/integration/test_statics.py +0 -47
  274. {umap_project-2.5.1.dist-info → umap_project-2.6.0.dist-info}/WHEEL +0 -0
  275. {umap_project-2.5.1.dist-info → umap_project-2.6.0.dist-info}/entry_points.txt +0 -0
  276. {umap_project-2.5.1.dist-info → umap_project-2.6.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,15 +1,30 @@
1
1
  {% load umap_tags i18n %}
2
+
2
3
  <div class="table-wrapper">
3
4
  <table>
4
5
  <thead>
5
6
  <tr>
6
- <th>{% blocktrans %}Name{% endblocktrans %}</th>
7
- <th>{% blocktrans %}Preview{% endblocktrans %}</th>
8
- <th>{% blocktrans %}Who can see{% endblocktrans %}</th>
9
- <th>{% blocktrans %}Who can edit{% endblocktrans %}</th>
10
- <th>{% blocktrans %}Last save{% endblocktrans %}</th>
11
- <th>{% blocktrans %}Owner{% endblocktrans %}</th>
12
- <th>{% blocktrans %}Actions{% endblocktrans %}</th>
7
+ <th>
8
+ {% blocktrans %}Name{% endblocktrans %}
9
+ </th>
10
+ <th>
11
+ {% blocktrans %}Preview{% endblocktrans %}
12
+ </th>
13
+ <th>
14
+ {% blocktrans %}Who can see{% endblocktrans %}
15
+ </th>
16
+ <th>
17
+ {% blocktrans %}Who can edit{% endblocktrans %}
18
+ </th>
19
+ <th>
20
+ {% blocktrans %}Last save{% endblocktrans %}
21
+ </th>
22
+ <th>
23
+ {% blocktrans %}Owner{% endblocktrans %}
24
+ </th>
25
+ <th>
26
+ {% blocktrans %}Actions{% endblocktrans %}
27
+ </th>
13
28
  </tr>
14
29
  </thead>
15
30
  <tbody>
@@ -29,16 +44,25 @@
29
44
  </button>
30
45
  <dialog>
31
46
  <form method="dialog">
32
- <div id="{{ unique_id }}_target" class="map_fragment"></div>
47
+ <div id="{{ unique_id }}_target" class="map_fragment">
48
+ </div>
33
49
  <p class="close-dialog">
34
- <button class="button" type="submit">Close</button>
50
+ <button class="button" type="submit">
51
+ Close
52
+ </button>
35
53
  </p>
36
54
  </form>
37
55
  </dialog>
38
56
  </td>
39
- <td>{{ map_inst.get_share_status_display }}</td>
40
- <td>{{ map_inst.get_edit_status_display }}</td>
41
- <td>{{ map_inst.modified_at }}</td>
57
+ <td>
58
+ {{ map_inst.get_share_status_display }}
59
+ </td>
60
+ <td>
61
+ {{ map_inst.get_edit_status_display }}
62
+ </td>
63
+ <td>
64
+ {{ map_inst.modified_at }}
65
+ </td>
42
66
  <td>
43
67
  <a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a>
44
68
  </td>
@@ -1,7 +1,6 @@
1
1
  {% load i18n %}
2
2
 
3
3
  {% include "umap/components/alerts/alert.html" %}
4
-
5
4
  {% for message in messages %}
6
5
  <script type="module" defer>
7
6
  U.Alert.success("{{ message }}")
@@ -1,4 +1,5 @@
1
1
  {% load i18n %}
2
+
2
3
  <nav class="umap-nav">
3
4
  <section>
4
5
  {% include "umap/branding.html" %}
@@ -21,7 +22,7 @@
21
22
  <a href="{% url "about" %}">{% trans "About" %}</a>
22
23
  </li>
23
24
  <li>
24
- <a href="{{ UMAP_FEEDBACK_LINK }}">{% trans "Help" %}</a>
25
+ <a href="{{ UMAP_HELP_URL }}">{% trans "Help" %}</a>
25
26
  </li>
26
27
  {% if user.is_authenticated %}
27
28
  {% if user.has_usable_password %}
@@ -1,7 +1,11 @@
1
1
  {% extends "umap/content.html" %}
2
+
2
3
  {% load i18n %}
4
+
3
5
  {% block content %}
4
- <h2 class="section">{% trans "Password change" %}</h2>
6
+ <h2 class="section">
7
+ {% trans "Password change" %}
8
+ </h2>
5
9
  <p>
6
10
  {% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}
7
11
  </p>
@@ -1,8 +1,14 @@
1
1
  {% extends "umap/content.html" %}
2
+
2
3
  {% load i18n %}
4
+
3
5
  {% block content %}
4
- <h2 class="section">{% trans "Password change successful" %}</h2>
5
- <p>{% trans "Your password was changed." %}</p>
6
+ <h2 class="section">
7
+ {% trans "Password change successful" %}
8
+ </h2>
9
+ <p>
10
+ {% trans "Your password was changed." %}
11
+ </p>
6
12
  <p>
7
13
  <a href="{% url 'home' %}">Home</a>
8
14
  </p>
@@ -1,5 +1,7 @@
1
1
  {% extends "umap/content.html" %}
2
+
2
3
  {% load i18n %}
4
+
3
5
  {% block messages %}
4
6
  {# We don't want maps from the results list to display errors in the main page. #}
5
7
  {% endblock messages %}
@@ -18,10 +20,14 @@
18
20
  </h2>
19
21
  {% include "umap/map_list.html" with prefix="search_map" %}
20
22
  {% else %}
21
- <h2>{% trans "No map found." %}</h2>
23
+ <h2>
24
+ {% trans "No map found." %}
25
+ </h2>
22
26
  {% endif %}
23
27
  {% else %}
24
- <h2>{% trans "Latest created maps" %}</h2>
28
+ <h2>
29
+ {% trans "Latest created maps" %}
30
+ </h2>
25
31
  {% include "umap/map_list.html" with prefix="search_map" %}
26
32
  {% endif %}
27
33
  </div>
@@ -1,4 +1,5 @@
1
1
  {% load i18n %}
2
+
2
3
  {% url "search" as search_url %}
3
4
  {% trans "Search maps" as default_placeholder %}
4
5
  <div class="wrapper search_wrapper">
@@ -0,0 +1,19 @@
1
+ {% extends "umap/content.html" %}
2
+
3
+ {% load i18n %}
4
+
5
+ {% block maincontent %}
6
+ {% include "umap/dashboard_menu.html" with selected="teams" %}
7
+ <div class="wrapper">
8
+ <div class="row">
9
+ <form method="post">
10
+ {% csrf_token %}
11
+ <p>
12
+ Are you sure you want to delete "{{ object }}"?
13
+ </p>
14
+ {{ form }}
15
+ <input type="submit" value="Confirm">
16
+ </form>
17
+ </div>
18
+ </div>
19
+ {% endblock maincontent %}
@@ -0,0 +1,27 @@
1
+ {% extends "umap/content.html" %}
2
+
3
+ {% load i18n %}
4
+
5
+ {% block maincontent %}
6
+ <div class="wrapper">
7
+ <div class="row">
8
+ <div class="col wide">
9
+ <h2 class="section">
10
+ {% blocktrans %}Browse {{ current_team }}'s maps{% endblocktrans %}
11
+ </h2>
12
+ {% if current_team.description %}
13
+ <p>{{ current_team.description }}</p>
14
+ {% endif %}
15
+ </div>
16
+ </div>
17
+ <div class="map_list row">
18
+ {% if maps %}
19
+ {% include "umap/map_list.html" %}
20
+ {% else %}
21
+ <div>
22
+ {% blocktrans %}{{ current_team }} has no public maps.{% endblocktrans %}
23
+ </div>
24
+ {% endif %}
25
+ </div>
26
+ </div>
27
+ {% endblock maincontent %}
@@ -0,0 +1,60 @@
1
+ {% extends "umap/content.html" %}
2
+
3
+ {% load i18n %}
4
+
5
+ {% block maincontent %}
6
+ {% include "umap/dashboard_menu.html" with selected="teams" %}
7
+ <div class="wrapper">
8
+ <div class="row">
9
+ {% if form.non_field_errors %}
10
+ <ul class="form-errors">
11
+ {% for error in form.non_field_errors %}
12
+ <li>
13
+ {{ error }}
14
+ </li>
15
+ {% endfor %}
16
+ </ul>
17
+ {% endif %}
18
+ <form id="team_form" method="post">
19
+ {% csrf_token %}
20
+ {{ form }}
21
+ <input type="submit" value="{% trans "Save" %}" />
22
+ </form>
23
+ {% if team.users.count == 1 %}
24
+ <a href="{% url 'team_delete' team.pk %}">{% trans "Delete this team" %}</a>
25
+ {% endif %}
26
+ </div>
27
+ </div>
28
+ <script type="module" defer>
29
+ const form = document.querySelector("#team_form")
30
+ const select = form.querySelector('#id_members')
31
+ if (select) {
32
+ function onSelect({item: {value, label}}) {
33
+ const option = document.createElement('option')
34
+ option.value = value
35
+ option.textContent = label
36
+ option.selected = "selected"
37
+ select.appendChild(option)
38
+ }
39
+ function onUnselect({item: {value, label}}) {
40
+ const option = select.querySelector(`[value="${value}"]`)
41
+ select.removeChild(option)
42
+ }
43
+ const options = {
44
+ className: 'edit-team-members',
45
+ on_select: onSelect,
46
+ on_unselect: onUnselect,
47
+ placeholder: "{% trans "Add user" %}"
48
+ }
49
+ const autocomplete = new U.AjaxAutocompleteMultiple(form, options)
50
+ for (const option of select.options) {
51
+ autocomplete.displaySelected({
52
+ item: { value: option.value, label: option.textContent },
53
+ })
54
+ }
55
+ const submit = form.querySelector('input[type="submit"]')
56
+ // Move it after the autocomplete widget.
57
+ form.appendChild(submit)
58
+ }
59
+ </script>
60
+ {% endblock maincontent %}
@@ -1,23 +1,21 @@
1
1
  {% extends "umap/content.html" %}
2
+
2
3
  {% load i18n %}
4
+
3
5
  {% block head_title %}
4
6
  {{ SITE_NAME }} - {% trans "My Dashboard" %}
5
7
  {% endblock head_title %}
6
8
  {% block maincontent %}
7
9
  {% trans "Search my maps" as placeholder %}
8
- <div class="row">
9
- <h2 class="section tabs">
10
- <a class="selected" href="{% url 'user_dashboard' %}">{% blocktranslate with count=maps.paginator.count %}My Maps ({{ count }}){% endblocktranslate %}
11
- </a>
12
- <a href="{% url 'user_profile' %}">{% trans "My profile" %}</a>
13
- </h2>
14
- </div>
10
+ {% include "umap/dashboard_menu.html" with selected="maps" %}
15
11
  <div class="wrapper">
16
12
  <div class="row">
17
13
  <div class="table-header">
18
14
  <form action="{{ request.get_full_path }}" method="get">
19
15
  <span>
20
- <label class="sr-only" for="q">{% translate "Map’s title" %}</label>
16
+ <label class="sr-only" for="q">
17
+ {% translate "Map’s title" %}
18
+ </label>
21
19
  <input id="q"
22
20
  name="q"
23
21
  type="search"
@@ -55,7 +53,7 @@
55
53
  const button = event.target.closest('button')
56
54
  button.nextElementSibling.showModal()
57
55
  const mapId = button.dataset.mapId
58
- if (!document.querySelector(`#${mapId}_target`).hasChildNodes()) {
56
+ if (!document.querySelector(`#${mapId}_target`).children.length) {
59
57
  const previewSettings = JSON.parse(document.getElementById(mapId).textContent)
60
58
  const map = new U.Map(`${mapId}_target`, previewSettings)
61
59
  CACHE[mapId] = map
@@ -0,0 +1,51 @@
1
+ {% extends "umap/content.html" %}
2
+
3
+ {% load i18n %}
4
+
5
+ {% block maincontent %}
6
+ {% include "umap/dashboard_menu.html" with selected="teams" %}
7
+ <div class="wrapper">
8
+ <div class="row">
9
+ <div class="table-wrapper">
10
+ <table>
11
+ <thead>
12
+ <tr>
13
+ <th>
14
+ {% blocktrans %}Name{% endblocktrans %}
15
+ </th>
16
+ <th>
17
+ {% blocktrans %}Users{% endblocktrans %}
18
+ </th>
19
+ <th>
20
+ {% blocktrans %}Actions{% endblocktrans %}
21
+ </th>
22
+ </tr>
23
+ </thead>
24
+ <tbody>
25
+ {% for team in teams %}
26
+ <tr>
27
+ <th scope="row">
28
+ <a href="{% url 'team_maps' team.pk %}">{{ team }}</a>
29
+ </th>
30
+ <td>
31
+ {% for user in team.users.all %}
32
+ {{ user }}{% if not forloop.last %}, {% endif %}
33
+ {% endfor %}
34
+ </td>
35
+ <td>
36
+ <a href="{% url 'team_update' team.pk %}"
37
+ class="icon-link"
38
+ title="{% translate "Edit" %}">
39
+ <span class="icon-dashboard icon-edit"></span>
40
+ <span class="sr-only">{% translate "Edit" %}</span>
41
+ </a>
42
+ </td>
43
+ </tr>
44
+ {% endfor %}
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ <a class="button" href="{% url 'team_new' %}">{% trans "New team" %}</a>
49
+ </div>
50
+ </div>
51
+ {% endblock maincontent %}
umap/tests/base.py CHANGED
@@ -7,7 +7,7 @@ from django.core.files.base import ContentFile
7
7
  from django.urls import reverse
8
8
 
9
9
  from umap.forms import DEFAULT_CENTER
10
- from umap.models import DataLayer, Licence, Map, TileLayer
10
+ from umap.models import DataLayer, Licence, Map, Team, TileLayer
11
11
 
12
12
  User = get_user_model()
13
13
 
@@ -58,6 +58,13 @@ class UserFactory(factory.django.DjangoModelFactory):
58
58
  model = User
59
59
 
60
60
 
61
+ class TeamFactory(factory.django.DjangoModelFactory):
62
+ name = "Awesome Team"
63
+
64
+ class Meta:
65
+ model = Team
66
+
67
+
61
68
  class MapFactory(factory.django.DjangoModelFactory):
62
69
  name = "test map"
63
70
  slug = "test-map"
umap/tests/conftest.py CHANGED
@@ -11,6 +11,7 @@ from .base import (
11
11
  DataLayerFactory,
12
12
  LicenceFactory,
13
13
  MapFactory,
14
+ TeamFactory,
14
15
  TileLayerFactory,
15
16
  UserFactory,
16
17
  )
@@ -29,6 +30,11 @@ def pytest_runtest_teardown():
29
30
  cache.clear()
30
31
 
31
32
 
33
+ @pytest.fixture
34
+ def team():
35
+ return TeamFactory()
36
+
37
+
32
38
  @pytest.fixture
33
39
  def user():
34
40
  return UserFactory(password="123123")
@@ -0,0 +1,219 @@
1
+ {
2
+ "type": "FeatureCollection",
3
+ "features": [
4
+ {
5
+ "type": "Feature",
6
+ "geometry": {
7
+ "type": "Point",
8
+ "coordinates": [
9
+ -1.5869228,
10
+ 47.1988448
11
+ ]
12
+ },
13
+ "properties": {
14
+ "@id": "node/8371195387",
15
+ "access": "private",
16
+ "amenity": "bicycle_parking",
17
+ "covered": "yes",
18
+ "fee": "no",
19
+ "name": "station with unknown capacity"
20
+ },
21
+ "id": "capa0"
22
+ },
23
+ {
24
+ "type": "Feature",
25
+ "geometry": {
26
+ "type": "Point",
27
+ "coordinates": [
28
+ -1.5567325,
29
+ 47.2223201
30
+ ]
31
+ },
32
+ "properties": {
33
+ "@id": "node/3750335624",
34
+ "amenity": "bicycle_parking",
35
+ "bicycle_parking": "stands",
36
+ "capacity": "2",
37
+ "check_date:capacity": "2021-05-12",
38
+ "covered": "no",
39
+ "material": "metal",
40
+ "name": "tiny station with 2"
41
+ },
42
+ "id": "capa2"
43
+ },
44
+ {
45
+ "type": "Feature",
46
+ "geometry": {
47
+ "type": "Point",
48
+ "coordinates": [
49
+ -1.5293571,
50
+ 47.2285598
51
+ ]
52
+ },
53
+ "properties": {
54
+ "@id": "node/7149702104",
55
+ "amenity": "bicycle_parking",
56
+ "bicycle_parking": "wall_loops",
57
+ "covered": "yes",
58
+ "capacity": "2",
59
+ "name": "tiny station with 3"
60
+ },
61
+ "id": "capa3"
62
+ },
63
+ {
64
+ "type": "Feature",
65
+ "geometry": {
66
+ "type": "Point",
67
+ "coordinates": [
68
+ -1.5613176,
69
+ 47.2223468
70
+ ]
71
+ },
72
+ "properties": {
73
+ "@id": "node/5206704322",
74
+ "amenity": "bicycle_parking",
75
+ "bicycle_parking": "stands",
76
+ "capacity": "4",
77
+ "name": "small station with 4"
78
+ },
79
+ "id": "capa4"
80
+ },
81
+ {
82
+ "type": "Feature",
83
+ "geometry": {
84
+ "type": "Point",
85
+ "coordinates": [
86
+ -1.5465724,
87
+ 47.2074831
88
+ ]
89
+ },
90
+ "properties": {
91
+ "@id": "node/10539987424",
92
+ "amenity": "bicycle_parking",
93
+ "bicycle_parking": "stands",
94
+ "capacity": "6",
95
+ "covered": "no",
96
+ "material": "metal",
97
+ "name": "small station with 6"
98
+ },
99
+ "id": "capa6"
100
+ },
101
+ {
102
+ "type": "Feature",
103
+ "geometry": {
104
+ "type": "Point",
105
+ "coordinates": [
106
+ -1.5877882,
107
+ 47.2179441
108
+ ]
109
+ },
110
+ "properties": {
111
+ "@id": "node/10239046793",
112
+ "amenity": "bicycle_parking",
113
+ "capacity": 8
114
+ },
115
+ "id": "capa8"
116
+ },
117
+ {
118
+ "type": "Feature",
119
+ "geometry": {
120
+ "type": "Point",
121
+ "coordinates": [
122
+ -1.5406938,
123
+ 47.2312451
124
+ ]
125
+ },
126
+ "properties": {
127
+ "@id": "node/5176046494",
128
+ "amenity": "bicycle_parking",
129
+ "bicycle_parking": "rack",
130
+ "capacity": "27",
131
+ "name": "middle station with 27"
132
+ },
133
+ "id": "cap27"
134
+ },
135
+ {
136
+ "type": "Feature",
137
+ "geometry": {
138
+ "type": "Point",
139
+ "coordinates": [
140
+ -1.5344658,
141
+ 47.1988441
142
+ ]
143
+ },
144
+ "properties": {
145
+ "@id": "node/4126326089",
146
+ "access": "private",
147
+ "amenity": "bicycle_parking",
148
+ "bicycle_parking": "building",
149
+ "capacity": "64",
150
+ "covered": "yes",
151
+ "material": "metal",
152
+ "name": "middle station with 64"
153
+ },
154
+ "id": "cap64"
155
+ },
156
+ {
157
+ "type": "Feature",
158
+ "geometry": {
159
+ "type": "Point",
160
+ "coordinates": [
161
+ -1.5433176,
162
+ 47.2172633
163
+ ]
164
+ },
165
+ "properties": {
166
+ "@id": "way/1001063092",
167
+ "access": "yes",
168
+ "amenity": "bicycle_parking",
169
+ "architect": "Forma 6;Phytolab",
170
+ "bicycle_parking": "shed",
171
+ "building": "roof",
172
+ "building:architecture": "contemporary",
173
+ "capacity": "676",
174
+ "capacity:cargo_bike": "22",
175
+ "capacity:motorcycle": "33",
176
+ "covered": "yes",
177
+ "fee": "no",
178
+ "name": "big station with 676",
179
+ "start_date": "2021-11-15",
180
+ "@geometry": "center"
181
+ },
182
+ "id": "ca676"
183
+ },
184
+ {
185
+ "type": "Feature",
186
+ "geometry": {
187
+ "type": "Point",
188
+ "coordinates": [
189
+ -1.5291998,
190
+ 47.259166
191
+ ]
192
+ },
193
+ "properties": {
194
+ "@id": "node/11141117088",
195
+ "amenity": "bicycle_parking",
196
+ "bicycle_parking": "stands",
197
+ "capacity": "1160",
198
+ "temporary": "yes",
199
+ "temporary:date_off": "2023-10-28",
200
+ "temporary:date_on": "2023-09-08",
201
+ "name": "huge station with 1160"
202
+ },
203
+ "id": "c1160"
204
+ }
205
+ ],
206
+ "_umap_options": {
207
+ "displayOnLoad": true,
208
+ "inCaption": true,
209
+ "browsable": true,
210
+ "editMode": "advanced",
211
+ "name": "Calque 1",
212
+ "remoteData": {},
213
+ "type": "Circles",
214
+ "circles": {
215
+ "radius": {"min": 2, "max": 40},
216
+ "property": "capacity"
217
+ }
218
+ }
219
+ }
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <rss version="2.0" xmlns:creativeCommons="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:flickr="urn:flickr:user" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:georss="http://www.georss.org/georss" xmlns:media="http://search.yahoo.com/mrss/" xmlns:woe="http://where.yahooapis.com/v1/schema.rng">
3
+ <channel>
4
+ <title>Test stream</title>
5
+ <link>http://www.pouet.fr/link/</link>
6
+ <description/>
7
+ <pubDate>Sun, 13 Apr 2014 09:20:36 -0700</pubDate>
8
+ <lastBuildDate>Sun, 13 Apr 2014 09:20:36 -0700</lastBuildDate>
9
+ <generator>http://www.pouet.com/</generator>
10
+ <item>
11
+ <title>Title 1</title>
12
+ <link>http://link.com</link>
13
+ <description>Description 1</description>
14
+ <pubDate>Sun, 13 Apr 2014 09:20:36 -0700</pubDate>
15
+ <geo:lat>53.443324</geo:lat>
16
+ <geo:long>-2.218337</geo:long>
17
+ <enclosure url="http://farm4.staticflickr.com/3758/13906321891_faa9be0b8e_b.jpg" type="image/jpeg" />
18
+ </item>
19
+ </channel>
20
+ </rss>
@@ -27,10 +27,24 @@ def mock_osm_tiles(page):
27
27
 
28
28
 
29
29
  @pytest.fixture
30
- def page(context):
31
- page = context.new_page()
32
- page.on("console", lambda msg: print(msg.text) if msg.type != "warning" else None)
33
- return page
30
+ def new_page(context):
31
+ def make_page(prefix="console"):
32
+ page = context.new_page()
33
+ page.on(
34
+ "console",
35
+ lambda msg: print(f"{prefix}: {msg.text}")
36
+ if msg.type != "warning"
37
+ else None,
38
+ )
39
+ page.on("pageerror", lambda exc: print(f"{prefix} uncaught exception: {exc}"))
40
+ return page
41
+
42
+ yield make_page
43
+
44
+
45
+ @pytest.fixture
46
+ def page(new_page):
47
+ return new_page()
34
48
 
35
49
 
36
50
  @pytest.fixture