Skip to content

Commit

Permalink
Exlude layer from TOC (#841)
Browse files Browse the repository at this point in the history
* Restyling not show capabilities in layer list page.

* Exclude from toc workflow

* Exclude from toc workflow

* Add toc property to layertree

* Fix tests

* Fix tests

* ✨ Client
  g3w-suite/g3w-client@4b531f4

* exclude_from_toc nullable for retro compatibility

* fro retro compatibility

* ✨ Client
  g3w-suite/g3w-client@ff575d8

* i18n

* Update g3wadmin.min.css

* Update i18n

---------

Co-authored-by: wlorenzetti <[email protected]>
Co-authored-by: volterra79 <[email protected]>
Co-authored-by: Raruto <[email protected]>
  • Loading branch information
4 people authored May 9, 2024
1 parent a00a076 commit 8aea8ea
Show file tree
Hide file tree
Showing 15 changed files with 303 additions and 202 deletions.
2 changes: 1 addition & 1 deletion g3w-admin/client/static/client/js/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion g3w-admin/client/static/client/js/app.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions g3w-admin/client/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ def testClientConfigApiView(self):
resp = json.loads(response.content)

self.assertEqual(resp["layerstree"], [
{'visible': True, 'expanded': False, 'name': 'spatialite_points',
{'toc': True, 'visible': True, 'expanded': False, 'name': 'spatialite_points',
'id': 'spatialite_points20190604101052075'},
{'visible': True, 'expanded': False, 'name': 'world', 'id': 'world20181008111156525'},
{'visible': True, 'expanded': True, 'name': 'bluemarble', 'id': 'bluemarble20181008111156906'}])
{'toc': True, 'visible': True, 'expanded': False, 'name': 'world', 'id': 'world20181008111156525'},
{'toc': True, 'visible': True, 'expanded': True, 'name': 'bluemarble', 'id': 'bluemarble20181008111156906'}])
self.assertEqual(resp["search"], [])
self.assertFalse(resp["wms_use_layer_ids"])
self.assertEqual(resp["qgis_version"], "2.18.16")
Expand Down
12 changes: 10 additions & 2 deletions g3w-admin/core/static/css/g3wadmin.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ h5 small {
font-size: 150%;
}

div.vector-download li {
div.vector-download li,
div.not-show li {
list-style: none;
box-sizing: border-box;
display: list-item;
Expand All @@ -199,9 +200,16 @@ div.vector-download li {
padding-top: 6px;
}

div.vector-download > ul.menu {
div.vector-download > ul.menu,
div.not-show > ul.menu{
padding: 0;
}
/*
div.not-show > ul.menu {
width: 100px;
}
*/


.group-abstract-action, .project-abstract-action {
margin-left:-10px;
Expand Down
2 changes: 1 addition & 1 deletion g3w-admin/core/static/dist/css/g3wadmin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions g3w-admin/qdjango/api/projects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,9 @@ def readLeaf(layer, container):
layer_serialized_data['multilayer'] = meta_layer.getCurrentByLayer(
layer_serialized_data)

# Check if layer is exclude from toc
layer['toc'] = not layer_serialized_data['exclude_from_toc']

# check for vectorjoins and add to project relations
if layer_serialized_data['vectorjoins']:
ret['relations'] += self.get_map_layers_relations_from_vectorjoins(
Expand Down Expand Up @@ -681,6 +684,7 @@ class Meta:
'servertype',
'vectorjoins',
'exclude_from_legend',
'exclude_from_toc',
'not_show_attributes_table',
'download',
'download_xls',
Expand Down
Binary file added g3w-admin/qdjango/locale/de/LC_MESSAGES/djangojs.mo
Binary file not shown.
Binary file modified g3w-admin/qdjango/locale/it/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 8aea8ea

Please sign in to comment.