$def with (doc, data={}, status=None) $putctx('cssfile', 'form') $putctx("show_ol_shell", False) $putctx('robots', 'noindex,nofollow') $if doc.type.key == "/type/author": $ intro = _("There are two ways to put an author's image on Open Library.") $ action = doc.url('/add-photo') $ guideline = _("Image Guidelines") $else: $ intro = _("There are a few ways to put a cover image on Open Library.") $ action = doc.url('/add-cover') $ guideline = _("Cover Guidelines")
$if status: $if status.code == 1: $_("Please provide a valid image.") $elif status.code == 2: $_("Please provide an image URL.") $elif status.code == 3: $_("Please provide a valid image.")
$intro $:_('Learn more by reading our %(guidelines)s.', guidelines=guideline)
$if doc.type.key == "/type/work": $if doc.get_edition_covers():
$#
$#
$# $#
$#
$# $# $#
$#
$if doc.type.key == "/type/edition" and doc.ocaid: $ img_url = "https://archive.org/services/img/%s/full/pct:600/0/default.jpg" % doc.ocaid
$:macros.LoadingIndicator(_("Uploading..."))