$def with (page, include_rating=True, include_header=True, include_widget=True, include_showcase=True, read_status=None, exclude_own_lists=False, async_load=False) $ edition = page if page.key.startswith("/books/") else None $ work = (page.works and page.works[0]) if page.key.startswith("/books/") else page if page.key.startswith("/works/") else None $ username = ctx.user and ctx.user.key.split('/')[-1] $ users_work_read_status = read_status or work.get_users_read_status(username) if work and username else None
$if "lists" not in ctx.features: $return $code: def get_page_lists(page, seed_info): return [get_list_data(list, seed_info['seed']) for list in page.get_lists(sort=False)] $ seed_info = get_seed_info(page) $ user_lists = [] if async_load or not ctx.user else get_user_lists(seed_info) $ page_lists = get_page_lists(page, seed_info) $ user_key = ctx.user and ctx.user.key $ page_url = page.url() $var page_lists = page_lists $def render_already_lists(lists, user_key): $for list in lists: $if list['active']: $:render_template('lists/list_overview', list, user_key, seed_info) $def render_widget_display(lists, limit, user_key, exclude_own_lists): $ count = 0 $for i, list in enumerate(lists): $if count < limit: $if exclude_own_lists: $if user_key != list.owner.key: $:render_template('lists/list_overview', list, user_key, seed_info) $ count = count + 1 $else: $:render_template('lists/list_overview', list, user_key, seed_info) $ count = count + 1 $def render_head(seed_type, page_lists, page_url): $if seed_type == "subject":

Lists

$_('watch for edits or export all records')
$else:

$if len(page_lists) > 0: $ msg = ungettext("%(count)d List", "%(count)d Lists", len(page_lists), count=len(page_lists)) $(msg) $else: $_("Lists")

$if include_header:
$:render_head(seed_info['type'], page_lists, page_url)
$ default_seed_key = seed_info['seed']['key'] if isinstance(seed_info['seed'], dict) else seed_info['seed'] $def i18n_input(): $ show_list_i18n_strings = { $ "cover_of": _('Cover of: %(title)s', title=''), $ "see_this_list": _('See this list'), $ "remove_from_list": _('Remove from your list?'), $ "from": _('from'), $ "you": _('You') $ } $if include_widget: $if render_once('lists/widget.i18n-strings'): $:i18n_input() $:macros.ReadingLogDropper(user_lists, work=work, edition=edition, key=default_seed_key, users_work_read_status=users_work_read_status, page_url=page_url, async_load=async_load) $if work and include_rating: $:macros.StarRatings(work, edition) $if include_showcase: $if render_once('lists/widget.i18n-strings'): $i18n_input() $if render_once('lists/widget.remove-dialog'):