Merge with develop:

- No. of unread books correct calculated
- logviewer handles stream output correct
- Id for testablility in email server setup
This commit is contained in:
Ozzieisaacs 2020-01-13 18:37:29 +01:00
parent 1b42dd1043
commit 1d7e52c198
5 changed files with 18 additions and 13 deletions

4
.gitignore vendored
View File

@ -7,9 +7,11 @@ __pycache__/
# Distribution / packaging
.Python
env/
venv/
eggs/
dist/
build/
vendor/
.eggs/
*.egg-info/
.installed.cfg
@ -29,6 +31,4 @@ tags
settings.yaml
gdrive_credentials
vendor
client_secrets.json

View File

@ -17,7 +17,11 @@
// Upon loading load the logfile for the first option (event log)
$(function() {
init(0);
if ($("#log_group input").length)
{
var element = $("#log_group input[type='radio']:checked").val();
init(element);
}
});
// After change the radio option load the corresponding log file

View File

@ -89,7 +89,7 @@
<div class="modal-body text-center">
<p>{{_('Do you really want to delete this domain rule?')}}</p>
<button type="button" class="btn btn-danger" id="btndeletedomain" >{{_('Delete')}}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Back')}}</button>
<button type="button" class="btn btn-default" id="btncancel" data-dismiss="modal">{{_('Back')}}</button>
</div>
</div>
</div>

View File

@ -1,11 +1,15 @@
{% extends "layout.html" %}
{% block body %}
<div id="log_group" class="inputs">
{% if log_enable %}
<div><input type="radio" name="log_radio" id="log1" value="0" checked>
<label for="log0">{{_('Show Calibre-Web log')}}</label> {{logfiles[0]}}</div>
<label for="log1">{{_('Show Calibre-Web log: ')}}</label>{{logfiles[0]}}</div>
{% else %}
<div><label for="log1">{{_('Calibre-Web log: ')}}</label> {{_("Stream output, can't be displayed")}}</div>
{% endif %}
{% if accesslog_enable %}
<div><input type="radio" name="log_radio" id="log0" value="1">
<label for="log1">{{_('Show access log')}}</label> {{logfiles[1]}}</div>
<div><input type="radio" name="log_radio" id="log0" value="1" {% if not log_enable %}checked{% endif %}>
<label for="log0">{{_('Show access log: ')}}</label>{{logfiles[1]}}</div>
{% endif %}
</div>
<div id="renderer" class="log"></div>

View File

@ -811,9 +811,7 @@ def get_tasks_status():
@app.route("/reconnect")
def reconnect():
db.session.close()
db.engine.dispose()
db.setup_db(config)
db.reconnect_db(config)
return json.dumps({})
@web.route("/search", methods=["GET"])
@ -982,7 +980,7 @@ def advanced_search():
series=series, title=_(u"search"), cc=cc, page="advsearch")
def render_read_books(page, are_read, as_xml=False, order=None):
def render_read_books(page, are_read, as_xml=False, order=None, *args, **kwargs):
order = order or []
if not config.config_read_column:
readBooks = ub.session.query(ub.ReadBook).filter(ub.ReadBook.user_id == int(current_user.id))\
@ -1011,7 +1009,7 @@ def render_read_books(page, are_read, as_xml=False, order=None):
name = _(u'Read Books') + ' (' + str(len(readBookIds)) + ')'
pagename = "read"
else:
total_books = db.session.query(func.count(db.Books.id)).scalar()
total_books = db.session.query(func.count(db.Books.id)).filter(common_filters()).scalar()
name = _(u'Unread Books') + ' (' + str(total_books - len(readBookIds)) + ')'
pagename = "unread"
return render_title_template('index.html', random=random, entries=entries, pagination=pagination,
@ -1046,7 +1044,6 @@ def serve_book(book_id, book_format, anyname):
return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format)
# @web.route("/download/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
@web.route("/download/<int:book_id>/<book_format>")
@login_required_if_no_ano
@download_required