From 3b89c22c23c76f93a13efb5f3db9745519a318f3 Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Tue, 28 Nov 2023 22:05:44 +0100 Subject: [PATCH 1/5] add title and icon to buttons * search and share icons on the left get an `title` attribute * all panels start with an `h3` headline including the corresponding icon * thus add smaller versions of the 24px-icons to 16.svg or 16-white.svg * unify strings for button and headline to match --- umap/static/umap/img/16-white.svg | 2 + umap/static/umap/img/16.svg | 8 + umap/static/umap/img/source/16-white.svg | 978 +++++++++++++++--- umap/static/umap/img/source/16.svg | 845 ++++++++++++--- umap/static/umap/js/umap.controls.js | 11 +- umap/static/umap/js/umap.core.js | 1 + .../umap/js/umap.datalayer.permissions.js | 4 +- umap/static/umap/js/umap.importer.js | 2 +- umap/static/umap/js/umap.permissions.js | 4 +- umap/static/umap/map.css | 20 +- 10 files changed, 1603 insertions(+), 272 deletions(-) diff --git a/umap/static/umap/img/16-white.svg b/umap/static/umap/img/16-white.svg index 96e30d4f..8dfa888c 100644 --- a/umap/static/umap/img/16-white.svg +++ b/umap/static/umap/img/16-white.svg @@ -164,5 +164,7 @@ + + diff --git a/umap/static/umap/img/16.svg b/umap/static/umap/img/16.svg index 0c9fccc1..9aaa84c1 100644 --- a/umap/static/umap/img/16.svg +++ b/umap/static/umap/img/16.svg @@ -39,6 +39,14 @@ + + + + + + + + diff --git a/umap/static/umap/img/source/16-white.svg b/umap/static/umap/img/source/16-white.svg index 1ee9b790..0716d4c2 100644 --- a/umap/static/umap/img/source/16-white.svg +++ b/umap/static/umap/img/source/16-white.svg @@ -1,189 +1,879 @@ - - - - + + + + - - + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - + image/svg+xml - + - -   - - - - + +   + + + + - - - - - - - - - - -   - - + + + + + + + + + + +   + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - - + + - - - - + + + + - - + + - - - - + + + + - - + + - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - + + + - - + + + + diff --git a/umap/static/umap/img/source/16.svg b/umap/static/umap/img/source/16.svg index 5009bbcc..95a76cf8 100644 --- a/umap/static/umap/img/source/16.svg +++ b/umap/static/umap/img/source/16.svg @@ -1,160 +1,767 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + image/svg+xml - + - -   - - - - + +   + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - -   - - + + +   + + - - - - - - - + + + + + + + + - - - + + + + + + - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - - - + + + - - - - + + + + - - - + + + - - - - - - + + + + + + - - - + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - - - - + + + + + - - - - - - + + + + + + - - - + + + - + diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index ad6cff9f..49e3590a 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -27,7 +27,7 @@ L.U.EditPropertiesAction = L.U.BaseAction.extend({ options: { helpMenu: true, className: 'update-map-settings dark', - tooltip: L._('Edit map settings'), + tooltip: L._('Edit map properties'), }, addHooks: function () { @@ -403,7 +403,7 @@ L.Control.Embed = L.Control.extend({ const shareButton = L.DomUtil.createButton( '', container, - L._('Embed and share this map'), + L._('Share, download and embed this map'), map.renderShareBox, map ) @@ -1076,6 +1076,9 @@ L.U.Map.include({ renderShareBox: function () { const container = L.DomUtil.create('div', 'umap-share') + const title = L.DomUtil.create('h3', '', container) + title.textContent = L._('Share, download and embed this map') + const embedTitle = L.DomUtil.add('h4', '', container, L._('Embed the map')) const iframe = L.DomUtil.create('textarea', 'umap-share-iframe', container) const urlTitle = L.DomUtil.add('h4', '', container, L._('Direct link')) @@ -1369,7 +1372,7 @@ L.U.SearchControl = L.Control.extend({ L.DomUtil.createButton( '', container, - L._('Search a place name'), + L._('Search location'), (e) => { L.DomEvent.stop(e) this.openPanel(map) @@ -1385,7 +1388,7 @@ L.U.SearchControl = L.Control.extend({ noResultLabel: L._('No results'), } if (map.options.photonUrl) options.url = map.options.photonUrl - const container = L.DomUtil.create('div', '') + const container = L.DomUtil.create('div', 'umap-search') const title = L.DomUtil.create('h3', '', container) title.textContent = L._('Search location') diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index 7b0fbb10..6631f6ad 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -325,6 +325,7 @@ L.DomUtil.createFieldset = (container, legend, options) => { L.DomUtil.createButton = (className, container, content, callback, context) => { const el = L.DomUtil.add('button', className, container, content) el.type = 'button' + el.title = content if (callback) { L.DomEvent.on(el, 'click', L.DomEvent.stop).on(el, 'click', callback, context) } diff --git a/umap/static/umap/js/umap.datalayer.permissions.js b/umap/static/umap/js/umap.datalayer.permissions.js index 9e3e6211..f77e086f 100644 --- a/umap/static/umap/js/umap.datalayer.permissions.js +++ b/umap/static/umap/js/umap.datalayer.permissions.js @@ -38,7 +38,9 @@ L.U.DataLayerPermissions = L.Class.extend({ }, ], ], - builder = new L.U.FormBuilder(this, fields, {className: 'umap-form datalayer-permissions'}), + builder = new L.U.FormBuilder(this, fields, { + className: 'umap-form datalayer-permissions', + }), form = builder.build() container.appendChild(form) }, diff --git a/umap/static/umap/js/umap.importer.js b/umap/static/umap/js/umap.importer.js index 9cd96c76..83b37699 100644 --- a/umap/static/umap/js/umap.importer.js +++ b/umap/static/umap/js/umap.importer.js @@ -7,7 +7,7 @@ L.U.Importer = L.Class.extend({ build: function () { this.container = L.DomUtil.create('div', 'umap-upload') - this.title = L.DomUtil.add('h4', '', this.container, L._('Import data')) + this.title = L.DomUtil.add('h3', '', this.container, L._('Import data')) this.presetBox = L.DomUtil.create('div', 'formbox', this.container) this.presetSelect = L.DomUtil.create('select', '', this.presetBox) this.fileBox = L.DomUtil.create('div', 'formbox', this.container) diff --git a/umap/static/umap/js/umap.permissions.js b/umap/static/umap/js/umap.permissions.js index 1687e142..8945e18e 100644 --- a/umap/static/umap/js/umap.permissions.js +++ b/umap/static/umap/js/umap.permissions.js @@ -59,7 +59,7 @@ L.U.MapPermissions = L.Class.extend({ }) const container = L.DomUtil.create('div', 'permissions-panel'), fields = [], - title = L.DomUtil.create('h4', '', container) + title = L.DomUtil.create('h3', '', container) if (this.isAnonymousMap()) { if (this.options.anonymous_edit_url) { const helpText = `${L._('Secret edit link:')}
${ @@ -124,7 +124,7 @@ L.U.MapPermissions = L.Class.extend({ this ) } - L.DomUtil.add('h3', '', container, L._('Datalayers')) + L.DomUtil.add('h4', '', container, L._('Datalayers')) this.map.eachDataLayer((datalayer) => { datalayer.permissions.edit(container) }) diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 87f8b8e0..33cd2224 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -250,9 +250,13 @@ ul.photon-autocomplete { .manage-datalayers { background-position: -36px -72px; } +.permissions-panel h3:before, .umap-edit-container h3:before, .umap-feature-properties:before, -.umap-layer-properties-container h3:before { +.umap-layer-properties-container h3:before, +.umap-search h3:before, +.umap-share h3:before, +.umap-upload h3:before { height: 24px; width: 24px; background-repeat: no-repeat; @@ -266,6 +270,20 @@ ul.photon-autocomplete { .umap-edit-container h3:before { background-position: -27px -93px; } +.permissions-panel h3:before { + background-position: -144px -117px; +} +.umap-upload h3:before { + background-position: -144px -93px; +} +.umap-search h3:before { + background-image: url('./img/16.svg'); + background-position: -27px -117px; +} +.umap-share h3:before { + background-image: url('./img/16.svg'); + background-position: 0 -117px; +} .umap-feature-properties.marker:before { background-position: -72px -117px; } From 69939ec2a38dddec50d9b822c69ca6fa046f470b Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Fri, 8 Dec 2023 20:58:49 +0100 Subject: [PATCH 2/5] add title and heading to layer and tilelayer --- umap/static/umap/base.css | 3 +- umap/static/umap/img/16-white.svg | 22 ++- umap/static/umap/img/source/16-white.svg | 173 ++++++++++++++++++----- umap/static/umap/js/umap.controls.js | 19 +-- umap/static/umap/map.css | 8 +- 5 files changed, 175 insertions(+), 50 deletions(-) diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index dc504a30..5a05467e 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -529,7 +529,8 @@ i.info { .umap-layer-properties-container, .umap-browse-data, .umap-facet-search, -.umap-browse-datalayers { +.umap-browse-datalayers, +.umap-tilelayer-switcher-container { padding: 0 10px; } .umap-field-datalist { diff --git a/umap/static/umap/img/16-white.svg b/umap/static/umap/img/16-white.svg index 8dfa888c..7a42f5bf 100644 --- a/umap/static/umap/img/16-white.svg +++ b/umap/static/umap/img/16-white.svg @@ -1,4 +1,4 @@ - + @@ -9,6 +9,9 @@ + + + @@ -166,5 +169,22 @@ + + + + + + + + + + + + + + + + +
diff --git a/umap/static/umap/img/source/16-white.svg b/umap/static/umap/img/source/16-white.svg index 0716d4c2..81bf9d91 100644 --- a/umap/static/umap/img/source/16-white.svg +++ b/umap/static/umap/img/source/16-white.svg @@ -3,7 +3,7 @@ + + + + @@ -205,7 +224,7 @@ inkscape:connector-curvature="0" id="path3789" style="font-weight:bold;font-size:12px;-inkscape-font-specification:'Sans Bold';fill:#f2f2f2;fill-opacity:1;stroke:#999999;stroke-width:0.25;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 9,1046.0464 h -2.3698034 v -0.3223 c 0,-0.3596 0.072207,-0.6775 0.2166302,-0.9539 0.1444174,-0.2807 0.4485749,-0.636 0.9124728,-1.0658 l 0.4201314,-0.3816 c 0.249449,-0.228 0.4310681,-0.4429 0.5448577,-0.6446 0.1181576,-0.2019 0.1772384,-0.4036 0.177243,-0.6053 -4.6e-6,-0.3071 -0.1050376,-0.5462 -0.3150985,-0.7171 -0.2100697,-0.1756 -0.5032861,-0.2632 -0.87965,-0.2632 -0.3544889,0 -0.7374207,0.075 -1.1487968,0.2237 -0.4113804,0.1446 -0.840264,0.3618 -1.2866522,0.6513 v -2.0659 c 0.5295391,-0.184 1.0131273,-0.32 1.4507661,-0.4077 0.437634,-0.088 0.8599531,-0.1317 1.2669587,-0.1317 1.0678292,0 1.8818328,0.2194 2.442012,0.6579 0.560169,0.4341 0.840256,1.0702 0.840263,1.9078 -7e-6,0.4298 -0.08535,0.8159 -0.256017,1.158 -0.170685,0.3377 -0.461713,0.7017 -0.873085,1.092 l -0.4201313,0.375 c -0.297598,0.272 -0.4923463,0.4913 -0.5842451,0.658 -0.091909,0.1622 -0.1378603,0.342 -0.1378556,0.5394 v 0.296 m -2.3698034,0.9739 h 2.3698034 v 2.342 h -2.3698034 v -2.342" + d="M 9,1046.0464 H 6.6301966 v -0.3223 c 0,-0.3596 0.072207,-0.6775 0.2166302,-0.9539 0.1444174,-0.2807 0.4485749,-0.636 0.9124728,-1.0658 l 0.4201314,-0.3816 c 0.249449,-0.228 0.4310681,-0.4429 0.5448577,-0.6446 0.1181576,-0.2019 0.1772384,-0.4036 0.177243,-0.6053 -4.6e-6,-0.3071 -0.1050376,-0.5462 -0.3150985,-0.7171 -0.2100697,-0.1756 -0.5032861,-0.2632 -0.87965,-0.2632 -0.3544889,0 -0.7374207,0.075 -1.1487968,0.2237 -0.4113804,0.1446 -0.840264,0.3618 -1.2866522,0.6513 v -2.0659 c 0.5295391,-0.184 1.0131273,-0.32 1.4507661,-0.4077 0.437634,-0.088 0.8599531,-0.1317 1.2669587,-0.1317 1.0678292,0 1.8818328,0.2194 2.442012,0.6579 0.560169,0.4341 0.840256,1.0702 0.840263,1.9078 -7e-6,0.4298 -0.08535,0.8159 -0.256017,1.158 -0.170685,0.3377 -0.461713,0.7017 -0.873085,1.092 l -0.4201313,0.375 c -0.297598,0.272 -0.4923463,0.4913 -0.5842451,0.658 -0.091909,0.1622 -0.1378603,0.342 -0.1378556,0.5394 v 0.296 m -2.3698034,0.9739 H 9 v 2.342 H 6.6301966 v -2.342" sodipodi:nodetypes="ccsccccccsccccsccccccccccccc" /> @@ -237,7 +256,7 @@ inkscape:connector-curvature="0" /> @@ -305,11 +324,11 @@ inkscape:connector-curvature="0" id="path4384-2" style="font-variant:normal;font-stretch:normal;font-size:20px;font-family:Arial;-inkscape-font-specification:Arial;fill:#f2f2f2;fill-opacity:1" - d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 -3.066406,-3.06638 -3.076172,3.07618 -1.181641,-1.18165" /> + d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 L 40,997.54382 36.923828,1000.62 35.742187,999.43835" /> @@ -427,7 +446,7 @@ + d="m 7,937.36218 v 2 H 8.8828125 L 15,942.42077 v 0.23438 l -6.7070312,6.70703 H 7 v 2 h 2 v -1.29297 l 6.707031,-6.70703 H 17 v -2 H 15.117188 L 9,938.30359 v -0.94141 z" /> + d="m 29,936.36218 v 2 h 0.927734 l -0.855468,12 H 28 v 2 h 2 v -1.19922 l 8,-1.60156 v 0.80078 h 2 v -2 h -0.777344 l 1.554688,-7 H 42 v -2 h -2 v 0.72656 l -9,-2.45312 v -1.27344 z" /> @@ -766,13 +785,13 @@ transform="matrix(0.71300568,0,0,0.66260978,53.493751,938.13028)" style="fill:none;stroke:#f2f2f2;stroke-width:1.45488;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"> @@ -795,13 +814,13 @@ + d="m 32.353516,820.00866 -0.707032,0.70704 3.646485,3.64648 -3.646485,3.64648 0.707032,0.70704 L 36,825.06921 l 3.646484,3.64649 0.707032,-0.70704 -3.646485,-3.64648 3.646485,-3.64648 -0.707032,-0.70704 L 36,823.65515 Z" /> @@ -875,5 +894,87 @@ fill="#f2f2f2" stroke="#999999" stroke-width="0.164949" /> + + + + + + + + + + + + + + + + + diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 49e3590a..4cd095cc 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -615,6 +615,8 @@ L.U.DataLayersControl = L.Control.extend({ openPanel: function () { if (!this.map.editEnabled) return const container = L.DomUtil.create('ul', 'umap-browse-datalayers') + const title = L.DomUtil.create('h3', '', container) + title.textContent = L._('Manage layers') this.map.eachDataLayerReverse(function (datalayer) { this.addDataLayer(container, datalayer, true) }, this) @@ -1174,7 +1176,6 @@ L.U.Map.include({ ) this.ui.openPanel({ data: { html: container } }) }, - }) L.U.TileLayerControl = L.Control.extend({ @@ -1201,11 +1202,15 @@ L.U.TileLayerControl = L.Control.extend({ }, openSwitcher: function (options) { - this._tilelayers_container = L.DomUtil.create( - 'ul', - 'umap-tilelayer-switcher-container' - ) + const container = L.DomUtil.create('div', 'umap-tilelayer-switcher-container') + const title = L.DomUtil.create('h3', '', container) + title.textContent = L._('Change tilelayers') + this._tilelayers_container = L.DomUtil.create('ul', '', container) this.buildList(options) + this.map.ui.openPanel({ + data: { html: container }, + className: options.className, + }) }, buildList: function (options) { @@ -1217,10 +1222,6 @@ L.U.TileLayerControl = L.Control.extend({ return this.addTileLayerElement(tilelayer, options) }, this) - this.map.ui.openPanel({ - data: { html: this._tilelayers_container }, - className: options.className, - }) }, addTileLayerElement: function (tilelayer, options) { diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 33cd2224..4810bace 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -251,11 +251,13 @@ ul.photon-autocomplete { background-position: -36px -72px; } .permissions-panel h3:before, +.umap-browse-datalayers h3:before, .umap-edit-container h3:before, .umap-feature-properties:before, .umap-layer-properties-container h3:before, .umap-search h3:before, .umap-share h3:before, +.umap-tilelayer-switcher-container h3:before, .umap-upload h3:before { height: 24px; width: 24px; @@ -284,6 +286,9 @@ ul.photon-autocomplete { background-image: url('./img/16.svg'); background-position: 0 -117px; } +.umap-tilelayer-switcher-container h3:before { + background-position: -98px -141px; +} .umap-feature-properties.marker:before { background-position: -72px -117px; } @@ -1116,9 +1121,6 @@ a.add-datalayer:hover, /* Tilelayer switcher */ /* ********************************* */ -.umap-tilelayer-switcher-container { - margin-top: 10px; -} .umap-tilelayer-switcher-container li { border: 1px solid rgb(116, 116, 116); border-radius: 4px 4px 4px 4px; From 20bbbbad0ccd950965deec8741b4a819ab82b8dd Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Fri, 8 Dec 2023 21:47:11 +0100 Subject: [PATCH 3/5] fixup tests --- umap/tests/integration/test_anonymous_owned_map.py | 4 ++-- umap/tests/integration/test_owned_map.py | 10 +++++----- umap/tests/integration/test_picto.py | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/umap/tests/integration/test_anonymous_owned_map.py b/umap/tests/integration/test_anonymous_owned_map.py index 69869696..19090454 100644 --- a/umap/tests/integration/test_anonymous_owned_map.py +++ b/umap/tests/integration/test_anonymous_owned_map.py @@ -33,7 +33,7 @@ def test_map_load_with_owner(anonymap, live_server, owner_session): expect(save).to_be_visible() add_marker = owner_session.get_by_title("Draw a marker") expect(add_marker).to_be_visible() - edit_settings = owner_session.get_by_title("Edit map settings") + edit_settings = owner_session.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_permissions = owner_session.get_by_title("Update permissions and editors") expect(edit_permissions).to_be_visible() @@ -64,7 +64,7 @@ def test_map_load_with_anonymous_but_editable_layer( expect(save).to_be_visible() add_marker = page.get_by_title("Draw a marker") expect(add_marker).to_be_visible() - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_hidden() edit_permissions = page.get_by_title("Update permissions and editors") expect(edit_permissions).to_be_hidden() diff --git a/umap/tests/integration/test_owned_map.py b/umap/tests/integration/test_owned_map.py index 64b40af6..3f10204b 100644 --- a/umap/tests/integration/test_owned_map.py +++ b/umap/tests/integration/test_owned_map.py @@ -40,7 +40,7 @@ def test_map_update_with_owner(map, live_server, login): expect(save).to_be_visible() add_marker = page.get_by_title("Draw a marker") expect(add_marker).to_be_visible() - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_permissions = page.get_by_title("Update permissions and editors") expect(edit_permissions).to_be_visible() @@ -67,7 +67,7 @@ def test_map_update_with_anonymous_but_editable_datalayer( enable.click() add_marker = page.get_by_title("Draw a marker") expect(add_marker).to_be_visible() - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_hidden() edit_permissions = page.get_by_title("Update permissions and editors") expect(edit_permissions).to_be_hidden() @@ -115,7 +115,7 @@ def test_map_update_with_editor(map, live_server, login, user): expect(save).to_be_visible() add_marker = page.get_by_title("Draw a marker") expect(add_marker).to_be_visible() - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_permissions = page.get_by_title("Update permissions and editors") expect(edit_permissions).to_be_visible() @@ -144,7 +144,7 @@ def test_permissions_form_with_editor(map, datalayer, live_server, login, user): def test_owner_has_delete_map_button(map, live_server, login): page = login(map.owner) page.goto(f"{live_server.url}{map.get_absolute_url()}?edit") - settings = page.get_by_title("Edit map settings") + settings = page.get_by_title("Edit map properties") expect(settings).to_be_visible() settings.click() advanced = page.get_by_text("Advanced actions") @@ -160,7 +160,7 @@ def test_editor_do_not_have_delete_map_button(map, live_server, login, user): map.save() page = login(user) page.goto(f"{live_server.url}{map.get_absolute_url()}?edit") - settings = page.get_by_title("Edit map settings") + settings = page.get_by_title("Edit map properties") expect(settings).to_be_visible() settings.click() advanced = page.get_by_text("Advanced actions") diff --git a/umap/tests/integration/test_picto.py b/umap/tests/integration/test_picto.py index 61c92a65..01abc28d 100644 --- a/umap/tests/integration/test_picto.py +++ b/umap/tests/integration/test_picto.py @@ -46,7 +46,7 @@ def test_can_change_picto_at_map_level(map, live_server, page, pictos): expect(marker).to_have_count(1) # Should have default img expect(marker).to_have_attribute("src", "/static/umap/img/marker.png") - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_settings.click() shape_settings = page.get_by_text("Default shape properties") @@ -146,7 +146,7 @@ def test_can_use_remote_url_as_picto(map, live_server, page, pictos): expect(marker).to_have_count(1) # Should have default img expect(marker).to_have_attribute("src", "/static/umap/img/marker.png") - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_settings.click() shape_settings = page.get_by_text("Default shape properties") @@ -186,7 +186,7 @@ def test_can_use_char_as_picto(map, live_server, page, pictos): marker = page.locator(".umap-div-icon span") # Should have default img, so not a span expect(marker).to_have_count(0) - edit_settings = page.get_by_title("Edit map settings") + edit_settings = page.get_by_title("Edit map properties") expect(edit_settings).to_be_visible() edit_settings.click() shape_settings = page.get_by_text("Default shape properties") From 259a00270515abf4047b53fc18d0043eb6a9ff79 Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Sat, 9 Dec 2023 20:32:07 +0100 Subject: [PATCH 4/5] fix picto tests --- umap/tests/integration/test_picto.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/tests/integration/test_picto.py b/umap/tests/integration/test_picto.py index 01abc28d..049e379d 100644 --- a/umap/tests/integration/test_picto.py +++ b/umap/tests/integration/test_picto.py @@ -165,7 +165,7 @@ def test_can_use_remote_url_as_picto(map, live_server, page, pictos): input_el.blur() expect(marker).to_have_attribute("src", "https://foo.bar/img.jpg") # Now close and reopen the form, it should still be the URL tab - close = page.locator("#umap-ui-container").get_by_title("Close") + close = page.locator("#umap-ui-container .toolbox").get_by_title("Close") expect(close).to_be_visible() close.click() edit_settings.click() @@ -205,7 +205,7 @@ def test_can_use_char_as_picto(map, live_server, page, pictos): expect(marker).to_have_count(1) expect(marker).to_have_text("♩") # Now close and reopen the form, it should still be the URL tab - close = page.locator("#umap-ui-container").get_by_title("Close") + close = page.locator("#umap-ui-container .toolbox").get_by_title("Close") expect(close).to_be_visible() close.click() edit_settings.click() From e020a3656c353801f70dd1f6ad3e6904916c0d9b Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Mon, 11 Dec 2023 11:39:54 +0100 Subject: [PATCH 5/5] finetune * left align share icon * add light tilelayer icon in "view" mode --- umap/static/umap/img/16.svg | 24 ++++- umap/static/umap/img/source/16.svg | 143 +++++++++++++++++++++++------ umap/static/umap/map.css | 7 +- 3 files changed, 145 insertions(+), 29 deletions(-) diff --git a/umap/static/umap/img/16.svg b/umap/static/umap/img/16.svg index 9aaa84c1..a7f38acd 100644 --- a/umap/static/umap/img/16.svg +++ b/umap/static/umap/img/16.svg @@ -1,4 +1,9 @@ - + + + + + + @@ -146,5 +151,22 @@ + + + + + + + + + + + + + + + + + diff --git a/umap/static/umap/img/source/16.svg b/umap/static/umap/img/source/16.svg index 95a76cf8..f63086c6 100644 --- a/umap/static/umap/img/source/16.svg +++ b/umap/static/umap/img/source/16.svg @@ -3,7 +3,7 @@ + id="defs4"> + + + + + @@ -171,7 +191,7 @@ inkscape:connector-curvature="0" id="path3789" style="font-weight:bold;font-size:12px;-inkscape-font-specification:'Sans Bold';fill:#4d4d4d" - d="m 9,1046.0464 h -2.3698034 v -0.3223 c 0,-0.3596 0.072207,-0.6775 0.2166302,-0.9539 0.1444174,-0.2807 0.4485749,-0.636 0.9124728,-1.0658 l 0.4201314,-0.3816 c 0.249449,-0.228 0.4310681,-0.4429 0.5448577,-0.6446 0.1181576,-0.2019 0.1772384,-0.4036 0.177243,-0.6053 -4.6e-6,-0.3071 -0.1050376,-0.5462 -0.3150985,-0.7171 -0.2100697,-0.1756 -0.5032861,-0.2632 -0.87965,-0.2632 -0.3544889,0 -0.7374207,0.075 -1.1487968,0.2237 -0.4113804,0.1446 -0.840264,0.3618 -1.2866522,0.6513 v -2.0659 c 0.5295391,-0.184 1.0131273,-0.32 1.4507661,-0.4077 0.437634,-0.088 0.8599531,-0.1317 1.2669587,-0.1317 1.0678292,0 1.8818328,0.2194 2.442012,0.6579 0.560169,0.4341 0.840256,1.0702 0.840263,1.9078 -7e-6,0.4298 -0.08535,0.8159 -0.256017,1.158 -0.170685,0.3377 -0.461713,0.7017 -0.873085,1.092 l -0.4201313,0.375 c -0.297598,0.272 -0.4923463,0.4913 -0.5842451,0.658 -0.091909,0.1622 -0.1378603,0.342 -0.1378556,0.5394 v 0.296 m -2.3698034,0.9739 h 2.3698034 v 2.342 h -2.3698034 v -2.342" + d="M 9,1046.0464 H 6.6301966 v -0.3223 c 0,-0.3596 0.072207,-0.6775 0.2166302,-0.9539 0.1444174,-0.2807 0.4485749,-0.636 0.9124728,-1.0658 l 0.4201314,-0.3816 c 0.249449,-0.228 0.4310681,-0.4429 0.5448577,-0.6446 0.1181576,-0.2019 0.1772384,-0.4036 0.177243,-0.6053 -4.6e-6,-0.3071 -0.1050376,-0.5462 -0.3150985,-0.7171 -0.2100697,-0.1756 -0.5032861,-0.2632 -0.87965,-0.2632 -0.3544889,0 -0.7374207,0.075 -1.1487968,0.2237 -0.4113804,0.1446 -0.840264,0.3618 -1.2866522,0.6513 v -2.0659 c 0.5295391,-0.184 1.0131273,-0.32 1.4507661,-0.4077 0.437634,-0.088 0.8599531,-0.1317 1.2669587,-0.1317 1.0678292,0 1.8818328,0.2194 2.442012,0.6579 0.560169,0.4341 0.840256,1.0702 0.840263,1.9078 -7e-6,0.4298 -0.08535,0.8159 -0.256017,1.158 -0.170685,0.3377 -0.461713,0.7017 -0.873085,1.092 l -0.4201313,0.375 c -0.297598,0.272 -0.4923463,0.4913 -0.5842451,0.658 -0.091909,0.1622 -0.1378603,0.342 -0.1378556,0.5394 v 0.296 m -2.3698034,0.9739 H 9 v 2.342 H 6.6301966 v -2.342" sodipodi:nodetypes="ccsccccccsccccsccccccccccccc" /> @@ -195,7 +215,7 @@ + d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 L 40,997.54382 36.923828,1000.62 35.742187,999.43835" /> @@ -316,11 +336,11 @@ inkscape:connector-curvature="0" id="path4384-2" style="font-variant:normal;font-stretch:normal;font-size:20px;font-family:Arial;-inkscape-font-specification:Arial;fill:#ffffff;stroke:#000000;stroke-width:0.1;stroke-dasharray:none;stroke-opacity:1" - d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 -3.066406,-3.06638 -3.076172,3.07618 -1.181641,-1.18165" /> + d="m 35.742187,999.43835 3.076172,-3.07617 -3.066406,-3.0664 1.191406,-1.19141 3.066407,3.06641 3.05664,-3.05664 1.171875,1.18164 -3.046875,3.05664 3.066406,3.0664 -1.191406,1.19138 L 40,997.54382 36.923828,1000.62 35.742187,999.43835" /> @@ -763,5 +783,74 @@ inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccc" inkscape:label="" /> + + + + + + + + + + + + + + + + + diff --git a/umap/static/umap/map.css b/umap/static/umap/map.css index 4810bace..1cdf7412 100644 --- a/umap/static/umap/map.css +++ b/umap/static/umap/map.css @@ -284,9 +284,14 @@ ul.photon-autocomplete { } .umap-share h3:before { background-image: url('./img/16.svg'); - background-position: 0 -117px; + background-position: -4px -119px; +} +.dark .umap-tilelayer-switcher-container h3:before { + background-image: url('./img/16-white.svg'); + background-position: -98px -141px; } .umap-tilelayer-switcher-container h3:before { + background-image: url('./img/16.svg'); background-position: -98px -141px; } .umap-feature-properties.marker:before {