c2cgeoportal-admin 2.5.0.100__py3-none-any.whl → 2.9rc44__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 (99) hide show
  1. c2cgeoportal_admin/__init__.py +44 -14
  2. c2cgeoportal_admin/lib/__init__.py +0 -0
  3. c2cgeoportal_admin/lib/lingva_extractor.py +77 -0
  4. c2cgeoportal_admin/lib/ogcserver_synchronizer.py +410 -0
  5. c2cgeoportal_admin/py.typed +0 -0
  6. c2cgeoportal_admin/routes.py +30 -11
  7. c2cgeoportal_admin/schemas/dimensions.py +17 -11
  8. c2cgeoportal_admin/schemas/functionalities.py +60 -22
  9. c2cgeoportal_admin/schemas/interfaces.py +27 -19
  10. c2cgeoportal_admin/schemas/metadata.py +122 -48
  11. c2cgeoportal_admin/schemas/restriction_areas.py +26 -20
  12. c2cgeoportal_admin/schemas/roles.py +13 -7
  13. c2cgeoportal_admin/schemas/treegroup.py +90 -20
  14. c2cgeoportal_admin/schemas/treeitem.py +3 -4
  15. c2cgeoportal_admin/static/layertree.css +26 -4
  16. c2cgeoportal_admin/static/navbar.css +59 -36
  17. c2cgeoportal_admin/static/theme.css +51 -11
  18. c2cgeoportal_admin/subscribers.py +3 -3
  19. c2cgeoportal_admin/templates/404.jinja2 +41 -2
  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/__init__.py +29 -0
  43. c2cgeoportal_admin/views/dimension_layers.py +14 -9
  44. c2cgeoportal_admin/views/functionalities.py +52 -18
  45. c2cgeoportal_admin/views/home.py +5 -5
  46. c2cgeoportal_admin/views/interfaces.py +29 -21
  47. c2cgeoportal_admin/views/layer_groups.py +36 -25
  48. c2cgeoportal_admin/views/layers.py +17 -13
  49. c2cgeoportal_admin/views/layers_cog.py +135 -0
  50. c2cgeoportal_admin/views/layers_vectortiles.py +62 -27
  51. c2cgeoportal_admin/views/layers_wms.py +61 -36
  52. c2cgeoportal_admin/views/layers_wmts.py +54 -32
  53. c2cgeoportal_admin/views/layertree.py +37 -28
  54. c2cgeoportal_admin/views/logged_views.py +83 -0
  55. c2cgeoportal_admin/views/logs.py +91 -0
  56. c2cgeoportal_admin/views/oauth2_clients.py +96 -0
  57. c2cgeoportal_admin/views/ogc_servers.py +192 -21
  58. c2cgeoportal_admin/views/restriction_areas.py +78 -25
  59. c2cgeoportal_admin/views/roles.py +88 -25
  60. c2cgeoportal_admin/views/themes.py +47 -35
  61. c2cgeoportal_admin/views/themes_ordering.py +44 -24
  62. c2cgeoportal_admin/views/treeitems.py +21 -17
  63. c2cgeoportal_admin/views/users.py +46 -26
  64. c2cgeoportal_admin/widgets.py +79 -28
  65. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.9rc44.dist-info}/METADATA +15 -13
  66. c2cgeoportal_admin-2.9rc44.dist-info/RECORD +97 -0
  67. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.9rc44.dist-info}/WHEEL +1 -1
  68. c2cgeoportal_admin-2.9rc44.dist-info/entry_points.txt +5 -0
  69. tests/__init__.py +36 -27
  70. tests/conftest.py +23 -24
  71. tests/test_edit_url.py +16 -19
  72. tests/test_functionalities.py +52 -14
  73. tests/test_home.py +0 -1
  74. tests/test_interface.py +35 -12
  75. tests/test_layer_groups.py +58 -32
  76. tests/test_layers_cog.py +243 -0
  77. tests/test_layers_vectortiles.py +46 -30
  78. tests/test_layers_wms.py +77 -82
  79. tests/test_layers_wmts.py +51 -30
  80. tests/test_layertree.py +107 -101
  81. tests/test_learn.py +1 -1
  82. tests/test_left_menu.py +0 -1
  83. tests/test_lingva_extractor_config.py +64 -0
  84. tests/test_logs.py +102 -0
  85. tests/test_main.py +4 -2
  86. tests/test_metadatas.py +79 -71
  87. tests/test_oauth2_clients.py +186 -0
  88. tests/test_ogc_servers.py +110 -28
  89. tests/test_restriction_areas.py +109 -20
  90. tests/test_role.py +142 -82
  91. tests/test_themes.py +75 -41
  92. tests/test_themes_ordering.py +1 -2
  93. tests/test_treegroup.py +2 -2
  94. tests/test_user.py +72 -70
  95. tests/themes_ordering.py +1 -2
  96. c2cgeoportal_admin/templates/navigation_vertical.jinja2 +0 -10
  97. c2cgeoportal_admin-2.5.0.100.dist-info/RECORD +0 -84
  98. c2cgeoportal_admin-2.5.0.100.dist-info/entry_points.txt +0 -3
  99. {c2cgeoportal_admin-2.5.0.100.dist-info → c2cgeoportal_admin-2.9rc44.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # Copyright (c) 2018-2020, Camptocamp SA
1
+ # Copyright (c) 2018-2024, Camptocamp SA
4
2
  # All rights reserved.
5
3
 
6
4
  # Redistribution and use in source and binary forms, with or without
@@ -28,19 +26,37 @@
28
26
  # either expressed or implied, of the FreeBSD Project.
29
27
 
30
28
 
29
+ import logging
31
30
  from functools import partial
31
+ from typing import Any
32
32
 
33
- from c2cgeoform.schema import GeoFormSchemaNode
34
33
  import colander
34
+ import pyramid.request
35
+ import sqlalchemy
36
+ from c2cgeoform.schema import GeoFormSchemaNode
35
37
  from sqlalchemy.orm import aliased
36
38
  from sqlalchemy.sql.expression import case, func
37
39
 
38
40
  from c2cgeoportal_admin import _
39
41
  from c2cgeoportal_admin.widgets import ChildrenWidget, ChildWidget
40
- from c2cgeoportal_commons.models.main import LayergroupTreeitem, TreeItem
42
+ from c2cgeoportal_commons.lib.literal import Literal
43
+ from c2cgeoportal_commons.models.main import LayergroupTreeitem, TreeGroup, TreeItem
44
+
45
+ _LOG = logging.getLogger(__name__)
46
+
47
+ # Correspondence between TreeItem.item_type and route table segment
48
+ ITEM_TYPE_ROUTE_MAP = {
49
+ "theme": "themes",
50
+ "group": "layer_groups",
51
+ "layer": None,
52
+ "l_wms": "layers_wms",
53
+ "l_wmts": "layers_wmts",
54
+ }
41
55
 
42
56
 
43
57
  class ChildSchemaNode(GeoFormSchemaNode): # pylint: disable=abstract-method
58
+ """Schema of the child nodes."""
59
+
44
60
  def objectify(self, dict_, context=None):
45
61
  if dict_.get("id", None):
46
62
  context = self.dbsession.query(LayergroupTreeitem).get(dict_["id"])
@@ -49,17 +65,24 @@ class ChildSchemaNode(GeoFormSchemaNode): # pylint: disable=abstract-method
49
65
  return context
50
66
 
51
67
 
52
- def treeitems(node, kw, only_groups=False): # pylint: disable=unused-argument
68
+ def treeitems(
69
+ node: TreeGroup, kw: dict[str, pyramid.request.Request], only_groups: bool = False
70
+ ) -> list[dict[str, Any]]:
71
+ """Get a serializable representation of the tree items."""
72
+ del node
53
73
  dbsession = kw["request"].dbsession
74
+ assert isinstance(dbsession, sqlalchemy.orm.Session)
54
75
 
55
- group = case([(func.count(LayergroupTreeitem.id) == 0, "Unlinked")], else_="Others").label("group")
76
+ group = case(
77
+ (func.count(LayergroupTreeitem.id) == 0, "Unlinked"), else_="Others" # pylint: disable=not-callable
78
+ )
56
79
 
57
80
  query = (
58
81
  dbsession.query(TreeItem, group)
59
82
  .distinct()
60
- .outerjoin("parents_relation")
83
+ .outerjoin(TreeItem.parents_relation)
61
84
  .filter(TreeItem.item_type != "theme")
62
- .group_by(TreeItem.id)
85
+ .group_by(TreeItem)
63
86
  .order_by(group.desc(), TreeItem.name)
64
87
  )
65
88
 
@@ -74,7 +97,7 @@ def treeitems(node, kw, only_groups=False): # pylint: disable=unused-argument
74
97
  search_alias = aliased(search_ancestors, name="search_ancestors")
75
98
  relation_alias = aliased(LayergroupTreeitem, name="relation")
76
99
  search_ancestors = search_ancestors.union_all(
77
- dbsession.query(relation_alias.treegroup_id).filter(
100
+ dbsession.query(relation_alias.treegroup_id).filter( # type: ignore[arg-type]
78
101
  relation_alias.treeitem_id == search_alias.c.treegroup_id
79
102
  )
80
103
  )
@@ -85,12 +108,22 @@ def treeitems(node, kw, only_groups=False): # pylint: disable=unused-argument
85
108
  if only_groups:
86
109
  query = query.filter(TreeItem.item_type == "group")
87
110
 
88
- return query
111
+ return [
112
+ {
113
+ "id": item.id,
114
+ "label": item.name,
115
+ "icon_class": f"icon-{item.item_type}",
116
+ "edit_url": treeitem_edit_url(kw["request"], item),
117
+ "group": group,
118
+ }
119
+ for item, group in query
120
+ ]
89
121
 
90
122
 
91
123
  def children_validator(node, cstruct):
124
+ """Get the validator on the children nodes."""
92
125
  for dict_ in cstruct:
93
- if not dict_["treeitem_id"] in [item.id for item, group in node.treeitems]:
126
+ if not dict_["treeitem_id"] in [item["id"] for item in node.candidates]:
94
127
  raise colander.Invalid(
95
128
  node,
96
129
  _("Value {} does not exist in table {} or is not allowed to avoid cycles").format(
@@ -99,22 +132,59 @@ def children_validator(node, cstruct):
99
132
  )
100
133
 
101
134
 
102
- def base_deferred_parent_id_validator(node, kw, model): # pylint: disable=unused-argument
135
+ def base_deferred_parent_id_validator(node, kw, model):
136
+ """Get the validator on the parent node ID."""
137
+ del node
138
+
103
139
  def validator(node, cstruct):
104
140
  if kw["dbsession"].query(model).filter(model.id == cstruct).count() == 0:
105
- raise colander.Invalid(
106
- node, "Value {} does not exist in table {}".format(cstruct, model.__tablename__)
107
- )
141
+ raise colander.Invalid(node, f"Value {cstruct} does not exist in table {model.__tablename__}")
108
142
 
109
143
  return validator
110
144
 
111
145
 
112
- def children_schema_node(only_groups=False):
146
+ def treeitem_edit_url(request: pyramid.request.Request, treeitem: TreeGroup) -> str | None:
147
+ """Get the tree item editing URL."""
148
+ if treeitem.item_type is None:
149
+ return None
150
+ table = ITEM_TYPE_ROUTE_MAP.get(treeitem.item_type, None)
151
+ if table is None:
152
+ _LOG.warning("%s not found in ITEM_TYPE_ROUTE_MAP", treeitem.item_type)
153
+ return None
154
+ return request.route_url( # type: ignore
155
+ "c2cgeoform_item",
156
+ table=ITEM_TYPE_ROUTE_MAP[treeitem.item_type],
157
+ id=treeitem.id,
158
+ )
159
+
160
+
161
+ def children_schema_node(only_groups: bool = False) -> colander.SequenceSchema:
162
+ """Geth the sequence to the children nodes."""
113
163
  return colander.SequenceSchema(
114
- ChildSchemaNode(LayergroupTreeitem, name="layergroup_treeitem", widget=ChildWidget()),
164
+ ChildSchemaNode(
165
+ LayergroupTreeitem,
166
+ name="layergroup_treeitem",
167
+ widget=ChildWidget(
168
+ input_name="treeitem_id",
169
+ model=TreeItem,
170
+ label_field="name",
171
+ icon_class=lambda treeitem: f"icon-{treeitem.item_type}",
172
+ edit_url=treeitem_edit_url,
173
+ ),
174
+ ),
115
175
  name="children_relation",
116
176
  title=_("Children"),
117
- treeitems=colander.deferred(partial(treeitems, only_groups=only_groups)),
177
+ description=Literal(
178
+ _(
179
+ """
180
+ <div class="help-block">
181
+ <p>The ordered children elements.</p>
182
+ <hr>
183
+ </div>
184
+ """
185
+ ),
186
+ ),
187
+ candidates=colander.deferred(partial(treeitems, only_groups=only_groups)),
118
188
  validator=children_validator,
119
- widget=ChildrenWidget(category="structural"),
189
+ widget=ChildrenWidget(child_input_name="treeitem_id", add_subitem=True, orderable=True),
120
190
  )
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # Copyright (c) 2018-2020, Camptocamp SA
1
+ # Copyright (c) 2018-2024, Camptocamp SA
4
2
  # All rights reserved.
5
3
 
6
4
  # Redistribution and use in source and binary forms, with or without
@@ -37,7 +35,8 @@ from c2cgeoportal_admin.schemas.treegroup import base_deferred_parent_id_validat
37
35
 
38
36
 
39
37
  # Used for the creation of a new layer/layergroup from the layertree
40
- def parent_id_node(model):
38
+ def parent_id_node(model: type) -> colander.SchemaNode:
39
+ """Get the scheme to the parent node ID."""
41
40
  return colander.SchemaNode(
42
41
  colander.Integer(),
43
42
  name="parent_id",
@@ -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,58 @@
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-l_cog:before {
49
+ content: '\e011';
50
+ }
51
+ .icon-mvt:before {
52
+ content: '\e011';
53
+ }
54
+ .icon-user:before {
55
+ content: '\e008';
25
56
  }
26
57
 
27
58
  .ms-res-ctn .ms-res-item {
@@ -29,11 +60,15 @@
29
60
  }
30
61
 
31
62
  .item-theme,
32
- .item-layergroup_treeitem {
63
+ .item-layergroup_treeitem,
64
+ .item-layer,
65
+ .item-user {
33
66
  margin-bottom: 0;
34
67
  }
35
68
  .item-theme .well,
36
- .item-layergroup_treeitem .well {
69
+ .item-layergroup_treeitem .well,
70
+ .item-layer .well,
71
+ .item-user .well {
37
72
  padding: 10px;
38
73
  margin-bottom: 5px;
39
74
  }
@@ -42,5 +77,10 @@
42
77
  }
43
78
 
44
79
  #layertree .alert-info {
45
- margin-top : 30px;
80
+ margin-top: 30px;
81
+ }
82
+
83
+ .item-functionalities .checkbox label {
84
+ overflow: hidden;
85
+ overflow-wrap: break-word;
46
86
  }
@@ -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,8 +1,47 @@
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 %}
4
- <div class="content">
5
- <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Alchemy scaffold</span></h1>
27
+ <div class="container-fluid">
28
+ {% if "table" in request.matchdict %}
29
+ {% for table in request.c2cgeoform_application.tables() %}
30
+ {% if table["key"] == request.matchdict["table"] %}
31
+ <h2>
32
+ {{ table["title"] }}
33
+ </h2>
34
+ {% endif %}
35
+ {% endfor %}
36
+ {% endif %}
37
+ {% if context.detail %}
38
+ <p>{{ context.detail }}</p>
39
+ {% else %}
40
+ {% if "id" in request.matchdict and "table" in request.matchdict %}
41
+ <p>{{ _("Element id '{}' not found, probably deleted.").format(request.matchdict["id"]) }}</p>
42
+ {% else %}
6
43
  <p class="lead"><span class="font-semi-bold">404</span> Page Not Found</p>
44
+ {% endif %}
45
+ {% endif %}
7
46
  </div>
8
47
  {% endblock 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 %}