From 8a793eb063f51c3ba93c82f8851e4f5913cce542 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Jan 2018 14:11:57 +0530 Subject: [PATCH] Content server: Allow adding books by uploading book files to the server. Click the '+' icon in the top bar above the book list to add books --- src/pyj/book_list/views.pyj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index 332fdb278a..9f37cb7ec5 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -260,6 +260,7 @@ def create_books_list(container): show_top_message() apply_view_mode(get_session_data().get('view_mode')) create_more_button(container.lastChild) + add_button(container.parentNode, icon='plus', action=show_subsequent_panel.bind(None, 'book_list^add'), tooltip=_('Add books')) add_button(container.parentNode, icon='sort-amount-desc', action=show_subsequent_panel.bind(None, 'book_list^sort'), tooltip=_('Sort books')) add_button(container.parentNode, icon='search', action=show_subsequent_panel.bind(None, 'book_list^search'), tooltip=_('Search for books')) add_button(container.parentNode, icon='ellipsis-v', action=show_subsequent_panel.bind(None, 'book_list^more_actions'), tooltip=_('More actions')) @@ -452,19 +453,17 @@ def create_more_actions_panel(container_id): # }}} # Adding books {{{ -def add_books(container_id): +def create_add_panel(container_id): if not library_data.sortable_fields: show_panel('book_list', replace=True) return - if not get_interface_data().username: - error_dialog(_('Not logged in'), _('You must be logged in to add books')) - return add_books_panel(container_id) # }}} set_panel_handler('book_list', init) +set_panel_handler('book_list^add', create_add_panel) set_panel_handler('book_list^sort', create_sort_panel) set_panel_handler('book_list^vl', create_vl_panel) set_panel_handler('book_list^search', init_search_panel)