rules: cleanly close element
rules: fix HTML and template

Some div were not closed correctly and a test on data presence
was not needed anymore as they are now fetched via AJAX.