diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css index 7c62ce5d..413dac70 100644 --- a/umap/static/umap/base.css +++ b/umap/static/umap/base.css @@ -147,7 +147,13 @@ dt { margin-right: auto; float: none; } - +.grid-container { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); +} +.grid-container > * { + text-align: center; +} /* *********** */ /* forms */ @@ -794,37 +800,6 @@ input[type=hidden].blur + [type="button"] { } -/* *********** */ -/* Importers */ -/* *********** */ -#importers button { - background: none; - font-size: 1.2rem; - border: none; -} -#importers button:before { - background-image: url(./img/importers/random.svg); - background-repeat: no-repeat; - background-position: center; - content: ''; - width: 100%; - height: 50px; - display: block; -} -#importers .geodatamine:before { - background-image: url(./img/importers/geodatamine.svg); -} -#importers .communesfr:before { - background-image: url(./img/importers/communesfr.svg); -} -#importers .overpass:before { - background-image: url(./img/importers/overpass.svg); -} -#importers .datasets:before { - background-image: url(./img/importers/datasets.svg); -} - - /* *********** */ /* Various */ /* *********** */ diff --git a/umap/static/umap/css/importers.css b/umap/static/umap/css/importers.css new file mode 100644 index 00000000..cfebfc3c --- /dev/null +++ b/umap/static/umap/css/importers.css @@ -0,0 +1,44 @@ +.importers ul [type=button] { + background: none; + font-size: 1rem; + border: none; + width: initial; + display: inline-block; +} +.importer h3:before { + background-image: url(../img/importers/random.svg); + background-repeat: no-repeat; + background-position: center; + content: ''; + width: 36px; + height: 36px; + display: inline-block; + margin-right: 10px; + background-size: 100%; + vertical-align: -10px; +} +.importers ul [type=button]:before { + background-image: url(../img/importers/random.svg); + background-repeat: no-repeat; + background-position: center; + content: ''; + width: 100%; + height: 50px; + display: block; +} +.importer.geodatamine h3:before, +.importers ul .geodatamine:before { + background-image: url(../img/importers/geodatamine.svg); +} +.importer.communesfr h3:before, +.importers ul .communesfr:before { + background-image: url(../img/importers/communesfr.svg); +} +.importer.overpass h3:before, +.importers ul .overpass:before { + background-image: url(../img/importers/overpass.svg); +} +.importer.datasets h3:before, +.importers ul .datasets:before { + background-image: url(../img/importers/datasets.svg); +} diff --git a/umap/static/umap/js/modules/importer.js b/umap/static/umap/js/modules/importer.js index 53dd896c..a9f05f2a 100644 --- a/umap/static/umap/js/modules/importer.js +++ b/umap/static/umap/js/modules/importer.js @@ -14,8 +14,8 @@ const TEMPLATE = `

${translate('Import helpers:')}

-
-
+
@@ -128,10 +128,11 @@ export default class Importer { this.container = DomUtil.create('div', 'umap-upload') this.container.innerHTML = TEMPLATE if (this.IMPORTERS.length) { + const parent = this.container.querySelector('.importers ul') for (const plugin of this.IMPORTERS.sort((a, b) => (a.id > b.id ? 1 : -1))) { L.DomUtil.createButton( plugin.id, - this.container.querySelector('#importers'), + DomUtil.element({tagName: 'li', parent}), plugin.name, () => plugin.open(this) ) diff --git a/umap/static/umap/js/modules/importers/communesfr.js b/umap/static/umap/js/modules/importers/communesfr.js index 055d4ecf..6a7348cc 100644 --- a/umap/static/umap/js/modules/importers/communesfr.js +++ b/umap/static/umap/js/modules/importers/communesfr.js @@ -38,7 +38,7 @@ export class Importer { importer.dialog.open({ content: container, - className: `${this.id} dark`, + className: `${this.id} importer dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/datasets.js b/umap/static/umap/js/modules/importers/datasets.js index 7742ebe0..eca162b3 100644 --- a/umap/static/umap/js/modules/importers/datasets.js +++ b/umap/static/umap/js/modules/importers/datasets.js @@ -35,7 +35,7 @@ export class Importer { importer.dialog.open({ content: container, - className: `${this.id} dark`, + className: `${this.id} importer dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/geodatamine.js b/umap/static/umap/js/modules/importers/geodatamine.js index 051a8bbb..acbed11f 100644 --- a/umap/static/umap/js/modules/importers/geodatamine.js +++ b/umap/static/umap/js/modules/importers/geodatamine.js @@ -88,7 +88,7 @@ export class Importer { importer.dialog.open({ content: container, - className: `${this.id} dark`, + className: `${this.id} importer dark`, }) } } diff --git a/umap/static/umap/js/modules/importers/overpass.js b/umap/static/umap/js/modules/importers/overpass.js index 6c28f62b..94e4615c 100644 --- a/umap/static/umap/js/modules/importers/overpass.js +++ b/umap/static/umap/js/modules/importers/overpass.js @@ -79,7 +79,7 @@ export class Importer { importer.dialog.open({ content: container, - className: `${this.id} dark`, + className: `${this.id} importer dark`, }) } } diff --git a/umap/static/umap/js/modules/ui/dialog.js b/umap/static/umap/js/modules/ui/dialog.js index 01204180..ae72c2a5 100644 --- a/umap/static/umap/js/modules/ui/dialog.js +++ b/umap/static/umap/js/modules/ui/dialog.js @@ -34,6 +34,8 @@ export default class Dialog { if (modal) this.container.showModal() else this.container.show() if (className) { + // Reset + this.container.className = 'umap-dialog' this.container.classList.add(...className.split(' ')) } const buttonsContainer = DomUtil.create('ul', 'buttons', this.container) diff --git a/umap/templates/umap/css.html b/umap/templates/umap/css.html index 06ce487e..64a65b58 100644 --- a/umap/templates/umap/css.html +++ b/umap/templates/umap/css.html @@ -32,4 +32,5 @@ +