!7 concept Page { S url; } concept Entry { new Ref page; S key, value; S ip; } p { dbIndexingCI(Page, 'url); } html { S url = domain() + dropTrailingSlash(uri); Pair pageAndNew = uniqCI2_sync(Page, +url); Page page = pageAndNew.a; if (eqicOneOf(url, "agi.blue", "www.agi.blue")) ret hhtml(hhead_title("agi.blue Overview") + hbody(h1("agi.blue Overview") + ul_htmlencode(collect url(list(Page))) )); S key = params.get('key), value = params.get('value); L entries = findBackRefs(page, Entry); if (nempty(key) && nempty(value) && hasWhereIC(entries, +key, +value)) entries.add(cnew Entry(+page, +key, +value, ip := subBot_clientIP())); bool form = eq(params.get('form), "1"); ret hhtml( hhead_title(url) + hbody_fullcenter( h1(htmlEncode2(url)) + p(pageAndNew.b ? "NEW!" : "seen before.") + hpostform( h3("Add an entry") + "Key: " + hinputfield(+key) + " Value: " + hinputfield(+value) + "

" + hsubmit("Add") ) + h3("Entries") + ul(map(entries, func(Entry e) -> S { htmlencode2(e.key) + ": " + b(htmlencode2(e.value)) })) )); }