$def with (work, edition, link_markup, id, class_list='') $# :param Work work: The work that is referenced by this modal $# :param Edition edition: The edition that is referenced by this modal $# :param str link_markup: Markup for element that triggers book notes modal $# :param str id: Unique identifier for this modal $# :param str class_list: HTML classes for this component $ username = ctx.user and ctx.user.key.split('/')[-1] $ notes = work.get_users_notes(username, edition.key.split('/')[-1]) $ work_key = work.key $if notes and len(notes.notes) > 0: $ display_delete_button = True $else: $ display_delete_button = False $ context = { $ "id": id $ }