$def with(ocaid, analytics_attr, borrow=False, listen=False, loan=None, label='', printdisabled=False) $ stream_url = "/borrow/ia/%s?ref=ol" % ocaid $if printdisabled: $ action = "read" $ label = _("Special Access") $ title = _("Special ebook access from the Internet Archive for patrons with qualifying print disabilities") $ analytics_action = "PrintDisabled" $elif (borrow and not loan): $ action = "borrow" $ label = label or _("Borrow") $ title = _("Borrow ebook from Internet Archive") $ analytics_action = "Borrow" $else: $ action = "read" $ label = _("Read") $ title = _("Read ebook from Internet Archive") $ analytics_action = "Read"
$label $if listen: $_("Listen")