!7
p {
useLocalMechListCopies();
}
html {
uri = dropPrefix("/", uri);
L rules = ai_activeRules();
S ruleID = uri;
L found = filterByField(rules, globalID := ruleID);
//ret "Have " + n2(rules, "rule");
if (empty(found)) ret "Rule " + htmlencode(ruleID) + " not found";
new StringBuilder buf;
if (l(found) > 1)
buf.append(p("Bad: Multiple rules for ID " + htmlencode(ruleID) + "."));
for (IfThen rule : found) {
buf.append(h3("Rule " + htmlencode(rule.globalID)));
buf.append(hsourcecode(str(rule)));
}
ret buf;
}