$def with ()
$if "recentchanges_v2" in ctx.features:
$def call_template(name, change):
$ t = get_template("recentchanges/" + change.kind + "/" + name) or get_template("recentchanges/default/" + name)
$:t(change)
$ messages = get_random_recent_changes(4)
$for m in messages:
- $:m
$else:
$ changes = get_random_recent_changes(4)
$for v in changes:
$if v.author:
$ who = '%s' % (v.author.key, v.author.displayname or v.author.key)
$else:
$ who = None
$if v.thing.type.key == '/type/work':
$ what = v.thing.title or v.key
$elif v.thing.type.key == '/type/edition':
$ what = v.thing.get('title_prefix', '') + v.thing.get('title', '')
$if not what:
$ what = v.key
$elif v.thing.type.key == '/type/author':
$ what = v.thing.name or v.key
$else:
$ what = v.key
$ what = '%s' % (v.key, what)
$ when = datestr(v.created)
-
$if v.revision == 1:
$ action = "created"
$else:
$ action = "updated"
$if v.revision == 1 and v.author and v.author.key == v.key:
$:who $_('opened a new Open Library account!')
$elif who:
$:who $action $:what
$else:
$:what was $action anonymously
$when
- $_("Around the Library") →