mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Add more information to popup windows
This commit is contained in:
parent
f4e1833c24
commit
d259b71231
2 changed files with 31 additions and 3 deletions
27
static/js/popup.js
Normal file
27
static/js/popup.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
export default function template(incident) {
|
||||
var html = ''
|
||||
var monthMap = {
|
||||
'01': 'Januar',
|
||||
'02': 'Februar',
|
||||
'03': 'März',
|
||||
'04': 'April',
|
||||
'05': 'Mai',
|
||||
'06': 'Juni',
|
||||
'07': 'Juli',
|
||||
'08': 'August',
|
||||
'09': 'September',
|
||||
'10': 'Oktober',
|
||||
'11': 'November',
|
||||
'12': 'Dezember',
|
||||
}
|
||||
|
||||
var dateComponents = incident.date.split('-')
|
||||
var date = dateComponents[2] + '. ' + monthMap[dateComponents[1]] + ' ' + dateComponents[0]
|
||||
|
||||
html += '<div data-id="' + incident.id + '">'
|
||||
html += '<h3 class="date">' + date + '</h3>'
|
||||
html += '<p>' + incident.description.replace(/\n/g, '<br>') + '</p>'
|
||||
html += '</div>'
|
||||
|
||||
return html
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue