in js/abuse.js [308:347]
function make_rule_accordion(adiv, rules) {
adiv.innerText = '';
for (const [k, item] of Object.entries(block_rules)) {
const idiv = document.createElement('div');
idiv.className = "accordion-item";
const hdiv = document.createElement('h2');
hdiv.className = "accordion-header";
hdiv.id = k;
const bdiv = document.createElement('button');
bdiv.className = "accordion-button collapsed";
bdiv.id = `cb_${k}`;
bdiv.type = "button";
bdiv.dataset.bsToggle = "collapse";
bdiv.dataset.bsTarget = `#collapse_${k}`;
bdiv.style.fontWeight = "bold";
const kbd = document.createElement('code');
kbd.innerText = k;
kbd.style.marginRight = '8px';
const title = document.createTextNode(" " + item.title);
bdiv.appendChild(kbd);
bdiv.appendChild(title);
const cdiv = document.createElement('div');
cdiv.className = "accordion-collapse collapse";
cdiv.dataset.bsParent = 'block_rules';
bdiv.ariaExpanded = false;
bdiv.ariaControls = `#collapse_${k}`;
cdiv.id = `collapse_${k}`;
idiv.appendChild(hdiv);
hdiv.appendChild(bdiv);
idiv.appendChild(cdiv);
const tdiv = document.createElement('div');
tdiv.className = "accordion-body";
tdiv.innerText = item.description.length ? item.description : "No specific description is available for this rule at this time.";
cdiv.appendChild(tdiv);
adiv.appendChild(idiv);
const advice = document.getElementById('general_block_advice').cloneNode(true);
advice.style.display = "block";
tdiv.appendChild(advice);
}
}