2017-01-22 07:44:37 -08:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="discover">
|
2017-02-10 11:18:37 -08:00
|
|
|
<h2>{{title}}</h2>
|
2017-01-22 07:44:37 -08:00
|
|
|
<form role="form" method="POST" autocomplete="off">
|
2018-07-15 06:08:06 -07:00
|
|
|
<div class="panel-group">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
2018-08-18 03:15:32 -07:00
|
|
|
<a class="accordion-toggle" data-toggle="collapse" href="#collapseOne">
|
2018-07-15 06:08:06 -07:00
|
|
|
<span class="glyphicon glyphicon-minus"></span>
|
|
|
|
{{_('Library Configuration')}}
|
2018-08-16 12:17:26 -07:00
|
|
|
</a>
|
2018-07-15 06:08:06 -07:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div id="collapseOne" class="panel-collapse collapse in">
|
|
|
|
<div class="panel-body">
|
2017-01-22 07:44:37 -08:00
|
|
|
<div class="form-group required">
|
|
|
|
<label for="config_calibre_dir">{{_('Location of Calibre database')}}</label>
|
|
|
|
<input type="text" class="form-control" name="config_calibre_dir" id="config_calibre_dir" value="{% if content.config_calibre_dir != None %}{{ content.config_calibre_dir }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
2017-02-20 10:34:37 -08:00
|
|
|
<div class="form-group required">
|
2017-07-23 05:03:02 -07:00
|
|
|
<input type="checkbox" id="config_use_google_drive" name="config_use_google_drive" data-control="gdrive_settings" {% if content.config_use_google_drive %}checked{% endif %} >
|
2018-07-15 06:08:06 -07:00
|
|
|
<label for="config_use_google_drive">{{_('Use Google Drive?')}}</label>
|
2017-02-20 10:34:37 -08:00
|
|
|
</div>
|
2017-07-23 05:03:02 -07:00
|
|
|
<div data-related="gdrive_settings">
|
2018-06-02 01:59:34 -07:00
|
|
|
{% if gdriveError %}
|
|
|
|
<div class="form-group">
|
|
|
|
<label>
|
2018-07-15 06:08:06 -07:00
|
|
|
{{_('Google Drive config problem')}}: {{ gdriveError }}
|
2018-06-02 01:59:34 -07:00
|
|
|
</label>
|
2017-02-20 10:34:37 -08:00
|
|
|
</div>
|
|
|
|
{% else %}
|
2018-08-16 12:17:26 -07:00
|
|
|
{% if show_authenticate_google_drive and g.user.is_authenticated %}
|
2018-06-02 01:59:34 -07:00
|
|
|
<div class="form-group required">
|
|
|
|
<a href="{{ url_for('authenticate_google_drive') }}" class="btn btn-primary">{{_('Authenticate Google Drive')}}</a>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
2018-08-16 12:17:26 -07:00
|
|
|
{% if show_authenticate_google_drive and not g.user.is_authenticated %}
|
|
|
|
<div >{{_('Please finish Google Drive setup after login')}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if not show_authenticate_google_drive %}
|
2018-06-02 01:59:34 -07:00
|
|
|
<div class="form-group required">
|
2018-07-15 06:08:06 -07:00
|
|
|
<label for="config_google_drive_folder">{{_('Google Drive Calibre folder')}}</label>
|
2018-06-02 01:59:34 -07:00
|
|
|
<select name="config_google_drive_folder" id="config_google_drive_folder" class="form-control">
|
|
|
|
{% for gdrivefolder in gdrivefolders %}
|
|
|
|
<option value="{{ gdrivefolder.title }}" {% if gdrivefolder.title == content.config_google_drive_folder %}selected{% endif %}>{{ gdrivefolder.title }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
{% if content.config_google_drive_watch_changes_response %}
|
|
|
|
<label for="config_google_drive_watch_changes_response">{{_('Metadata Watch Channel ID')}}</label>
|
|
|
|
<div class="form-group input-group required">
|
|
|
|
<input type="text" class="form-control" name="config_google_drive_watch_changes_response" id="config_google_drive_watch_changes_response" value="{{ content.config_google_drive_watch_changes_response['id'] }} expires on {{ content.config_google_drive_watch_changes_response['expiration'] | strftime }}" autocomplete="off" disabled="">
|
|
|
|
<span class="input-group-btn"><a href="{{ url_for('revoke_watch_gdrive') }}" class="btn btn-primary">{{_('Revoke')}}</a></span>
|
|
|
|
</div>
|
2017-02-20 10:34:37 -08:00
|
|
|
{% else %}
|
2018-06-02 01:59:34 -07:00
|
|
|
<a href="{{ url_for('watch_gdrive') }}" class="btn btn-primary">Enable watch of metadata.db</a>
|
2017-02-20 10:34:37 -08:00
|
|
|
{% endif %}
|
2018-08-16 12:17:26 -07:00
|
|
|
{% endif %}
|
2017-02-20 10:34:37 -08:00
|
|
|
{% endif %}
|
2018-06-02 01:59:34 -07:00
|
|
|
{% endif %}
|
2017-02-20 10:34:37 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
2017-01-22 07:44:37 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
2018-08-16 12:17:26 -07:00
|
|
|
|
2018-07-15 06:08:06 -07:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
2018-08-18 03:15:32 -07:00
|
|
|
<a class="accordion-toggle" data-toggle="collapse" href="#collapsetwo">
|
2018-07-15 06:08:06 -07:00
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
{{_('Server Configuration')}}
|
2018-08-16 12:17:26 -07:00
|
|
|
</a>
|
2018-07-15 06:08:06 -07:00
|
|
|
</h4>
|
2017-02-28 15:53:32 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
<div id="collapsetwo" class="panel-collapse collapse">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_port">{{_('Server Port')}}</label>
|
|
|
|
<input type="number" min="1" max="65535" class="form-control" name="config_port" id="config_port" value="{% if content.config_port != None %}{{ content.config_port }}{% endif %}" autocomplete="off" required>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_certfile">{{_('SSL certfile location (leave it empty for non-SSL Servers)')}}</label>
|
|
|
|
<input type="text" class="form-control" name="config_certfile" id="config_certfile" value="{% if content.config_certfile != None %}{{ content.config_certfile }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_keyfile">{{_('SSL Keyfile location (leave it empty for non-SSL Servers)')}}</label>
|
|
|
|
<input type="text" class="form-control" name="config_keyfile" id="config_keyfile" value="{% if content.config_keyfile != None %}{{ content.config_keyfile }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-01-22 07:44:37 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
2018-08-18 03:15:32 -07:00
|
|
|
<a class="accordion-toggle" data-toggle="collapse" href="#collapsethree">
|
2018-07-15 06:08:06 -07:00
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
{{_('Logfile Configuration')}}
|
2018-08-16 12:17:26 -07:00
|
|
|
</a>
|
2018-07-15 06:08:06 -07:00
|
|
|
</h4>
|
2017-08-08 09:52:00 -07:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
<div id="collapsethree" class="panel-collapse collapse">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_log_level">{{_('Log Level')}}</label>
|
|
|
|
<select name="config_log_level" id="config_log_level" class="form-control">
|
|
|
|
<option value="10" {% if content.config_log_level == 10 %}selected{% endif %}>DEBUG</option>
|
|
|
|
<option value="20" {% if content.config_log_level == 20 or content.config_log_level == None %}selected{% endif %}>INFO</option>
|
|
|
|
<option value="30" {% if content.config_log_level == 30 %}selected{% endif %}>WARNING</option>
|
|
|
|
<option value="40" {% if content.config_log_level == 40 %}selected{% endif %}>ERROR</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_logfile">{{_('Location and name of logfile (calibre-web.log for no entry)')}}</label>
|
|
|
|
<input type="text" class="form-control" name="config_logfile" id="config_logfile" value="{% if content.config_logfile != None %}{{ content.config_logfile }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-01-22 07:44:37 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
2018-08-16 12:17:26 -07:00
|
|
|
<a class="accordion-toggle" data-toggle="collapse" href="#collapsefive">
|
2018-07-15 06:08:06 -07:00
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
{{_('Feature Configuration')}}
|
2018-08-16 12:17:26 -07:00
|
|
|
</a>
|
2018-07-15 06:08:06 -07:00
|
|
|
</h4>
|
2017-12-02 02:15:51 -08:00
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
<div id="collapsefive" class="panel-collapse collapse">
|
|
|
|
<div class="panel-body">
|
2017-01-22 07:44:37 -08:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" id="config_uploading" name="config_uploading" {% if content.config_uploading %}checked{% endif %}>
|
|
|
|
<label for="config_uploading">{{_('Enable uploading')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" id="config_anonbrowse" name="config_anonbrowse" {% if content.config_anonbrowse %}checked{% endif %}>
|
|
|
|
<label for="config_anonbrowse">{{_('Enable anonymous browsing')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" id="config_public_reg" name="config_public_reg" {% if content.config_public_reg %}checked{% endif %}>
|
|
|
|
<label for="config_public_reg">{{_('Enable public registration')}}</label>
|
2017-01-28 11:16:40 -08:00
|
|
|
</div>
|
2017-07-07 18:18:03 -07:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" id="config_remote_login" name="config_remote_login" {% if content.config_remote_login %}checked{% endif %}>
|
|
|
|
<label for="config_remote_login">{{_('Enable remote login ("magic link")')}}</label>
|
|
|
|
</div>
|
2017-07-08 16:05:20 -07:00
|
|
|
{% if goodreads %}
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" id="config_use_goodreads" name="config_use_goodreads" data-control="goodreads-settings" {% if content.config_use_goodreads %}checked{% endif %}>
|
|
|
|
<label for="config_use_goodreads">{{_('Use')}} Goodreads</label>
|
|
|
|
<a href="https://www.goodreads.com/api/keys" target="_blank" style="margin-left: 5px">{{_('Obtain an API Key')}}</a>
|
|
|
|
</div>
|
|
|
|
<div data-related="goodreads-settings">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_goodreads_api_key">{{_('Goodreads API Key')}}</label>
|
|
|
|
<input type="text" class="form-control" id="config_goodreads_api_key" name="config_goodreads_api_key" value="{% if content.config_goodreads_api_key != None %}{{ content.config_goodreads_api_key }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_goodreads_api_secret">{{_('Goodreads API Secret')}}</label>
|
|
|
|
<input type="text" class="form-control" id="config_goodreads_api_secret" name="config_goodreads_api_secret" value="{% if content.config_goodreads_api_secret != None %}{{ content.config_goodreads_api_secret }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2017-11-30 11:12:13 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
2018-07-18 11:21:44 -07:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h4 class="panel-title">
|
2018-08-18 03:15:32 -07:00
|
|
|
<a class="accordion-toggle" data-toggle="collapse" href="#collapseeight">
|
2018-07-18 11:21:44 -07:00
|
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
{{_('E-Book converter')}}
|
2018-08-16 12:17:26 -07:00
|
|
|
</a>
|
2018-07-18 11:21:44 -07:00
|
|
|
</h4>
|
|
|
|
</div>
|
|
|
|
<div id="collapseeight" class="panel-collapse collapse">
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="form-group">
|
|
|
|
<div><input type="radio" name="config_ebookconverter" id="converter0" value="0" {% if content.config_ebookconverter == 0 %}checked{% endif %}>
|
|
|
|
<label for="converter0">{{_('No converter')}}</label></div>
|
|
|
|
<div><label><input type="radio" name="config_ebookconverter" id="converter1" value="1" {% if content.config_ebookconverter == 1 %}checked{% endif %}>
|
|
|
|
<label for="converter1">{{_('Use Kindlegen')}}</label></div>
|
|
|
|
<div><label><input type="radio" name="config_ebookconverter" id="converter2" value="2" {% if content.config_ebookconverter == 2 %}checked{% endif %}>
|
|
|
|
<label for="converter2">{{_('Use calibre\'s ebook converter')}}</label></div>
|
|
|
|
</div>
|
|
|
|
<div data-related="calibre">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_calibre">{{_('E-Book converter settings')}}</label>
|
|
|
|
<input type="text" class="form-control" id="config_calibre" name="config_calibre" value="{% if content.config_calibre != None %}{{ content.config_calibre }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="config_calibre">{{_('Path to convertertool')}}</label>
|
|
|
|
<input type="text" class="form-control" id="config_converterpath" name="config_converterpath" value="{% if content.config_converterpath != None %}{{ content.config_converterpath }}{% endif %}" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-15 06:08:06 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2017-11-30 11:12:13 -08:00
|
|
|
<div class="col-sm-12">
|
2017-01-22 07:44:37 -08:00
|
|
|
<button type="submit" class="btn btn-default">{{_('Submit')}}</button>
|
2017-01-28 11:16:40 -08:00
|
|
|
{% if not origin %}
|
|
|
|
<a href="{{ url_for('admin') }}" class="btn btn-default">{{_('Back')}}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% if success %}
|
|
|
|
<a href="{{ url_for('login') }}" class="btn btn-default">{{_('Login')}}</a>
|
|
|
|
{% endif %}
|
2017-11-30 11:12:13 -08:00
|
|
|
</div>
|
2017-01-22 07:44:37 -08:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
2017-02-20 10:34:37 -08:00
|
|
|
{% block js %}
|
2017-07-23 05:03:02 -07:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).on('change', '#config_use_google_drive', function() {
|
|
|
|
$('#config_google_drive_folder').prop('required', $(this).prop('checked'));
|
2017-02-20 10:34:37 -08:00
|
|
|
});
|
2018-07-15 06:08:06 -07:00
|
|
|
$('.collapse').on('shown.bs.collapse', function(){
|
|
|
|
$(this).parent().find(".glyphicon-plus").removeClass("glyphicon-plus").addClass("glyphicon-minus");
|
|
|
|
}).on('hidden.bs.collapse', function(){
|
|
|
|
$(this).parent().find(".glyphicon-minus").removeClass("glyphicon-minus").addClass("glyphicon-plus");
|
|
|
|
});
|
2017-02-20 10:34:37 -08:00
|
|
|
</script>
|
|
|
|
{% endblock %}
|