mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-24 18:47:23 +00:00
Refactor edit_books.js for unused code; re-add glyphicon to convert button; Add form validation for convert button
This commit is contained in:
parent
4b006fba99
commit
22ecdfd2bc
@ -255,6 +255,3 @@ $("#btn-upload-cover").on("change", function () {
|
||||
$("#upload-cover").html(filename);
|
||||
});
|
||||
|
||||
$("#btn-book-convert").on("change", function () {
|
||||
alert("woot");
|
||||
});
|
||||
|
@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-primary" id="btn-book-covert" name="btn-book-covert">{{_('Convert book')}}</button>
|
||||
<button type="submit" class="btn btn-primary" id="btn-book-convert" name="btn-book-convert"><span class="glyphicon glyphicon-duplicate"></span> {{_('Convert book')}}</button>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -3191,6 +3191,7 @@ def edit_book(book_id):
|
||||
except Exception:
|
||||
app.logger.warning(file.format.lower() + ' already removed from list.')
|
||||
|
||||
app.logger.debug('Allowed conversion formats:')
|
||||
app.logger.debug(allowed_conversion_formats)
|
||||
|
||||
# Show form
|
||||
@ -3629,6 +3630,13 @@ def upload():
|
||||
@login_required_if_no_ano
|
||||
@edit_required
|
||||
def convert_bookformat(book_id):
|
||||
# check to see if we have form fields to work with - if not send user back
|
||||
book_format_from = request.form.get('book_format_from', None)
|
||||
book_format_to = request.form.get('book_format_to', None)
|
||||
|
||||
if (book_format_from is None) or (book_format_to is None):
|
||||
return redirect(request.environ["HTTP_REFERER"])
|
||||
|
||||
app.logger.debug('converting: book id: ' + str(book_id) +
|
||||
' from: ' + request.form['book_format_from'] +
|
||||
' to: ' + request.form['book_format_to'])
|
||||
|
Loading…
Reference in New Issue
Block a user