c2cgeoportal-admin 2.5.0.100__py3-none-any.whl → 2.7.1.156__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.
Files changed (91) hide show
  1. c2cgeoportal_admin/__init__.py +19 -12
  2. c2cgeoportal_admin/lib/__init__.py +0 -0
  3. c2cgeoportal_admin/lib/lingua_extractor.py +77 -0
  4. c2cgeoportal_admin/lib/ogcserver_synchronizer.py +409 -0
  5. c2cgeoportal_admin/py.typed +0 -0
  6. c2cgeoportal_admin/routes.py +18 -10
  7. c2cgeoportal_admin/schemas/dimensions.py +13 -11
  8. c2cgeoportal_admin/schemas/functionalities.py +63 -22
  9. c2cgeoportal_admin/schemas/interfaces.py +23 -19
  10. c2cgeoportal_admin/schemas/metadata.py +121 -47
  11. c2cgeoportal_admin/schemas/restriction_areas.py +22 -20
  12. c2cgeoportal_admin/schemas/roles.py +8 -6
  13. c2cgeoportal_admin/schemas/treegroup.py +84 -18
  14. c2cgeoportal_admin/schemas/treeitem.py +2 -3
  15. c2cgeoportal_admin/static/layertree.css +26 -4
  16. c2cgeoportal_admin/static/navbar.css +59 -36
  17. c2cgeoportal_admin/static/theme.css +48 -11
  18. c2cgeoportal_admin/subscribers.py +3 -3
  19. c2cgeoportal_admin/templates/404.jinja2 +23 -0
  20. c2cgeoportal_admin/templates/edit.jinja2 +23 -0
  21. c2cgeoportal_admin/templates/home.jinja2 +23 -0
  22. c2cgeoportal_admin/templates/index.jinja2 +23 -0
  23. c2cgeoportal_admin/templates/layertree.jinja2 +55 -11
  24. c2cgeoportal_admin/templates/layout.jinja2 +23 -0
  25. c2cgeoportal_admin/templates/navigation_navbar.jinja2 +56 -0
  26. c2cgeoportal_admin/templates/ogcserver_synchronize.jinja2 +90 -0
  27. c2cgeoportal_admin/templates/widgets/child.pt +35 -3
  28. c2cgeoportal_admin/templates/widgets/children.pt +121 -92
  29. c2cgeoportal_admin/templates/widgets/dimension.pt +23 -0
  30. c2cgeoportal_admin/templates/widgets/dimensions.pt +23 -0
  31. c2cgeoportal_admin/templates/widgets/functionality_fields.pt +51 -0
  32. c2cgeoportal_admin/templates/widgets/layer_fields.pt +23 -0
  33. c2cgeoportal_admin/templates/widgets/layer_group_fields.pt +23 -0
  34. c2cgeoportal_admin/templates/widgets/layer_v1_fields.pt +23 -0
  35. c2cgeoportal_admin/templates/widgets/metadata.pt +30 -1
  36. c2cgeoportal_admin/templates/widgets/metadatas.pt +23 -0
  37. c2cgeoportal_admin/templates/widgets/ogcserver_fields.pt +23 -0
  38. c2cgeoportal_admin/templates/widgets/restriction_area_fields.pt +25 -9
  39. c2cgeoportal_admin/templates/widgets/role_fields.pt +52 -25
  40. c2cgeoportal_admin/templates/widgets/theme_fields.pt +23 -0
  41. c2cgeoportal_admin/templates/widgets/user_fields.pt +23 -0
  42. c2cgeoportal_admin/views/dimension_layers.py +7 -6
  43. c2cgeoportal_admin/views/functionalities.py +31 -5
  44. c2cgeoportal_admin/views/home.py +5 -5
  45. c2cgeoportal_admin/views/interfaces.py +8 -8
  46. c2cgeoportal_admin/views/layer_groups.py +9 -11
  47. c2cgeoportal_admin/views/layers.py +8 -7
  48. c2cgeoportal_admin/views/layers_vectortiles.py +30 -10
  49. c2cgeoportal_admin/views/layers_wms.py +45 -37
  50. c2cgeoportal_admin/views/layers_wmts.py +39 -33
  51. c2cgeoportal_admin/views/layertree.py +34 -26
  52. c2cgeoportal_admin/views/oauth2_clients.py +89 -0
  53. c2cgeoportal_admin/views/ogc_servers.py +130 -27
  54. c2cgeoportal_admin/views/restriction_areas.py +50 -8
  55. c2cgeoportal_admin/views/roles.py +60 -8
  56. c2cgeoportal_admin/views/themes.py +15 -14
  57. c2cgeoportal_admin/views/themes_ordering.py +38 -18
  58. c2cgeoportal_admin/views/treeitems.py +12 -11
  59. c2cgeoportal_admin/views/users.py +7 -5
  60. c2cgeoportal_admin/widgets.py +79 -28
  61. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.7.1.156.dist-info}/METADATA +16 -11
  62. c2cgeoportal_admin-2.7.1.156.dist-info/RECORD +92 -0
  63. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.7.1.156.dist-info}/WHEEL +1 -1
  64. c2cgeoportal_admin-2.7.1.156.dist-info/entry_points.txt +5 -0
  65. tests/__init__.py +23 -18
  66. tests/conftest.py +4 -15
  67. tests/test_edit_url.py +16 -18
  68. tests/test_functionalities.py +23 -10
  69. tests/test_interface.py +8 -8
  70. tests/test_layer_groups.py +15 -23
  71. tests/test_layers_vectortiles.py +16 -20
  72. tests/test_layers_wms.py +37 -75
  73. tests/test_layers_wmts.py +20 -24
  74. tests/test_layertree.py +107 -100
  75. tests/test_learn.py +1 -1
  76. tests/test_lingua_extractor_config.py +66 -0
  77. tests/test_main.py +4 -2
  78. tests/test_metadatas.py +79 -70
  79. tests/test_oauth2_clients.py +157 -0
  80. tests/test_ogc_servers.py +51 -7
  81. tests/test_restriction_areas.py +81 -17
  82. tests/test_role.py +110 -76
  83. tests/test_themes.py +44 -37
  84. tests/test_themes_ordering.py +1 -1
  85. tests/test_treegroup.py +2 -2
  86. tests/test_user.py +31 -64
  87. tests/themes_ordering.py +1 -1
  88. c2cgeoportal_admin/templates/navigation_vertical.jinja2 +0 -10
  89. c2cgeoportal_admin-2.5.0.100.dist-info/RECORD +0 -84
  90. c2cgeoportal_admin-2.5.0.100.dist-info/entry_points.txt +0 -3
  91. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.7.1.156.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,26 @@
1
+ /**
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) Camptocamp SA
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ * this software and associated documentation files (the "Software"), to deal in
8
+ * the Software without restriction, including without limitation the rights to
9
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ * the Software, and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
1
24
  #toolbar {
2
25
  margin-top: 10px;
3
26
  margin-bottom: 10px;
@@ -41,7 +64,6 @@
41
64
  padding-left: 0px;
42
65
  }
43
66
 
44
-
45
67
  .jstree-grid-wrapper .jstree-node,
46
68
  .jstree-grid-wrapper .jstree-grid-cell-regular {
47
69
  border-top: 1px solid #ddd;
@@ -92,11 +114,11 @@
92
114
  }
93
115
 
94
116
  .jstree-open .jstree-icon.jstree-ocl:before {
95
- content: "\e252";
117
+ content: '\e252';
96
118
  }
97
119
  .jstree-closed .jstree-icon.jstree-ocl:before {
98
- content: "\e250";
120
+ content: '\e250';
99
121
  }
100
122
  .jstree-leaf .jstree-icon.jstree-ocl:before {
101
- content: "";
123
+ content: '';
102
124
  }
@@ -1,6 +1,28 @@
1
+ /**
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) Camptocamp SA
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ * this software and associated documentation files (the "Software"), to deal in
8
+ * the Software without restriction, including without limitation the rights to
9
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ * the Software, and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
1
23
 
2
24
  /* Change navbar breakpoint to avoid having multiple lines.
3
- * source : https://coderwall.com/p/wpjw4w/change-the-bootstrap-navbar-breakpoint
25
+ * source: https://coderwall.com/p/wpjw4w/change-the-bootstrap-navbar-breakpoint
4
26
  */
5
27
 
6
28
  @media (min-width: 992px) {
@@ -10,7 +32,7 @@
10
32
  }
11
33
 
12
34
  @media (min-width: 992px) and (max-width: 1125px) {
13
- .navbar-default .navbar-nav>li>a {
35
+ .navbar-default .navbar-nav > li > a {
14
36
  max-width: 8.5vw;
15
37
  overflow: hidden;
16
38
  text-overflow: ellipsis;
@@ -20,39 +42,40 @@
20
42
 
21
43
  /*csslint important: false*/
22
44
  @media (max-width: 991px) {
23
- .navbar-header {
24
- float: none;
25
- }
26
- .navbar-left,.navbar-right {
27
- float: none !important;
28
- }
29
- .navbar-toggle {
30
- display: block;
31
- }
32
- .navbar-collapse {
33
- border-top: 1px solid transparent;
34
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
35
- }
36
- .navbar-fixed-top {
37
- top: 0;
38
- border-width: 0 0 1px;
39
- }
40
- .navbar-collapse.collapse {
41
- display: none!important;
42
- }
43
- .navbar-nav {
44
- float: none!important;
45
- margin-top: 7.5px;
46
- }
47
- .navbar-nav>li {
48
- float: none;
49
- }
50
- .navbar-nav>li>a {
51
- padding-top: 10px;
52
- padding-bottom: 10px;
53
- }
54
- .collapse.in{
55
- display:block !important;
56
- }
45
+ .navbar-header {
46
+ float: none;
47
+ }
48
+ .navbar-left,
49
+ .navbar-right {
50
+ float: none !important;
51
+ }
52
+ .navbar-toggle {
53
+ display: block;
54
+ }
55
+ .navbar-collapse {
56
+ border-top: 1px solid transparent;
57
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
58
+ }
59
+ .navbar-fixed-top {
60
+ top: 0;
61
+ border-width: 0 0 1px;
62
+ }
63
+ .navbar-collapse.collapse {
64
+ display: none !important;
65
+ }
66
+ .navbar-nav {
67
+ float: none !important;
68
+ margin-top: 7.5px;
69
+ }
70
+ .navbar-nav > li {
71
+ float: none;
72
+ }
73
+ .navbar-nav > li > a {
74
+ padding-top: 10px;
75
+ padding-bottom: 10px;
76
+ }
77
+ .collapse.in {
78
+ display: block !important;
79
+ }
57
80
  }
58
81
  /*csslint important: true*/
@@ -1,27 +1,55 @@
1
- @import "navbar.css";
1
+ /**
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) Camptocamp SA
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ * this software and associated documentation files (the "Software"), to deal in
8
+ * the Software without restriction, including without limitation the rights to
9
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ * the Software, and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
2
23
 
3
- .nav>li>a {
24
+ @import 'navbar.css';
25
+
26
+ .nav > li > a {
4
27
  padding-left: 8px;
5
28
  padding-right: 8px;
6
29
  }
7
30
 
8
31
  .bootstrap-table th.actions,
9
- .bootstrap-table td.actions
10
- {
32
+ .bootstrap-table td.actions {
11
33
  width: 30px;
12
34
  }
13
35
 
14
36
  .icon-theme:before {
15
- content: "\e139";
37
+ content: '\e139';
16
38
  }
17
39
  .icon-group:before {
18
- content: "\e118";
40
+ content: '\e118';
19
41
  }
20
42
  .icon-l_wms:before {
21
- content: "\e060";
43
+ content: '\e060';
22
44
  }
23
45
  .icon-l_wmts:before {
24
- content: "\e011";
46
+ content: '\e011';
47
+ }
48
+ .icon-mvt:before {
49
+ content: '\e011';
50
+ }
51
+ .icon-user:before {
52
+ content: '\e008';
25
53
  }
26
54
 
27
55
  .ms-res-ctn .ms-res-item {
@@ -29,11 +57,15 @@
29
57
  }
30
58
 
31
59
  .item-theme,
32
- .item-layergroup_treeitem {
60
+ .item-layergroup_treeitem,
61
+ .item-layer,
62
+ .item-user {
33
63
  margin-bottom: 0;
34
64
  }
35
65
  .item-theme .well,
36
- .item-layergroup_treeitem .well {
66
+ .item-layergroup_treeitem .well,
67
+ .item-layer .well,
68
+ .item-user .well {
37
69
  padding: 10px;
38
70
  margin-bottom: 5px;
39
71
  }
@@ -42,5 +74,10 @@
42
74
  }
43
75
 
44
76
  #layertree .alert-info {
45
- margin-top : 30px;
77
+ margin-top: 30px;
78
+ }
79
+
80
+ .item-functionalities .checkbox label {
81
+ overflow: hidden;
82
+ overflow-wrap: break-word;
46
83
  }
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # Copyright (c) 2018-2020, Camptocamp SA
1
+ # Copyright (c) 2018-2021, Camptocamp SA
4
2
  # All rights reserved.
5
3
 
6
4
  # Redistribution and use in source and binary forms, with or without
@@ -34,6 +32,7 @@ from pyramid.i18n import TranslationStringFactory, get_localizer
34
32
 
35
33
 
36
34
  def add_renderer_globals(event):
35
+ """Add the localizer to the global event."""
37
36
  request = event["request"]
38
37
  event["_"] = request.translate
39
38
  event["localizer"] = request.localizer
@@ -44,6 +43,7 @@ tsf2 = TranslationStringFactory("c2cgeoform")
44
43
 
45
44
 
46
45
  def add_localizer(event):
46
+ """Add the localizer to the request."""
47
47
  request = event.request
48
48
  localizer = get_localizer(request)
49
49
 
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  {% extends "layout.jinja2" %}
2
25
 
3
26
  {% block content %}
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  {% extends "layout.jinja2" %}
2
25
 
3
26
  {% block content %}
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  {% extends "layout.jinja2" %}
2
25
 
3
26
  {% block content %}
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  {% extends "layout.jinja2" %}
2
25
 
3
26
  {% block extra_links %}
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  {% extends "layout.jinja2" %}
2
25
 
3
26
  {% block extra_links %}
@@ -14,15 +37,26 @@
14
37
  {% block content %}
15
38
  <div id="layertree" class="container-fluid">
16
39
  <div id="toolbar">
17
- <div class="btn-group">
18
- {% if limit_exceeded %}
19
- <button id="layertree-expand" type="button" class="btn btn-default"><span class="glyphicon glyphicon-chevron-down"></span> {{_("Expand all")}}</button>
20
- {% endif %}
21
- <button id="layertree-collapse" type="button" class="btn btn-default"><span class="glyphicon glyphicon-chevron-up"></span> {{_("Collapse all")}}</button>
22
- </div>
23
- <div class="btn-group">
24
- <a id="layertree-ordering" class="btn btn-default" href="{{request.route_url('layertree_ordering')}}"><span class="glyphicon glyphicon-sort"></span> {{_("Edit themes order")}}</a>
25
- </div>
40
+ <form class="form-inline">
41
+ <div class="form-group">
42
+ <label for="interface">{{ _("Interface") }}</label>
43
+ <select class="form-control" id="interface">
44
+ <option value="all">{{ _("All") }}</option>
45
+ {% for interface in interfaces %}
46
+ <option>{{ interface.name }}</option>
47
+ {% endfor %}
48
+ </select>
49
+ </div>
50
+ <div class="btn-group">
51
+ {% if limit_exceeded %}
52
+ <button id="layertree-expand" type="button" class="btn btn-default"><span class="glyphicon glyphicon-chevron-down"></span> {{_("Expand all")}}</button>
53
+ {% endif %}
54
+ <button id="layertree-collapse" type="button" class="btn btn-default"><span class="glyphicon glyphicon-chevron-up"></span> {{_("Collapse all")}}</button>
55
+ </div>
56
+ <div class="btn-group">
57
+ <a id="layertree-ordering" class="btn btn-default" href="{{request.route_url('layertree_ordering')}}"><span class="glyphicon glyphicon-sort"></span> {{_("Edit themes order")}}</a>
58
+ </div>
59
+ </form>
26
60
  </div>
27
61
 
28
62
  <div id="tree"></div>
@@ -33,8 +67,14 @@
33
67
  core: {
34
68
  data: function(node, callback) {
35
69
  var url = "{{ request.route_url('layertree_children') }}";
70
+ let separator = '?';
36
71
  if (node.id != '#') {
37
72
  url += "?group_id=" + node.data.id + "&path=" + node.id;
73
+ separator = '&';
74
+ }
75
+ const interface = $('#interface')[0].value;
76
+ if (interface != 'all') {
77
+ url += separator + "interface=" + interface;
38
78
  }
39
79
  $.ajax({ url: url })
40
80
  .done(function(data) {
@@ -163,8 +203,7 @@
163
203
  type: $(this).data('method'),
164
204
  success: function(data) {
165
205
  if (this.type == 'DELETE') {
166
- //$grid.bootstrapTable('refresh');
167
- $jstree.jstree(true).delete_node(node_id);
206
+ $jstree.jstree(true).refresh();
168
207
  } else {
169
208
  window.location = data.redirect;
170
209
  }
@@ -204,6 +243,11 @@
204
243
  $('.jstree-grid-wrapper').height($(window).height() - $('nav').height() - $('#toolbar').height() - 50);
205
244
  $('.jstree-grid-wrapper').width('100%');
206
245
  });
246
+
247
+ const interfaceField = $('#interface');
248
+ interfaceField.on('change', function(e) {
249
+ $jstree.jstree(true).refresh();
250
+ });
207
251
  });
208
252
  </script>
209
253
 
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  <!DOCTYPE html>
2
25
  <html lang="{{request.locale_name}}">
3
26
  <head>
@@ -1,3 +1,26 @@
1
+ {#
2
+ # The MIT License (MIT)
3
+ #
4
+ # Copyright (c) Camptocamp SA
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ # this software and associated documentation files (the "Software"), to deal in
8
+ # the Software without restriction, including without limitation the rights to
9
+ # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ # the Software, and to permit persons to whom the Software is furnished to do so,
11
+ # subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #}
23
+
1
24
  <nav class="navbar navbar-default">
2
25
  <div class="container-fluid">
3
26
  <!-- Brand and toggle get grouped for better mobile display -->
@@ -23,6 +46,39 @@
23
46
  {% endfor %}
24
47
  </ul>
25
48
 
49
+ <button id="help-button" type="button" class="btn btn-default navbar-btn navbar-right">{{_("Show help")}}</button>
50
+ <script>
51
+ $(function() {
52
+ const key = 'adminShowHelp';
53
+
54
+ const getCurrentValue = function() {
55
+ // Get current value from localStorage
56
+ // True by default
57
+ return localStorage.getItem(key) !== 'false'
58
+ }
59
+
60
+ const apply = function(value) {
61
+ // Apply some value on UI
62
+ if (value) {
63
+ $("#help-button").addClass("active")
64
+ $(".help-block").removeClass("hidden")
65
+ } else {
66
+ $("#help-button").removeClass("active")
67
+ $(".help-block").addClass("hidden")
68
+ }
69
+ }
70
+
71
+ $("#help-button").click(function() {
72
+ // Toggle value in localStorage and apply on UI
73
+ localStorage.setItem(key, getCurrentValue() ? 'false' : 'true');
74
+ apply(getCurrentValue())
75
+ })
76
+
77
+ // Apply current value from localStorage on UI
78
+ apply(getCurrentValue())
79
+ });
80
+ </script>
81
+
26
82
  <ul class="nav navbar-nav navbar-right">
27
83
  <li id="language-dropdown" class="dropdown">
28
84
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{request.locale_name}} <span class="caret"></span></a>