!7 p { useLocalMechListCopies(); } html { uri = dropPrefix("/", uri); L rules = ai_activeRules(); S ruleID = urldecode(uri); if (empty(uri)) ret h3(n2(rules, "rule")) + map_pcall(rules, func(IfThen rule) { ahref(rawSelfLink(urlencode(rule.globalID)), htmlencode(rule.globalID)) }); L found = filterByField(rules, globalID := ruleID); 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; }