summaryrefslogtreecommitdiff
path: root/script.js
blob: b202914e07338075fcad9a16d60162b4cbb2c041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const tbody = document.getElementById('tbody');

function newEl(tagname, content) {
	const cell = document.createElement(tagname);
	if (content instanceof Node)
		cell.appendChild(content);
	else
		cell.textContent = content;
	return cell;
}

(async function() {
	const data = await (await fetch('proposals.json')).json();
	data.forEach(proposal => {
		const row = document.createElement('tr');

		const statusCell = newEl('td', proposal.status);
		statusCell.className = 'status-' + proposal.status;
		row.appendChild(statusCell);
		const link = newEl('a', proposal.name);
		link.href = 'https://wiki.openstreetmap.org/wiki/' + proposal.page_title.replaceAll(' ', '_');
		row.appendChild(newEl('td', link));
		row.appendChild(newEl('td', proposal.draft_start));
		row.appendChild(newEl('td', proposal.rfc_start));
		row.appendChild(newEl('td', proposal.vote_start));
		row.appendChild(newEl('td', proposal.authors));

		tbody.appendChild(row);
	});
})();