From b5ece1643251b87ecc78f902185925a7ff96bcc7 Mon Sep 17 00:00:00 2001 From: Kushan Joshi <0o3ko0@gmail.com> Date: Mon, 24 Jul 2017 16:18:47 +0530 Subject: [PATCH] add requesting review --- css/80_app.css | 4 ++++ data/core.yaml | 2 ++ dist/locales/en.json | 2 ++ modules/ui/commit.js | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/css/80_app.css b/css/80_app.css index a4a6b652e..7de353237 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -3293,6 +3293,10 @@ img.tile-removing { } .mode-save .commit-info { + margin-bottom: 2px; +} + +.mode-save .request-review { margin-bottom: 10px; } diff --git a/data/core.yaml b/data/core.yaml index 44767d2fa..c49a0afd4 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -258,6 +258,8 @@ en: message_label: Changeset Comment upload_explanation: "The changes you upload will be visible on all maps that use OpenStreetMap data." upload_explanation_with_user: "The changes you upload as {user} will be visible on all maps that use OpenStreetMap data." + request_review: "I would like someone to review my edits." + request_review_link: "http://wiki.openstreetmap.org/wiki/Changeset" save: Upload cancel: Cancel changes: "{count} Changes" diff --git a/dist/locales/en.json b/dist/locales/en.json index d7e12c6f5..2eb22882d 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -332,6 +332,8 @@ "message_label": "Changeset Comment", "upload_explanation": "The changes you upload will be visible on all maps that use OpenStreetMap data.", "upload_explanation_with_user": "The changes you upload as {user} will be visible on all maps that use OpenStreetMap data.", + "request_review": "I would like someone to review my edits.", + "request_review_link": "http://wiki.openstreetmap.org/wiki/Changeset", "save": "Upload", "cancel": "Cancel", "changes": "{count} Changes", diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 4e1512b8e..7dca44f51 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -173,6 +173,20 @@ export function uiCommit(context) { .attr('class', 'commit-info') .html(t('commit.upload_explanation')); + var requestReview = saveSection + .append('p') + .attr('class', 'request-review') + .html( t('commit.request_review')) + .append('a') + .attr('target', '_blank') + .attr('tabindex', -1) + .call(svgIcon('#icon-out-link', 'inline')) + .attr('href', t('commit.request_review_link')); + + requestReview + .append('input') + .attr('type', 'checkbox') + .on('change', toggleRequestReview()); context.connection().userDetails(function(err, user) { if (err) return; @@ -375,6 +389,31 @@ export function uiCommit(context) { }; } + function toggleRequestReview() { + var toggled = false; + return function() { + var changeset; + if (toggled) { + changeset = updateChangeset({ + review_requested: undefined + }); + } else { + changeset = updateChangeset({ + review_requested: 'yes' + }); + } + toggled = !toggled; + var expanded = !tagSection + .selectAll('a.hide-toggle.expanded') + .empty(); + + tagSection.call(rawTagEditor + .expanded(expanded) + .readOnlyTags(readOnlyTags) + .tags(_.clone(changeset.tags))); + }; + } + function changeTags(changed) { if (changed.hasOwnProperty('comment')) {