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
@@ -0,0 +1,90 @@
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
+
24
+ {% extends "layout.jinja2" %}
25
+
26
+ {% block content %}
27
+ <div class="container-fluid">
28
+
29
+ <div class="panel panel-default form-panel">
30
+ <div class="panel-heading">
31
+ Synchronization of OGC Server "{{ogcserver.name}}"
32
+ </div>
33
+
34
+ <div class="panel-body">
35
+ <h3>Check layers validity</h3>
36
+ <p>Download the WMS Capabilities and for each <code>LayerWMS</code> item in this OGC server:</p>
37
+ <ul>
38
+ <li>verify that all the layers specified in <code>layer</code> field exists on the remote server;</li>
39
+ <li>if <code>style</code> field is not empty, it will also verify that the corresponding <code>&lt;Style&gt;</code> element is available;</li>
40
+ <li>and finally populate <code>valid</code> and <code>invalid_reason</code> fields with the results.</li>
41
+ </ul>
42
+ <p>Note that <code>valid</code> and <code>invalid_reason</code> fields have no effect on the front office,
43
+ they are only populated for your information in this back office.</p>
44
+ <form method="POST" class="deform" id="form-check">
45
+ <button type="submit" name="check" class="btn btn-default">{{_("Check layers validity")}}</button>
46
+ </form>
47
+ <hr/>
48
+ <h3>Dry run synchronize</h3>
49
+ <p>Run the synchronization and display the report but do not commit changes to the database.<p>
50
+ <form method="POST" class="deform" id="form-dry-run">
51
+ <button type="submit" name="dry-run" class="btn btn-default">{{_("Dry run synchronize")}}</button>
52
+ </form>
53
+ <hr/>
54
+ <h3>Synchronize</h3>
55
+ <p>Download the WMS Capabilities and for each &lt;Layer>&gt; element:</p>
56
+ <ul>
57
+ <li>if the <code>&lt;Layer&gt;</code> element does not contains any other <code>&lt;Layer&gt;</code> element, it will create a <code>LayerWMS</code> object;</li>
58
+ <li>else if the Layer element is at top level, it will create a <code>Theme</code> object;</li>
59
+ <li>else it will create a <code>Group</code> object.</li>
60
+ </ul>
61
+ <form method="POST" class="deform" id="form-synchronize">
62
+ <div class="form-group">
63
+ <input type="checkbox" name="force-parents" id="force-parents-field">
64
+ <label for="force-parents-field" class="control-label">{{_("Force parents re-initialization.")}}</label>
65
+ </div>
66
+ <div class="form-group">
67
+ <input type="checkbox" name="force-ordering" id="force-ordering-field">
68
+ <label for="force-ordering-field" class="control-label">{{_("Force children sorting, current server at top and other servers at bottom.")}}</label>
69
+ </div>
70
+ <div class="form-group">
71
+ <input type="checkbox" name="clean" id="clean">
72
+ <label for="clean" class="control-label">{{_("Remove unexisting layers and empty groups.")}}</label>
73
+ </div>
74
+ <button type="submit" name="synchronize" class="btn btn-primary">{{_("Synchronize")}}</button>
75
+ </form>
76
+ </div>
77
+ </div>
78
+
79
+ {% if success %}
80
+ <div class="alert alert-success">
81
+ <div class="msg-lbl">OGC Server has been successfully synchronized.</div>
82
+ </div>
83
+ {% endif %}
84
+
85
+ {% if report %}
86
+ <pre>{{ report }}</pre>
87
+ {% endif %}
88
+
89
+ </div>
90
+ {% endblock content %}
@@ -1,11 +1,43 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <tal:def tal:define="title title|field.title;
2
25
  description description|field.description;
3
26
  errormsg errormsg|field.errormsg;
4
- item_template item_template|field.widget.item_template"
27
+ item_template item_template|field.widget.item_template;
28
+ label_field label_field|field.widget.label_field;
29
+ icon_class icons_class|field.widget.icon_class(child);
30
+ edit_url edit_url|field.widget.edit_url(field.schema.bindings['request'], child)"
5
31
  i18n:domain="deform">
6
32
 
7
- <div class="deform-order-button ">
8
- <div class="well"><span class="glyphicon icon-${treeitem.item_type}"></span> ${treeitem.name}</div>
33
+ <div class="orderable-item">
34
+ <div class="well">
35
+ <span tal:condition="icon_class" class="glyphicon ${icon_class}"></span>
36
+ ${getattr(child, label_field)}
37
+ <a tal:condition="edit_url" href="${edit_url}">
38
+ <span class="glyphicon glyphicon-pencil"></span>
39
+ </a>
40
+ </div>
9
41
 
10
42
  ${field.start_mapping()}
11
43
  <div tal:repeat="child field.children"
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <?python import json ?>
2
25
  <div tal:define="item_tmpl item_template|field.widget.item_template;
3
26
  oid oid|field.oid;
@@ -9,6 +32,7 @@
9
32
  now_len len(subfields);
10
33
  orderable orderable|field.widget.orderable;
11
34
  orderable orderable and 1 or 0;
35
+ child_input_name child_input_name|field.widget.child_input_name;
12
36
  prototype field.widget.prototype(field);
13
37
  title title|field.title;"
14
38
  class="deform-seq item-${field.schema.name}"
@@ -30,17 +54,19 @@
30
54
  <input type="hidden" name="__start__"
31
55
  value="${field.name}:sequence"
32
56
  class="deform-proto"
33
- tal:attributes="prototype prototype"/>
57
+ tal:attributes="prototype prototype;
58
+ attributes|field.widget.attributes|{};"/>
34
59
 
35
60
  <div class="panel panel-default">
36
61
  <div class="panel-heading">${title}</div>
37
-
38
62
  <div class="panel-body">
63
+
39
64
  <div class="deform-seq-container"
40
65
  id="${oid}-orderable">
41
66
  <div tal:define="subfields [ x[1] for x in subfields ]"
42
67
  tal:repeat="subfield subfields"
43
- tal:replace="structure subfield.render_template(item_tmpl, parent=field)" />
68
+ tal:replace="structure subfield.render_template(item_tmpl,
69
+ parent=field)" />
44
70
  <span class="deform-insert-before"
45
71
  tal:attributes="
46
72
  min_len min_len;
@@ -48,97 +74,100 @@
48
74
  now_len now_len;
49
75
  orderable orderable;"></span>
50
76
  </div>
51
- </div>
52
77
 
53
- <div class="panel-footer" tal:condition="field.widget.add_subitem">
54
- <div class="magicsuggest"></div>
55
78
  </div>
56
- </div>
57
79
 
58
- <input type="hidden" name="__end__" value="${field.name}:sequence"/>
59
- <!-- /sequence -->
60
-
61
- <script type="text/javascript">
62
- deform.addCallback(
63
- '${field.oid}',
64
- function(oid) {
65
- oid_node = $('#'+ oid);
66
- deform.processSequenceButtons(oid_node, ${min_len},
67
- ${max_len}, ${now_len},
68
- ${orderable});
69
- oid_node.find('.deform-order-button').show();
70
-
71
- var ms = $('#'+ oid + ' .magicsuggest').magicSuggest({
72
- data: ${ structure: json.dumps(treeitems, indent=4, separators=(',', ': ')) },
73
- renderer: function(data) {
74
- return '<span class="glyphicon icon-' + data.item_type + '"></span> ' + data.name;
75
- },
76
- valueField: 'id',
77
- displayField: 'name',
78
- groupBy: 'group',
79
- allowFreeEntries: false,
80
- maxDropHeight: 500
81
- });
82
-
83
- $(ms).on('selectionchange', function(e, m) {
84
- this.getSelection().forEach(function(selecteditem) {
85
-
86
- // Search for the corresponding item in sequence
87
- var $el = $('#'+ oid).find('.deform-seq-item input[name="treeitem_id"][value="' + selecteditem.id + '"]');
88
-
89
- // If item is already sequence, flash it to the user
90
- if ($el.length > 0) {
91
- for (var i=0; i<3; i++) {
92
- $el.closest('.deform-seq-item').
93
- fadeOut(100).
94
- fadeIn(100)
95
- }
96
- }
97
- else {
98
- // Add item in sequence
99
- deform.appendSequenceItem('#'+ oid);
100
-
101
- // Set title and treeitem_id
102
- var $itemnode = $('#'+ oid).find('.deform-insert-before').last().prev();
103
- $itemnode.find('.well').html('<span class="glyphicon icon-' + selecteditem.item_type + '"></span> ' + selecteditem.name);
104
- $itemnode.find('input[name="treeitem_id"]').val(selecteditem.id);
105
- $itemnode.find('.deform-order-button').show();
106
- }
107
- });
108
- this.removeFromSelection(this.getSelection(), true);
109
- });
110
- }
111
- )
112
- <tal:block condition="orderable">
113
- $( "#${oid}-orderable" ).sortable({
114
- handle: ".deform-order-button, .panel-heading",
115
- containerSelector: "#${oid}-orderable",
116
- itemSelector: ".deform-seq-item",
117
- placeholder: '<span class="glyphicon glyphicon-arrow-right placeholder"></span>',
118
- onDragStart: function ($item, container, _super) {
119
- var offset = $item.offset(),
120
- pointer = container.rootGroup.pointer
121
-
122
- adjustment = {
123
- left: pointer.left - offset.left,
124
- top: pointer.top - offset.top
125
- }
126
-
127
- _super($item, container)
128
- },
129
- onDrag: function ($item, position) {
130
- $item.css({
131
- left: position.left - adjustment.left,
132
- top: position.top - adjustment.top
133
- })
134
- }});
135
-
136
- // Deform hide sequence .deform-order-button when has_multiple change to false,
137
- // but icon and title are inside .deform-order-button in our case.
138
- $('#deform').on('change', function(e) {
139
- $('#${oid} .deform-order-button').show();
140
- });
141
- </tal:block>
142
- </script>
80
+ <div class="panel-footer">
81
+ <div
82
+ class="magicsuggest"
83
+ tal:condition="field.widget.add_subitem"
84
+ ></div>
85
+
86
+ <script type="text/javascript">
87
+ deform.addCallback(
88
+ '${field.oid}',
89
+ function(oid) {
90
+ oid_node = $('#'+ oid);
91
+ deform.processSequenceButtons(oid_node, ${min_len},
92
+ ${max_len}, ${now_len},
93
+ ${orderable});
94
+
95
+ var ms = $('#'+ oid + ' .magicsuggest').magicSuggest({
96
+ data: ${ structure: json.dumps(candidates, indent=4, separators=(',', ': ')) },
97
+ renderer: function(data) {
98
+ return '<span class="glyphicon ' + data.icon_class + '"></span> ' + data.label;
99
+ },
100
+ valueField: 'id',
101
+ displayField: 'label',
102
+ groupBy: 'group',
103
+ allowFreeEntries: false,
104
+ maxDropHeight: 500
105
+ });
106
+
107
+ $(ms).on('selectionchange', function(e, m) {
108
+ this.getSelection().forEach(function(selecteditem) {
109
+
110
+ // Search for the corresponding item in sequence
111
+ var $el = $('#'+ oid).find('.deform-seq-item input[name="${child_input_name}"][value="' + selecteditem.id + '"]');
112
+
113
+ // If item is already sequence, flash it to the user
114
+ if ($el.length > 0) {
115
+ for (var i=0; i<3; i++) {
116
+ $el.closest('.deform-seq-item').
117
+ fadeOut(100).
118
+ fadeIn(100)
119
+ }
120
+ }
121
+ else {
122
+ // Add item in sequence
123
+ deform.appendSequenceItem('#'+ oid);
124
+
125
+ // Set title and treeitem_id
126
+ var $itemnode = $('#'+ oid).find('.deform-insert-before').last().prev();
127
+ $itemnode.find('.well').html(
128
+ '<span class="glyphicon ' + selecteditem.icon_class + '"></span> ' +
129
+ selecteditem.label +
130
+ ' <a href="' + selecteditem.edit_url + '">' +
131
+ '<span class="glyphicon glyphicon-pencil"></span>' +
132
+ '</a>'
133
+ );
134
+ $itemnode.find('input[name="${child_input_name}"]').val(selecteditem.id);
135
+ }
136
+ });
137
+ this.removeFromSelection(this.getSelection(), true);
138
+ });
139
+ }
140
+ )
141
+ <tal:block condition="orderable">
142
+ $( "#${oid}-orderable" ).sortable({
143
+ handle: ".deform-order-button, .panel-heading, .orderable-item",
144
+ containerSelector: "#${oid}-orderable",
145
+ itemSelector: ".deform-seq-item",
146
+ placeholder: '<span class="glyphicon glyphicon-arrow-right placeholder"></span>',
147
+ onDragStart: function ($item, container, _super) {
148
+ var offset = $item.offset(),
149
+ pointer = container.rootGroup.pointer
150
+
151
+ adjustment = {
152
+ left: pointer.left - offset.left,
153
+ top: pointer.top - offset.top
154
+ }
155
+
156
+ _super($item, container)
157
+ },
158
+ onDrag: function ($item, position) {
159
+ $item.css({
160
+ left: position.left - adjustment.left,
161
+ top: position.top - adjustment.top
162
+ })
163
+ }
164
+ });
165
+ </tal:block>
166
+ </script>
167
+
168
+ <input type="hidden" name="__end__" value="${field.name}:sequence"/>
169
+ <!-- /sequence -->
170
+ </div>
143
171
 
172
+ </div>
144
173
  </div>
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <tal:def tal:define="title title|field.title;
2
25
  name name|field.name;
3
26
  type type|field.type;
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <div class="item-dimensions">
2
25
  <tal metal:use-macro='load:sequence.pt'></tal>
3
26
  </div>
@@ -0,0 +1,51 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
24
+ <?python import json ?>
25
+
26
+ <tal metal:use-macro='load:mapping_fields.pt'></tal>
27
+
28
+ <script type="text/javascript">
29
+ deform.addCallback(
30
+ '${field['name'].oid}',
31
+ function(oid) {
32
+ const $name = $('#' + oid);
33
+
34
+ const functionalities = ${structure: json.dumps(field.schema.functionalities, indent=4, separators=(',', ': '))};
35
+
36
+ const $form = $name.closest('form');
37
+ const $valueItem = $form.find('.item-value');
38
+ const $helpBlock = $valueItem.find('p.help-block');
39
+
40
+ const updateDescription = function() {
41
+ const functionality = functionalities[$name.val()] || {};
42
+ const description = functionality.description || '';
43
+ $helpBlock.text(description);
44
+ }
45
+ $name.change(function() {
46
+ updateDescription();
47
+ });
48
+ updateDescription();
49
+ }
50
+ );
51
+ </script>
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <div class="row">
2
25
 
3
26
  <div class="col-md-4 col-sm-6">
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <div class="row">
2
25
 
3
26
  <div class="col-md-6 col-sm-6">
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <div class="row">
2
25
 
3
26
  <div class="col-md-4 col-sm-6">
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <tal:def tal:define="title title|field.title;
2
25
  name name|field.name;
3
26
  type type|field.type;
@@ -52,13 +75,19 @@
52
75
  $metadataItem.find('.col-value .form-group').hide();
53
76
  $metadataItem.find('.col-value .form-group .form-control').attr('disabled', true);
54
77
 
55
- var type = (c2cgeoportalAdmin.metadata_definitions[$name.val()] || {}).type || 'string';
78
+ var metadataDef = c2cgeoportalAdmin.metadata_definitions[$name.val()] || {};
79
+ var type = metadataDef.type || 'string';
80
+ var description = metadataDef.description || '';
81
+
56
82
  $typedFormgroup = $metadataItem.find('.item-' + type);
57
83
  if ($typedFormgroup.length == 0) {
58
84
  $typedFormgroup = $metadataItem.find('.item-string');
59
85
  }
60
86
  $typedFormgroup.show();
61
87
  $typedFormgroup.find('.form-control').attr('disabled', false);
88
+
89
+ $helpBlock = $typedFormgroup.find('p.help-block');
90
+ $helpBlock.text(description);
62
91
  };
63
92
  $name.change(function() {
64
93
  updateType();
@@ -1,3 +1,26 @@
1
+ <tal:comment replace="nothing">
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
+ </tal:comment>
23
+
1
24
  <?python import json ?>
2
25
 
3
26
  <script type="text/javascript">