$def with(user_lists, seed_key, work_key, edition_key, users_work_read_status, async_load=False) $def reading_log_selections(work_key, edition_key, users_work_read_status): $ remove_btn_visibility = 'hidden' if not users_work_read_status else '' $ btn_visibilities = [remove_btn_visibility, '', '', ''] $ read_status = users_work_read_status or 1 $ btn_visibilities[int(read_status)] = 'hidden'
$if edition_key:
$if edition_key:
$if edition_key:
$if edition_key:
$def list_selections(user_lists, work_key, edition_key, async_load): $# Render list forms: $ user_key = ctx.user and ctx.user.key

$_('My Reading Lists:')

$if async_load: $if ctx.user: $# XXX : Change edition key to seed key for author pages $ ed_attr = 'data-edition-key=%s' % edition_key if edition_key else '' $ work_attr = 'data-work-key=%s' % work_key if work_key else ''
$_("Loading")...
$else: $:render_template('lists/dropper_lists', user_lists)
$if edition_key:

$_('Create a new list')

$def new_list_modal_content(): $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 work_key: $:reading_log_selections(work_key, edition_key, users_work_read_status) $:list_selections(user_lists, work_key, edition_key, async_load) $if render_once('my_books/dropdown_content.new_list_modal'): $:new_list_modal_content() $# Change render_once key once this code is removed from lists/widget $if render_once('lists/widget.i18n-strings'): $:i18n_input()