diff --git a/imgsrc/srv/convert.svg b/imgsrc/srv/convert.svg new file mode 100644 index 0000000000..7743225d17 --- /dev/null +++ b/imgsrc/srv/convert.svg @@ -0,0 +1 @@ + diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index 71ae183c93..7efc129943 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -470,6 +470,7 @@ def add_top_bar_buttons(container_id): container = document.getElementById(container_id) if container: clear_buttons(container) + add_button(container, 'convert', action=convert_book, tooltip=_('Convert this book to another format')) add_button(container, 'edit', action=edit_metadata, tooltip=_('Edit the metadata for this book')) add_button(container, 'trash', action=delete_book, tooltip=_('Delete this book')) book_id = parse_url_params().book_id @@ -600,6 +601,12 @@ def edit_metadata(): show_panel('edit_metadata', query=q, replace=False) +def convert_book(): + q = parse_url_params() + q.book_id = (read_book.book_id or q.book_id) + '' + show_panel('convert_book', query=q, replace=False) + + def create_more_actions_panel(container_id): container = document.getElementById(container_id) create_top_bar(container, title=_('More actions…'), action=back, icon='close')