X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/90fe21a04a709db10935327172a5a93869fabd8b..0b981e4b7fd1aa85ac635fdb6d2cb58d9a2fd81d:/app/assets/javascripts/notes.js.erb diff --git a/app/assets/javascripts/notes.js.erb b/app/assets/javascripts/notes.js.erb index 01264bcb6..c55c11ec9 100644 --- a/app/assets/javascripts/notes.js.erb +++ b/app/assets/javascripts/notes.js.erb @@ -13,6 +13,17 @@ function addNoteLayer(map, notesUrl, newNoteControls, newNoteForm, minZoom) { newNotes = undefined; }; + var describeNote = function (n) { + var description = "

Note " + n.id + "

"; + + n.comments.forEach(function (c) { + description += "

" + c.action + " by "; + description += c.user + " at " + c.date + "
" + c.text + "

"; + }); + + return description; + } + var noteSelected = function (o) { var feature = o.feature; var location = feature.geometry.getBounds().getCenterLonLat(); @@ -25,7 +36,7 @@ function addNoteLayer(map, notesUrl, newNoteControls, newNoteForm, minZoom) { content = form.html(); close = false; } else { - content = "

" + feature.attributes.id + "

"; + content = describeNote(feature.attributes); close = true; };