diff --git a/cps/editbooks.py b/cps/editbooks.py
index abef41ce..14d311c6 100644
--- a/cps/editbooks.py
+++ b/cps/editbooks.py
@@ -887,3 +887,39 @@ def convert_bookformat(book_id):
else:
flash(_(u"There was an error converting this book: %(res)s", res=rtn), category="error")
return redirect(url_for('editbook.edit_book', book_id=book_id))
+
+@editbook.route("/ajax/editbooks/", methods=['POST'])
+@login_required_if_no_ano
+def edit_list_book(param):
+ vals = request.form.to_dict()
+ #calibre_db.update_title_sort(config)
+ #calibre_db.session.connection().connection.connection.create_function('uuid4', 0, lambda: str(uuid4()))
+ book = calibre_db.get_book(vals['pk'])
+ if param =='series_index':
+ edit_book_series_index(vals['value'], book)
+ elif param =='tags':
+ edit_book_tags(vals['value'], book)
+ elif param =='series':
+ edit_book_series(vals['value'], book)
+ elif param =='publishers':
+ edit_book_publisher(vals['value'], book)
+ # ToDo: edit books
+ elif param =='languages':
+ edit_book_languages(vals['value'], book)
+ elif param =='title':
+ edit_book_languages(vals['value'], book)
+ elif param =='sort':
+ edit_book_languages(vals['value'], book)
+ elif param =='author_sort':
+ edit_book_languages(vals['value'], book)
+ elif param =='authors':
+ edit_book_languages(vals['value'], book)
+
+ book.last_modified = datetime.utcnow()
+ calibre_db.session.commit()
+ return ""
+
+@editbook.route("/ajax/deletebooks")
+@login_required_if_no_ano
+def delete_list_book():
+ pass
diff --git a/cps/templates/book_table.html b/cps/templates/book_table.html
index fcede828..e8150e16 100644
--- a/cps/templates/book_table.html
+++ b/cps/templates/book_table.html
@@ -1,4 +1,8 @@
{% extends "layout.html" %}
+{% macro text_table_row(parameter, edit_text, show_text) -%}
+
{{ show_text }} |
+{%- endmacro %}
+
{% block header %}
@@ -21,25 +25,25 @@
data-search-on-enter-key="true"
data-checkbox-header="false"
data-maintain-meta-data="true"
+ data-response-handler="responseHandler"
data-editable-emptytext="">
-
{% if g.user.role_edit() %}
- |
+ |
{% endif %}
|
- Title |
- Sort |
- Authors Sort |
- Authors |
- Tags |
- Series |
- Series Index |
- Language |
+ {{ text_table_row('title', _('Enter Title'),_('Title')) }}
+ {{ text_table_row('sort', _('Enter Titlesort'),_('Sort')) }}
+ {{ text_table_row('author_sort', _('Enter Authorsort'),_('Authors Sort')) }}
+ {{ text_table_row('authors', _('Enter Authors'),_('Authors')) }}
+ {{ text_table_row('tags', _('Enter Tags'),_('Tags')) }}
+ {{ text_table_row('series', _('Enter Series'),_('Series')) }}
+ {{_('Series Index')}} |
+ {{ text_table_row('languages', _('Enter Languages'),_('Languages')) }}
Publishing Date |
- Publishers |
+ {{ text_table_row('publishers', _('Enter Publishers'),_('Publishers')) }}
{% if g.user.role_edit() %}
|
{% endif %}
@@ -55,4 +59,33 @@
+
{% endblock %}
diff --git a/cps/templates/layout.html b/cps/templates/layout.html
index 866d11e7..8252bf4c 100644
--- a/cps/templates/layout.html
+++ b/cps/templates/layout.html
@@ -173,6 +173,7 @@
{% endif %}
+
diff --git a/cps/web.py b/cps/web.py
index d4e5d7c2..bf6e25da 100644
--- a/cps/web.py
+++ b/cps/web.py
@@ -77,11 +77,6 @@ try:
except ImportError:
pass # We're not using Python 3
-#try:
-# import rarfile
-# feature_support['rar'] = True
-#except ImportError:
-# feature_support['rar'] = False
try:
from natsort import natsorted as sort
@@ -862,15 +857,6 @@ def list_books():
response.headers["Content-Type"] = "application/json; charset=utf-8"
return response
-@web.route("/ajax/editbooks")
-@login_required_if_no_ano
-def edit_list_book():
- pass
-
-@web.route("/ajax/editbooks")
-@login_required_if_no_ano
-def delete_list_book():
- pass
@web.route("/author")
@login_required_if_no_ano