diff --git a/css/65_data.css b/css/65_data.css index 4491570d7..651045e43 100644 --- a/css/65_data.css +++ b/css/65_data.css @@ -146,3 +146,7 @@ max-height: 300px; min-height: 100px; } + +.note-report { + float: right; +} \ No newline at end of file diff --git a/css/80_app.css b/css/80_app.css index e878f3af1..e421d1546 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -3573,6 +3573,7 @@ img.tile-debug { display: flex; flex-wrap: wrap; justify-content: space-around; + margin-bottom: 30px; } .save-section .buttons .action, diff --git a/data/core.yaml b/data/core.yaml index 58993ea84..199a723ab 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -623,6 +623,7 @@ en: comment: Comment close_comment: Close and Comment open_comment: Reopen and Comment + report: Report help: title: Help key: H diff --git a/dist/locales/en.json b/dist/locales/en.json index 7c28239bc..b8df4e7a5 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -755,7 +755,8 @@ "open": "Reopen Note", "comment": "Comment", "close_comment": "Close and Comment", - "open_comment": "Reopen and Comment" + "open_comment": "Reopen and Comment", + "report": "Report" }, "help": { "title": "Help", @@ -6686,7 +6687,7 @@ "attribution": { "text": "Terms & Feedback" }, - "description": "DigitalGlobe-Premium is a mosaic composed of DigitalGlobe basemap with select regions filled with +Vivid or custom area of interest imagery, 50cm resolution or better, and refreshed more frequently with ongoing updates.", + "description": "Premium DigitalGlobe satellite imagery.", "name": "DigitalGlobe Premium Imagery" }, "DigitalGlobe-Premium-vintage": { @@ -6700,7 +6701,7 @@ "attribution": { "text": "Terms & Feedback" }, - "description": "DigitalGlobe-Standard is a curated set of imagery covering 86% of the earth’s landmass, with 30-60cm resolution where available, backfilled by Landsat. Average age is 2.31 years, with some areas updated 2x per year.", + "description": "Standard DigitalGlobe satellite imagery.", "name": "DigitalGlobe Standard Imagery" }, "DigitalGlobe-Standard-vintage": { diff --git a/modules/ui/index.js b/modules/ui/index.js index c8caebac5..35d9a8517 100644 --- a/modules/ui/index.js +++ b/modules/ui/index.js @@ -37,6 +37,7 @@ export { uiNotice } from './notice'; export { uiNoteComments } from './note_comments'; export { uiNoteEditor } from './note_editor'; export { uiNoteHeader } from './note_header'; +export { uiNoteReport } from './note_report'; export { uiPresetEditor } from './preset_editor'; export { uiPresetIcon } from './preset_icon'; export { uiPresetList } from './preset_list'; diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index dce1e6e15..80e6ac4c7 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -9,7 +9,8 @@ import { svgIcon } from '../svg'; import { uiNoteComments, uiNoteHeader, - uiViewOnOSM + uiNoteReport, + uiViewOnOSM, } from './index'; import { @@ -20,8 +21,8 @@ import { export function uiNoteEditor(context) { var dispatch = d3_dispatch('change'); - var noteHeader = uiNoteHeader(); var noteComments = uiNoteComments(); + var noteHeader = uiNoteHeader(); var _note; @@ -67,7 +68,8 @@ export function uiNoteEditor(context) { .enter() .append('div') .attr('class', 'footer') - .call(uiViewOnOSM(context).what(_note)); + .call(uiViewOnOSM(context).what(_note)) + .call(uiNoteReport(context).note(_note)); } diff --git a/modules/ui/note_report.js b/modules/ui/note_report.js new file mode 100644 index 000000000..759f9ba13 --- /dev/null +++ b/modules/ui/note_report.js @@ -0,0 +1,47 @@ +import { t } from '../util/locale'; +import { svgIcon } from '../svg'; +import { + osmNote +} from '../osm'; + + +export function uiNoteReport() { + var _note; + var url = 'https://www.openstreetmap.org/reports/new?reportable_id='; + + function noteReport(selection) { + + if (!(_note instanceof osmNote)) return; + + url += _note.id + '&reportable_type=Note'; + + var data = ((!_note || _note.isNew()) ? [] : [_note]); + var link = selection.selectAll('.note-report') + .data(data, function(d) { return d.id; }); + + // exit + link.exit() + .remove(); + + // enter + var linkEnter = link.enter() + .append('a') + .attr('class', 'note-report') + .attr('target', '_blank') + .attr('href', url) + .call(svgIcon('#iD-icon-out-link', 'inline')); + + linkEnter + .append('span') + .text(t('note.report')); + } + + + noteReport.note = function(_) { + if (!arguments.length) return _note; + _note = _; + return noteReport; + }; + + return noteReport; +}