ptgbot/html/index.js
Thierry Carrez cb0e38cd12 Generate PTGbot index page dynamically
Current system (where the index page is specified in the
puppet-ptgbot module) requires that (some) links on the page
are updated in puppet-ptgbot at the start of every event.

That page should be dynamically generated from JSON data.
That way the list of links can be provided in the JSON database
and dynamically imported and updated using the ~fetchdb command.

Change-Id: I7d82b38cba495e5837ba54fbe7a9b7e9c8e14259
2018-12-21 15:35:30 +01:00

10 lines
340 B
JavaScript

// sets variable source to the animalTemplate id in index.html
var source = document.getElementById("LinksTemplate").innerHTML;
// Handlebars compiles the above source into a template
var template = Handlebars.compile(source);
$.getJSON("ptg.json", function(json) {
document.getElementById("ExtraLinks").innerHTML = template(json);
});