diff --git a/umap/static/umap/base.css b/umap/static/umap/base.css
index 271f9d35..a40af1dd 100644
--- a/umap/static/umap/base.css
+++ b/umap/static/umap/base.css
@@ -334,6 +334,19 @@ input.switch:checked ~ label:after {
}
.button-bar {
margin-top: 5px;
+ text-align: center;
+ display: grid;
+ grid-gap: 7px;
+ width: 100%
+}
+.button-bar.half {
+ grid-template-columns: 1fr 1fr;
+}
+.button-bar.third {
+ grid-template-columns: 1fr 1fr 1fr;
+}
+.button-bar .button {
+ display: inline-block;
}
.umap-multiplechoice input[type='radio'] {
display: none;
@@ -421,7 +434,7 @@ i.info {
}
.umap-delete:before, .umap-empty:before, .umap-to-polygon:before,
-.umap-clone:before, .umap-edit:before,
+.umap-clone:before, .umap-edit:before, .umap-download:before,
.umap-to-polyline:before {
background-repeat: no-repeat;
text-indent: 38px;
@@ -435,7 +448,7 @@ i.info {
.dark .umap-delete:before, .dark .umap-empty:before,
.dark .umap-to-polygon:before,
.dark .umap-clone:before,
-.dark .umap-edit:before,
+.dark .umap-edit:before, .dark .umap-download:before,
.dark .umap-to-polyline:before {
background-image: url('./img/24-white.png');
vertical-align: middle;
@@ -458,6 +471,9 @@ i.info {
.umap-empty:before {
background-position: -160px -126px;
}
+.umap-download:before {
+ background-position: -88px -168px;
+}
.umap-edit-actions {
padding-top: 5px;
clear: both;
diff --git a/umap/static/umap/content.css b/umap/static/umap/content.css
index 6db1e78d..41734935 100644
--- a/umap/static/umap/content.css
+++ b/umap/static/umap/content.css
@@ -143,21 +143,6 @@ h2.section {
display: inline-block;
height: 128px;
}
-.button-bar {
- text-align: center;
-}
-.button-bar .button {
- display: inline-block;
-}
-.button-bar .button + .button {
- margin-left: 14px;
-}
-.button-bar .button.half {
- width: calc(50% - 7px);
-}
-.button-bar .button.third {
- width: calc(100% / 3 - 10px);
-}
.demo-instance-warning {
background-color: #c0392b;
color: #efefef;
diff --git a/umap/static/umap/img/24-white.png b/umap/static/umap/img/24-white.png
index f5bf14e2..95edf1d6 100644
Binary files a/umap/static/umap/img/24-white.png and b/umap/static/umap/img/24-white.png differ
diff --git a/umap/static/umap/img/24-white.svg b/umap/static/umap/img/24-white.svg
index 96865a43..2780170f 100644
--- a/umap/static/umap/img/24-white.svg
+++ b/umap/static/umap/img/24-white.svg
@@ -13,9 +13,9 @@
height="200"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
+ inkscape:version="0.92.2 2405546, 2018-03-11"
sodipodi:docname="24-white.svg"
- inkscape:export-filename="/home/ybon/Code/js/Leaflet.Storage/src/img/24-white.png"
+ inkscape:export-filename="/home/ybon/Code/py/umap/umap/static/umap/img/24-white.png"
inkscape:export-xdpi="89.996864"
inkscape:export-ydpi="89.996864">
+ id="guide3084"
+ inkscape:locked="false" />
+ id="guide3086"
+ inkscape:locked="false" />
+ id="guide3088"
+ inkscape:locked="false" />
+ id="guide3090"
+ inkscape:locked="false" />
+ id="guide3512"
+ inkscape:locked="false" />
+ id="guide3872"
+ inkscape:locked="false" />
+ id="guide25561"
+ inkscape:locked="false" />
+ id="guide25563"
+ inkscape:locked="false" />
@@ -105,15 +113,15 @@
sodipodi:nodetypes="cccccccccccccc" />
+ id="tspan4459"
+ style="font-size:40px;line-height:1.25;font-family:sans-serif">
0
1
+ style="font-weight:bold;font-size:8px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';fill:#4d4d4d;fill-opacity:1">1
+
diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js
index f00e2ec9..7179dd9b 100644
--- a/umap/static/umap/js/umap.controls.js
+++ b/umap/static/umap/js/umap.controls.js
@@ -88,7 +88,7 @@ L.U.UpdatePermsAction = L.U.BaseAction.extend({
},
addHooks: function () {
- this.map.permissions.panel();
+ this.map.permissions.edit();
}
});
diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js
index ff61488c..326ad6a9 100644
--- a/umap/static/umap/js/umap.js
+++ b/umap/static/umap/js/umap.js
@@ -1263,8 +1263,8 @@ L.U.Map.include({
callbackContext: this
});
limitBounds.appendChild(boundsBuilder.build());
- var boundsButtons = L.DomUtil.create('div', 'button-bar', limitBounds);
- var setCurrentButton = L.DomUtil.add('a', 'button half', boundsButtons, L._('Use current bounds'));
+ var boundsButtons = L.DomUtil.create('div', 'button-bar half', limitBounds);
+ var setCurrentButton = L.DomUtil.add('a', 'button', boundsButtons, L._('Use current bounds'));
setCurrentButton.href = '#';
L.DomEvent.on(setCurrentButton, 'click', function () {
var bounds = this.getBounds();
@@ -1276,7 +1276,7 @@ L.U.Map.include({
this.isDirty = true;
this.handleLimitBounds();
}, this);
- var emptyBounds = L.DomUtil.add('a', 'button half', boundsButtons, L._('Empty'));
+ var emptyBounds = L.DomUtil.add('a', 'button', boundsButtons, L._('Empty'));
emptyBounds.href = '#';
L.DomEvent.on(emptyBounds, 'click', function () {
this.options.limitBounds.south = null;
@@ -1318,27 +1318,34 @@ L.U.Map.include({
credits.appendChild(creditsBuilder.build());
var advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions'));
- var advancedButtons = L.DomUtil.create('div', 'button-bar', advancedActions);
- var del = L.DomUtil.create('a', 'button third umap-delete', advancedButtons);
+ var advancedButtons = L.DomUtil.create('div', 'button-bar half', advancedActions);
+ var del = L.DomUtil.create('a', 'button umap-delete', advancedButtons);
del.href = '#';
del.innerHTML = L._('Delete');
L.DomEvent
.on(del, 'click', L.DomEvent.stop)
.on(del, 'click', this.del, this);
- var clone = L.DomUtil.create('a', 'button third umap-clone', advancedButtons);
+ var clone = L.DomUtil.create('a', 'button umap-clone', advancedButtons);
clone.href = '#';
clone.innerHTML = L._('Clone');
clone.title = L._('Clone this map');
L.DomEvent
.on(clone, 'click', L.DomEvent.stop)
.on(clone, 'click', this.clone, this);
- var empty = L.DomUtil.create('a', 'button third umap-empty', advancedButtons);
+ var empty = L.DomUtil.create('a', 'button umap-empty', advancedButtons);
empty.href = '#';
empty.innerHTML = L._('Empty');
empty.title = L._('Delete all layers');
L.DomEvent
.on(empty, 'click', L.DomEvent.stop)
.on(empty, 'click', this.empty, this);
+ var download = L.DomUtil.create('a', 'button umap-download', advancedButtons);
+ download.href = '#';
+ download.innerHTML = L._('Download');
+ download.title = L._('Open download panel');
+ L.DomEvent
+ .on(download, 'click', L.DomEvent.stop)
+ .on(download, 'click', this.renderShareBox, this);
this.ui.openPanel({data: {html: container}, className: 'dark'});
},
diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js
index af8a5214..7acc5a89 100644
--- a/umap/static/umap/js/umap.layer.js
+++ b/umap/static/umap/js/umap.layer.js
@@ -796,8 +796,8 @@ L.U.DataLayer = L.Class.extend({
if (this.map.options.urls.datalayer_versions) this.buildVersionsFieldset(container);
var advancedActions = L.DomUtil.createFieldset(container, L._('Advanced actions'));
- var advancedButtons = L.DomUtil.create('div', 'button-bar', advancedActions);
- var deleteLink = L.DomUtil.create('a', 'button third delete_datalayer_button umap-delete', advancedButtons);
+ var advancedButtons = L.DomUtil.create('div', 'button-bar half', advancedActions);
+ var deleteLink = L.DomUtil.create('a', 'button delete_datalayer_button umap-delete', advancedButtons);
deleteLink.innerHTML = L._('Delete');
deleteLink.href = '#';
L.DomEvent.on(deleteLink, 'click', L.DomEvent.stop)
@@ -806,13 +806,13 @@ L.U.DataLayer = L.Class.extend({
this.map.ui.closePanel();
}, this);
if (!this.isRemoteLayer()) {
- var emptyLink = L.DomUtil.create('a', 'button third umap-empty', advancedButtons);
+ var emptyLink = L.DomUtil.create('a', 'button umap-empty', advancedButtons);
emptyLink.innerHTML = L._('Empty');
emptyLink.href = '#';
L.DomEvent.on(emptyLink, 'click', L.DomEvent.stop)
.on(emptyLink, 'click', this.empty, this);
}
- var cloneLink = L.DomUtil.create('a', 'button third umap-clone', advancedButtons);
+ var cloneLink = L.DomUtil.create('a', 'button umap-clone', advancedButtons);
cloneLink.innerHTML = L._('Clone');
cloneLink.href = '#';
L.DomEvent.on(cloneLink, 'click', L.DomEvent.stop)
@@ -820,6 +820,10 @@ L.U.DataLayer = L.Class.extend({
var datalayer = this.clone();
datalayer.edit();
}, this);
+ var download = L.DomUtil.create('a', 'button umap-download', advancedButtons);
+ download.innerHTML = L._('Download');
+ download.href = this._dataUrl();
+ download.target = '_blank';
this.map.ui.openPanel({data: {html: container}, className: 'dark'});
},
diff --git a/umap/static/umap/js/umap.permissions.js b/umap/static/umap/js/umap.permissions.js
index 4cb5cc6c..6f7e7c92 100644
--- a/umap/static/umap/js/umap.permissions.js
+++ b/umap/static/umap/js/umap.permissions.js
@@ -43,7 +43,7 @@ L.U.MapPermissions = L.Class.extend({
return this.map;
},
- panel: function () {
+ edit: function () {
if (!this.map.options.umap_id) return this.map.ui.alert({content: L._('Please save the map before'), level: 'info'});
var container = L.DomUtil.create('div', 'permissions-panel'),
fields = [],