$def with (change) $def call_template(name, change): $ t = get_template("recentchanges/" + change.kind + "/" + name) or get_template("recentchanges/default/" + name) $:t(change) $ all_changes = change.get_changes() or [] $ page = safeint(query_param('page', '1')) $ pagesize = 50 $ pagecount = (len(all_changes)+pagesize-1)//pagesize $ offset = (page-1) * pagesize $ changes = all_changes[offset:offset+pagesize]
$_("When") | $_("What") | $_("Comment") |
---|---|---|
$datestr(change.timestamp) | $# show book title/author name instead of key $if thing.type.key == '/type/edition': $ name = thing.title or 'Title unknown' $elif thing.type.key == '/type/work': $ name = thing.title or 'Title unknown' $elif thing.type.key == '/type/author': $ name = thing.name or 'Author name unknown' $else: $ name = thing.key$:call_template("comment", change) |