button.addEventListener('click', function(e){
var tag = e.target.textContent.replace(' ', '-');
window.location.href='/result/'+tag;
in your frontend js. I've not seen this before, and I definitely learnt something. But is it necessary?
Given that you have the page redirecting/refreshing anyway, I think you could just accomplish the same thing with an html form, using input type of 'checkbox' and method set to 'get'. If I'm right, then by doing this you could avoid having any frontend js.
If on the other hand you wanted to avoid refreshing/redirecting the page, you could make an xhr request and populate the page using frontend dom manipulation when the response comes back. However, you are not currently doing this.
You have:
in your frontend js. I've not seen this before, and I definitely learnt something. But is it necessary? Given that you have the page redirecting/refreshing anyway, I think you could just accomplish the same thing with an html form, using input type of 'checkbox' and method set to 'get'. If I'm right, then by doing this you could avoid having any frontend js.
If on the other hand you wanted to avoid refreshing/redirecting the page, you could make an xhr request and populate the page using frontend dom manipulation when the response comes back. However, you are not currently doing this.