Allow deleting books (fixes #119)
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
{% if book %}
|
||||
<div class="col-sm-3 col-lg-3 col-xs-12">
|
||||
<div class="cover">
|
||||
{% if book.has_cover %}
|
||||
<img src="{{ url_for('get_cover', cover_path=book.path.replace('\\','/')) }}" />
|
||||
{% else %}
|
||||
<img src="{{ url_for('static', filename='generic_cover.jpg') }}" />
|
||||
{% endif %}
|
||||
<form role="form" action="{{ url_for('edit_book', book_id=book.id) }}" method="post">
|
||||
|
||||
<div class="col-sm-3 col-lg-3 col-xs-12">
|
||||
<div class="cover">
|
||||
{% if book.has_cover %}
|
||||
<img src="{{ url_for('get_cover', cover_path=book.path.replace('\\','/')) }}" />
|
||||
{% else %}
|
||||
<img src="{{ url_for('static', filename='generic_cover.jpg') }}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if g.user.role_delete_books() %}
|
||||
<div class="text-center">
|
||||
<button type="button" class="btn btn-danger" id="delete" data-toggle="modal" data-target="#deleteModal">{{_("Delete Book")}}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<form role="form" action="{{ url_for('edit_book', book_id=book.id) }}" method="post">
|
||||
<div class="col-sm-9 col-xs-12">
|
||||
<div class="form-group">
|
||||
<label for="book_title">{{_('Book Title')}}</label>
|
||||
<input type="text" class="form-control" name="book_title" id="book_title" value="{{book.title}}">
|
||||
@@ -107,9 +113,31 @@
|
||||
<a href="#" id="get_meta" class="btn btn-default" data-toggle="modal" data-target="#metaModal">{{_('Get metadata')}}</a>
|
||||
<button type="submit" class="btn btn-default">{{_('Submit')}}</button>
|
||||
<a href="{{ url_for('show_book', book_id=book.id) }}" class="btn btn-default">{{_('Back')}}</a>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
{% if g.user.role_delete_books() %}
|
||||
<div class="modal fade" id="deleteModal" role="dialog" aria-labelledby="metaDeleteLabel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-danger text-center">
|
||||
<span>{{_('Are really you sure?')}}</span>
|
||||
</div>
|
||||
<div class="modal-body text-center" id="meta-info">
|
||||
<span>{{_('Book will be deleted from Calibre database')}}</span>
|
||||
<span>{{_('and from hard disk')}}</span>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a href="{{ url_for('delete_book', book_id=book.id) }}" class="btn btn-danger">{{_('Delete')}}</a>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Back')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="modal fade" id="metaModal" tabindex="-1" role="dialog" aria-labelledby="metaModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
Reference in New Issue
Block a user