show 'better author and tags editing; partly copied from https://bitbucket.org/SpeedProg/calibreserver

This commit is contained in:
Cervinko Cera
2016-04-15 23:35:18 +02:00
parent 1d295eb954
commit a9801371b6
8 changed files with 152 additions and 683 deletions
+9 -26
View File
@@ -1,26 +1,6 @@
{% extends "layout.html" %}
{% block body %}
{% if book %}
<script type="text/javascript">
$(document).ready(function(){
$('input.typeahead').typeahead({
name: 'accounts',
source: function (query, process) {
$.ajax({
url: '{{ url_for('get_authors_json') }} ',
type: 'POST',
dataType: 'JSON',
data: 'query=' + query,
success: function(data) {
console.log(data);
process(data);
}
});
}
});
});
</script>
<div class="col-sm-3 col-lg-3 col-xs-12">
<div class="cover">
{% if book.has_cover is defined %}
@@ -36,12 +16,7 @@ $(document).ready(function(){
</div>
<div class="form-group">
<label for="bookAuthor">Author</label>
{% if book.authors|length > 1 %}
{% for author in book.authors %}
<p>{{author.name.join(" & ")}}</p>
{% endfor %}
{% endif %}
<input type="text" data-provide="typeahead" class="form-control typeahead" name="author_name" id="bookAuthor" autocomplete="off" value="{{book.authors[0].name}}">
<input type="text" class="form-control typeahead" name="author_name" id="bookAuthor" value="{{' & '.join(authors)}}" autocomplete="off">
</div>
<div class="form-group">
<label for="description">Description</label>
@@ -78,3 +53,11 @@ $(document).ready(function(){
</div>
{% endif %}
{% endblock %}
{% block js %}
<script src="{{ url_for('static', filename='js/typeahead.bundle.js') }}"></script>
<script src="{{ url_for('static', filename='js/edit_books.js') }}"></script>
{% endblock %}
{% block header %}
<link href="{{ url_for('static', filename='css/typeahead.css') }}" rel="stylesheet" media="screen">
{% endblock %}