diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 5cdf1389..cd70c888 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -80,6 +80,7 @@ editor = { }, // sidebar + _last_map_path: null, get_location_path: function () { return window.location.pathname + window.location.search; }, @@ -151,6 +152,7 @@ editor = { var geometry_url = content.find('[data-geometry-url]'); if (geometry_url.length) { + editor._last_map_path = editor.get_location_path(); geometry_url = geometry_url.attr('data-geometry-url'); var highlight_type = content.find('[data-list]'); var editing_id = content.find('[data-editing]'); @@ -175,6 +177,12 @@ editor = { bottom: offset_parent.height()-level_control_offset.top-editor._level_control_container.height()-parseInt(editor._level_control_container.css('margin-bottom')), right: offset_parent.width()-level_control_offset.left }); + } else if (content.find('[data-keep-geometry]').length) { + if (editor._last_map_path === null) $('[data-back-to-map]').remove() + $('a[data-back-to-map]').attr('href', editor._last_map_path); + $('body').removeClass('show-map'); + editor._level_control.hide(); + editor._sublevel_control.hide(); } else { $('body').removeClass('map-enabled').removeClass('show-map'); editor._level_control.hide(); diff --git a/src/c3nav/editor/templates/editor/changeset.html b/src/c3nav/editor/templates/editor/changeset.html index 56ea4cae..93373b2f 100644 --- a/src/c3nav/editor/templates/editor/changeset.html +++ b/src/c3nav/editor/templates/editor/changeset.html @@ -4,11 +4,12 @@ {% include 'editor/fragment_levels.html' %} -
+ {% csrf_token %}

{{ changeset.title }}

{{ desc }}{% if changeset.author %} {{ changeset.author.username }}{% endif %}

+

« {% trans 'back to map' %}

{% for group in grouped_changes %}