$def with (page) $ h = None $if "superfast" in ctx.features and "history_v2" not in ctx.features: $ h = page.get_history_preview() $if not h: $ h = get_history(page) $ versions = h.recent + h.initial $ cur_v = query_param("v", None) $ show_wikipedia_citation_link = page.wp_citation_fields

$_("History")

$if page.key.startswith("/works") or page.key.startswith("/books") or page.key.startswith("/authors"): $if cur_v: $ hist_addition = "?v=" + cur_v $else: $ hist_addition = "" $ rdf = page.key + ".rdf" + hist_addition $ json = page.key + ".json" + hist_addition $ opds = page.key + ".opds" + hist_addition $_('Download catalog record:') RDF / JSON $if page.key.startswith("/books"): / OPDS $if show_wikipedia_citation_link: | $_('Wikipedia citation') $if show_wikipedia_citation_link:
$def render_row(v,): $for v in h.recent: $:render_row(v) $if h.initial: $for v in h.initial: $:render_row(v)
$datestr(v.created) $if v.author: $ author_link = v.author.render_link(cls="truncate") $elif v.ip and v.ip != "127.0.0.1": $ author_link = '%s' % (v.ip, _('an anonymous user'), v.ip) $else: $ author_link = '%s' % (_('an anonymous user')) $if v.revision == 1: $:_("Created by %(user)s", user=author_link) $else: $:_("Edited by %(user)s", user=author_link) $:render_template("history/comment", v)