diff --git a/css/app.css b/css/app.css index 0e5b46b35..60a227c4b 100644 --- a/css/app.css +++ b/css/app.css @@ -2347,6 +2347,31 @@ img.wiki-image { border-bottom: 1px solid #CCC; } +.modal-section.header h3 { + padding: 0; +} + +.modal-section.buttons { + text-align: center; +} + +.modal-section.buttons .action { + display: inline-block; + margin: 0 10px; + text-align: center; + vertical-align: middle; +} + +.conflicts-help { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} + .error-detail-item { padding-left: 10px; } diff --git a/data/core.yaml b/data/core.yaml index 26ed9526d..81d8fe0ab 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -312,12 +312,24 @@ en: title: Save help: "Save changes to OpenStreetMap, making them visible to other users." no_changes: No changes to save. - error: Errors occurred while trying to save + errors: Errors occurred while trying to save status_code: "Server returned status code {code}" status_gone: '{type} "{id}" {name} has already been deleted.' unknown_error_details: "Please ensure you are connected to the internet." uploading: Uploading changes to OpenStreetMap. unsaved_changes: You have unsaved changes + conflicts: + header: Conflicting edits detected + keep_local: Keep Mine + keep_remote: Keep Theirs + restore: Restore + leave_deleted: Leave Deleted + try_again: Try Again + download_changes: Download Changes + help: | + It looks like another OpenStreetMap user has changed some of the same map features that you changed. + You can click on each item below for more details about the conflict, and choose whether to keep + your changes or the other user's changes. Or, you can download your changes to a file. merge_remote_changes: annotation: Merged remote changes from server. conflict: @@ -338,6 +350,7 @@ en: (details). confirm: okay: "Okay" + cancel: "Cancel" splash: welcome: Welcome to the iD OpenStreetMap editor text: "iD is a friendly but powerful tool for contributing to the world's best free world map. This is version {version}. For more information see {website} and report bugs at {github}." diff --git a/dist/locales/en.json b/dist/locales/en.json index 226480525..15fec00ad 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -386,12 +386,22 @@ "title": "Save", "help": "Save changes to OpenStreetMap, making them visible to other users.", "no_changes": "No changes to save.", - "error": "Errors occurred while trying to save", + "errors": "Errors occurred while trying to save", "status_code": "Server returned status code {code}", "status_gone": "{type} \"{id}\" {name} has already been deleted.", "unknown_error_details": "Please ensure you are connected to the internet.", "uploading": "Uploading changes to OpenStreetMap.", - "unsaved_changes": "You have unsaved changes" + "unsaved_changes": "You have unsaved changes", + "conflicts": { + "header": "Conflicting edits detected", + "keep_local": "Keep Mine", + "keep_remote": "Keep Theirs", + "restore": "Restore", + "leave_deleted": "Leave Deleted", + "try_again": "Try Again", + "download_changes": "Download Changes", + "help": "It looks like another OpenStreetMap user has changed some of the same map features that you changed.\nYou can click on each item below for more details about the conflict, and choose whether to keep\nyour changes or the other user's changes. Or, you can download your changes to a file.\n" + } }, "merge_remote_changes": { "annotation": "Merged remote changes from server.", @@ -413,7 +423,8 @@ "help_html": "Your changes should appear in the \"Standard\" layer in a few minutes. Other layers, and certain features, may take longer\n(details).\n" }, "confirm": { - "okay": "Okay" + "okay": "Okay", + "cancel": "Cancel" }, "splash": { "welcome": "Welcome to the iD OpenStreetMap editor", diff --git a/js/id/modes/save.js b/js/id/modes/save.js index 3ca23d8e5..71b168f70 100644 --- a/js/id/modes/save.js +++ b/js/id/modes/save.js @@ -108,25 +108,49 @@ iD.modes.Save = function(context) { function showConflicts() { var confirm = iD.ui.confirm(context.container()); + loading.close(); confirm .select('.modal-section.header') .append('h3') - .text('Conflicts!'); - // .text(t('save.error')); + .text(t('save.conflicts.header')); + + confirm + .select('.modal-section.message-text') + .append('div') + .attr('class', 'conflicts-help') + .text(t('save.conflicts.help')); addItems(confirm, conflicts); - confirm - .select('.modal-section.buttons') + + var buttons = confirm + .select('.modal-section.buttons'); + + buttons .append('button') - .attr('class', 'col2 action') - .on('click.confirm', function() { + .attr('class', 'action col3') + .on('click.try_again', function() { confirm.remove(); }) - .text('NOT Ok'); - // .text(t('confirm.okay')); + .text(t('save.conflicts.try_again')); + + buttons + .append('button') + .attr('class', 'action col3') + .on('click.cancel', function() { + confirm.remove(); + }) + .text(t('confirm.cancel')); + + buttons + .append('button') + .attr('class', 'action col3') + .on('click.download', function() { + confirm.remove(); + }) + .text(t('save.conflicts.download_changes')); } function showErrors() { @@ -136,7 +160,7 @@ iD.modes.Save = function(context) { confirm .select('.modal-section.header') .append('h3') - .text(t('save.error')); + .text(t('save.errors')); addItems(confirm, errors); confirm.okButton(); @@ -147,7 +171,7 @@ iD.modes.Save = function(context) { .select('.modal-section.message-text'); var items = message - .selectAll('div') + .selectAll('.error-container') .data(data); var enter = items.enter() diff --git a/js/id/ui/confirm.js b/js/id/ui/confirm.js index 6ce9b71ee..367877e79 100644 --- a/js/id/ui/confirm.js +++ b/js/id/ui/confirm.js @@ -12,13 +12,13 @@ iD.ui.confirm = function(selection) { section.append('div') .attr('class', 'modal-section message-text'); - var buttonwrap = section.append('div') + var buttons = section.append('div') .attr('class', 'modal-section buttons cf'); modal.okButton = function() { - buttonwrap + buttons .append('button') - .attr('class', 'col2 action') + .attr('class', 'action col2') .on('click.confirm', function() { modal.remove(); })