$def with (items, key, counts, lists=None, user=None, logged_in_user=None, public=False, sort_order='desc', owners_page=False) $# Displays a user's reading log $# :param list items: $# :param Literal['currently-reading', 'want-to-read', 'already-read', 'sponsorships', 'loans', 'waitlist', 'notes', 'observations'] key: $# :param Dict[str: int] counts: $# :param list? lists: $# :param user: $# :param bool public: $ username = user.key.split('/')[-1] $ current_page = int(input(page=1).page) $ total_items = counts.get(key, None) $ userDisplayName = user.displayname or ctx.user.displayname $ userKey = user.key or ctx.user.key $ header_title = unicode(render_template('account/readinglog_shelf_name', key)).strip() $ breadcrumb = _("Reading Log") $if not header_title: $if key == 'sponsorships': $ header_title = _("Sponsorships") $elif key == 'notes': $ header_title = _("Book Notes") $elif key == 'observations': $ header_title = _("Reviews") $elif key == 'loans': $ header_title = _("Books You've Checked Out") $elif key == 'waitlist': $ header_title = _("Books You're Waiting For") $elif key == 'imports': $ header_title = _("Imports and Exports") $elif key == 'lists': $ header_title = _('My Lists') $elif key == 'list': $ header_title = items.get('name', 'List') $else: $ header_title = key $ breadcrumb = header_title $var title: $header_title
$if owners_page: $if public or owners_page: $if owners_page and ctx.user and ctx.user.in_sponsorship_beta(): $if owners_page:

$if not owners_page: $userDisplayName » $header_title $else: $header_title

$if owners_page and key in ['currently-reading', 'already-read', 'want-to-read']: $_('Stats')
$if owners_page:

$if key == 'notes': $_('Your book notes are private and cannot be viewed by other patrons.') $elif key == 'observations': $_('Your book reviews will be shared anonymously with other patrons.') $elif key in ['currently-reading', 'already-read', 'want-to-read']: $if public: $_('Your reading log is currently set to public') or $else: $_('Your reading log is currently set to private') — $_('Manage your privacy settings')

$if key == 'list':
$:macros.databarView(items)
$if key == 'loans': $:render_template('account/loans', logged_in_user, items) $elif key == 'waitlist': $:render_template('account/waitlist', logged_in_user) $elif key == 'notes': $:render_template('account/notes', items, user, counts['notes'], page=current_page) $elif key == 'observations': $:render_template('account/observations', items, user, counts['observations'], page=current_page) $elif key == 'imports': $:render_template('account/import') $elif key == 'lists': $:render_template('lists/lists', items, lists, show_header=False) $elif key in {'currently-reading', 'want-to-read', 'already-read', 'sponsorships'}: $:render_template('account/reading_log', items, key, counts[key], owners_page, current_page, sort_order=sort_order, user=user) $else: $:render_template('type/list/view', items, check_owner=False, owns_page=True)