WIP: conflict save dialog

* multiple buttons
* help text
This commit is contained in:
Bryan Housel
2015-01-10 20:35:43 -05:00
parent d6b0e0a8bb
commit 95c92e9a59
5 changed files with 90 additions and 17 deletions
+25
View File
@@ -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;
}
+14 -1
View File
@@ -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:
(<a href='https://help.openstreetmap.org/questions/4705/why-havent-my-changes-appeared-on-the-map' target='_blank'>details</a>).
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}."
+14 -3
View File
@@ -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(<a href='https://help.openstreetmap.org/questions/4705/why-havent-my-changes-appeared-on-the-map' target='_blank'>details</a>).\n"
},
"confirm": {
"okay": "Okay"
"okay": "Okay",
"cancel": "Cancel"
},
"splash": {
"welcome": "Welcome to the iD OpenStreetMap editor",
+34 -10
View File
@@ -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()
+3 -3
View File
@@ -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();
})