Allow to use http://umap.fr/map/xxxx?share to open shareBox on load

That way is more consistent with ?download and ?edit
This commit is contained in:
Yohan Boniface 2023-07-12 09:14:24 +02:00
parent 8f76252b3a
commit bb4c027ec7
3 changed files with 4 additions and 4 deletions

View file

@ -251,10 +251,10 @@ L.U.Map.include({
} }
this.initShortcuts() this.initShortcuts()
this.onceDatalayersLoaded(function () { this.onceDatalayersLoaded(function () {
if (this.options.onLoadPanel === 'databrowser') this.openBrowser() if (L.Util.queryString('share')) this.renderShareBox()
else if (this.options.onLoadPanel === 'databrowser') this.openBrowser()
else if (this.options.onLoadPanel === 'caption') this.displayCaption() else if (this.options.onLoadPanel === 'caption') this.displayCaption()
else if (this.options.onLoadPanel === 'datafilters') this.openFilter() else if (this.options.onLoadPanel === 'datafilters') this.openFilter()
else if (this.options.onLoadPanel === 'share') this.renderShareBox()
}) })
this.onceDataLoaded(function () { this.onceDataLoaded(function () {
const slug = L.Util.queryString('feature') const slug = L.Util.queryString('feature')

View file

@ -20,7 +20,7 @@
<a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a> <a href="{{ map_inst.owner.get_url }}">{{ map_inst.owner }}</a>
</td> </td>
<td> <td>
<a href="{{ map_inst.get_absolute_url }}?onLoadPanel=share">{% translate "Share" %}</a> <a href="{{ map_inst.get_absolute_url }}?share">{% translate "Share" %}</a>
<a href="{{ map_inst.get_absolute_url }}?edit">{% translate "Edit" %}</a> <a href="{{ map_inst.get_absolute_url }}?edit">{% translate "Edit" %}</a>
<a href="{{ map_inst.get_absolute_url }}?download">{% translate "Download" %}</a> <a href="{{ map_inst.get_absolute_url }}?download">{% translate "Download" %}</a>
</td> </td>

View file

@ -257,5 +257,5 @@ def test_user_dashboard_display_user_maps(client, map):
body = response.content.decode() body = response.content.decode()
assert map.name in body assert map.name in body
assert f"{map.get_absolute_url()}?edit" in body assert f"{map.get_absolute_url()}?edit" in body
assert f"{map.get_absolute_url()}?onLoadPanel=share" in body assert f"{map.get_absolute_url()}?share" in body
assert f"{map.get_absolute_url()}?download" in body assert f"{map.get_absolute_url()}?download" in body