Differences From
Artifact [31acbbce83]:
280 280 }
281 281
282 282 self:statpage(code, body)
283 283
284 284 body.title:free()
285 285 body.body:free()
286 286 end
287 +
288 +terra convo:confirm(title: pstring, msg: pstring, cancel: pstring)
289 + var conf = data.view.confirm {
290 + title = title;
291 + query = msg;
292 + cancel = cancel;
293 + }
294 + var ti: lib.str.acc ti:compose('confirm :: ', title)
295 + var body = conf:tostr() defer body:free()
296 + var cf = [convo.page] {
297 + title = ti:finalize();
298 + class = lib.str.plit 'query';
299 + body = body; cache = false;
300 + }
301 + self:stdpage(cf)
302 + cf.title:free()
303 +end
287 304
288 305 convo.methods.assertpow = macro(function(self, pow)
289 306 return quote
290 307 var ok = true
291 308 if self.aid == 0 or self.who.rights.powers.[pow:asvalue()]() == false then
292 309 ok = false
293 310 self:complain(403,'insufficient privileges',['you lack the <strong>'..pow:asvalue()..'</strong> power and cannot perform this action'])