2015-08-02 20:59:11 +02:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="discover">
|
|
|
|
<h1>{{title}}</h1>
|
2016-06-17 20:01:44 +02:00
|
|
|
<form role="form" method="POST" autocomplete="off">
|
2019-11-16 08:01:18 +01:00
|
|
|
{% if new_user or ( g.user and content.nickname != "Guest" and g.user.role_admin() ) %}
|
2015-10-13 18:07:17 +02:00
|
|
|
<div class="form-group required">
|
2016-11-09 19:24:33 +01:00
|
|
|
<label for="nickname">{{_('Username')}}</label>
|
2016-06-17 20:01:44 +02:00
|
|
|
<input type="text" class="form-control" name="nickname" id="nickname" value="{{ content.nickname if content.nickname != None }}" autocomplete="off">
|
2015-10-13 18:07:17 +02:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-08-02 20:59:11 +02:00
|
|
|
<div class="form-group">
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="email">{{_('E-mail Address')}}</label>
|
2017-11-12 13:40:56 +01:00
|
|
|
<input type="email" class="form-control" name="email" id="email" value="{{ content.email if content.email != None }}" autocomplete="off">
|
2015-08-02 20:59:11 +02:00
|
|
|
</div>
|
2017-01-12 20:43:36 +01:00
|
|
|
{% if ( g.user and g.user.role_passwd() or g.user.role_admin() ) and not content.role_anonymous() %}
|
2020-01-02 16:09:06 +01:00
|
|
|
{% if g.user and g.user.role_admin() and not new_user and not profile and ( mail_configured and content.email if content.email != None ) %}
|
2019-12-30 15:15:07 +01:00
|
|
|
<div class="btn btn-default" id="resend_password"><a href="{{url_for('admin.reset_user_password', user_id = content.id) }}">{{_('Reset user Password')}}</a></div>
|
|
|
|
{% endif %}
|
2018-08-24 15:48:09 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="password">{{_('Password')}}</label>
|
|
|
|
<input type="password" class="form-control" name="password" id="password" value="" autocomplete="off">
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-08-02 20:59:11 +02:00
|
|
|
<div class="form-group">
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="kindle_mail">{{_('Send to Kindle E-mail Address')}}</label>
|
2016-08-08 21:01:38 +02:00
|
|
|
<input type="email" class="form-control" name="kindle_mail" id="kindle_mail" value="{{ content.kindle_mail if content.kindle_mail != None }}">
|
2015-08-02 20:59:11 +02:00
|
|
|
</div>
|
2020-01-14 18:21:31 +01:00
|
|
|
{% if not content.role_anonymous() %}
|
2016-11-09 19:24:33 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="locale">{{_('Language')}}</label>
|
|
|
|
<select name="locale" id="locale" class="form-control">
|
|
|
|
{% for translation in translations %}
|
2020-01-05 08:43:00 +01:00
|
|
|
<option value="{{translation}}" {% if translation|string == content.locale %}selected{% endif %} {% if new_user == 1 and loop.first %}selected{% endif %}>{{ translation.display_name|capitalize }}</option>
|
2016-11-09 19:24:33 +01:00
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2020-01-14 18:21:31 +01:00
|
|
|
{% endif %}
|
2019-07-13 20:45:48 +02:00
|
|
|
|
2016-11-09 19:24:33 +01:00
|
|
|
<div class="form-group">
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="default_language">{{_('Language of Books')}}</label>
|
2016-11-09 19:24:33 +01:00
|
|
|
<select name="default_language" id="default_language" class="form-control">
|
2020-02-03 04:22:00 +01:00
|
|
|
<option value="all" {% if new_user == 1 %}selected{% endif %}>{{ _('Show All') }}</option>
|
2016-11-09 19:24:33 +01:00
|
|
|
{% for language in languages %}
|
|
|
|
<option value="{{ language.lang_code }}" {% if content.default_language == language.lang_code %}selected{% endif %}>{{ language.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2019-07-13 20:45:48 +02:00
|
|
|
{% if registered_oauth.keys()| length > 0 %}
|
2019-07-21 08:10:23 +02:00
|
|
|
{% for id, name in registered_oauth.items() %}
|
2019-07-13 20:45:48 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label>{{ name }} {{_('OAuth Settings')}}</label>
|
2019-07-21 08:10:23 +02:00
|
|
|
{% if id not in oauth_status %}
|
|
|
|
<div><a href="{{ url_for('oauth.'+ name +'_login') }}" id="config_{{ id }}_oauth" class="btn btn-primary">{{_('Link')}}</a></div>
|
2019-07-13 20:45:48 +02:00
|
|
|
{% else %}
|
2019-07-21 08:10:23 +02:00
|
|
|
<div><a href="{{ url_for('oauth.'+ name +'_login_unlink') }}" id="config_{{ id }}_oauth" class="btn btn-primary">{{_('Unlink')}}</a></div>
|
2019-07-13 20:45:48 +02:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2020-01-27 20:32:37 +01:00
|
|
|
{% if kobo_support and not new_user %}
|
2020-01-11 19:10:39 +01:00
|
|
|
<label>{{ _('Kobo Sync Token')}}</label>
|
|
|
|
<div class="form-group col">
|
|
|
|
<a class="btn btn-default" id="config_create_kobo_token" data-toggle="modal" data-target="#modal_kobo_token" data-remote="false" href="{{ url_for('kobo_auth.generate_auth_token', user_id=content.id) }}">{{_('Create/View')}}</a>
|
|
|
|
<div class="btn btn-danger" id="config_delete_kobo_token" data-toggle="modal" data-target="#modalDeleteToken" data-remote="false" {% if not content.remote_auth_token.first() %} style="display: none;" {% endif %}>{{_('Delete')}}</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2017-08-08 18:52:00 +02:00
|
|
|
<div class="col-sm-6">
|
2019-07-13 20:45:48 +02:00
|
|
|
{% for element in sidebar %}
|
|
|
|
{% if element['config_show'] %}
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="show_{{element['visibility']}}" id="show_{{element['visibility']}}" {% if content.check_visibility(element['visibility']) %}checked{% endif %}>
|
|
|
|
<label for="show_{{element['visibility']}}">{{element['show_text']}}</label>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2017-08-08 18:52:00 +02:00
|
|
|
<div class="form-group">
|
2019-07-13 20:45:48 +02:00
|
|
|
<input type="checkbox" name="Show_detail_random" id="Show_detail_random" {% if content.show_detail_random() %}checked{% endif %}>
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="Show_detail_random">{{_('Show Random Books')}}</label>
|
2017-08-08 18:52:00 +02:00
|
|
|
</div>
|
2020-02-15 16:02:31 +01:00
|
|
|
{% if ( g.user and g.user.role_admin() and not new_user ) %}
|
2020-01-05 16:43:48 +01:00
|
|
|
<a href="#" id="get_user_tags" class="btn btn-default" data-toggle="modal" data-target="#restrictModal">{{_('Add allowed/denied Tags')}}</a>
|
|
|
|
<a href="#" id="get_user_column_values" class="btn btn-default" data-toggle="modal" data-target="#restrictModal">{{_('Add allowed/denied custom column values')}}</a>
|
|
|
|
{% endif %}
|
2017-01-28 20:16:40 +01:00
|
|
|
</div>
|
2017-02-25 13:28:57 +01:00
|
|
|
<div class="col-sm-6">
|
2016-12-23 09:53:39 +01:00
|
|
|
{% if g.user and g.user.role_admin() and not profile %}
|
2017-01-12 20:43:36 +01:00
|
|
|
{% if not content.role_anonymous() %}
|
2016-11-09 19:24:33 +01:00
|
|
|
<div class="form-group">
|
2016-04-27 10:35:23 +02:00
|
|
|
<input type="checkbox" name="admin_role" id="admin_role" {% if content.role_admin() %}checked{% endif %}>
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="admin_role">{{_('Admin User')}}</label>
|
2018-02-04 07:21:08 +01:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2016-04-27 10:35:23 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="download_role" id="download_role" {% if content.role_download() %}checked{% endif %}>
|
2016-11-09 19:24:33 +01:00
|
|
|
<label for="download_role">{{_('Allow Downloads')}}</label>
|
2016-04-27 10:35:23 +02:00
|
|
|
</div>
|
2019-07-13 20:45:48 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="viewer_role" id="viewer_role" {% if content.role_viewer() %}checked{% endif %}>
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="viewer_role">{{_('Allow eBook Viewer')}}</label>
|
2019-07-13 20:45:48 +02:00
|
|
|
</div>
|
2016-04-27 10:35:23 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="upload_role" id="upload_role" {% if content.role_upload() %}checked{% endif %}>
|
2016-11-09 19:24:33 +01:00
|
|
|
<label for="upload_role">{{_('Allow Uploads')}}</label>
|
2016-04-27 10:35:23 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="edit_role" id="edit_role" {% if content.role_edit() %}checked{% endif %}>
|
2016-11-09 19:24:33 +01:00
|
|
|
<label for="edit_role">{{_('Allow Edit')}}</label>
|
2017-04-14 20:29:11 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="delete_role" id="delete_role" {% if content.role_delete_books() %}checked{% endif %}>
|
2020-02-03 04:22:00 +01:00
|
|
|
<label for="delete_role">{{_('Allow Delete Books')}}</label>
|
2015-08-02 20:59:11 +02:00
|
|
|
</div>
|
2017-01-12 20:43:36 +01:00
|
|
|
{% if not content.role_anonymous() %}
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="passwd_role" id="passwd_role" {% if content.role_passwd() %}checked{% endif %}>
|
|
|
|
<label for="passwd_role">{{_('Allow Changing Password')}}</label>
|
|
|
|
</div>
|
2017-03-19 20:29:35 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="edit_shelf_role" id="edit_shelf_role" {% if content.role_edit_shelfs() %}checked{% endif %}>
|
2017-07-10 19:26:57 +02:00
|
|
|
<label for="edit_shelf_role">{{_('Allow Editing Public Shelfs')}}</label>
|
2017-03-19 20:29:35 +01:00
|
|
|
</div>
|
2017-01-12 20:43:36 +01:00
|
|
|
{% endif %}
|
2015-10-13 18:07:17 +02:00
|
|
|
{% endif %}
|
2017-01-12 20:43:36 +01:00
|
|
|
{% if g.user and g.user.role_admin() and not profile and not new_user and not content.role_anonymous() %}
|
|
|
|
<div class="checkbox">
|
|
|
|
<label>
|
2020-02-03 04:22:00 +01:00
|
|
|
<input type="checkbox" id="delete" name="delete"> {{_('Delete User')}}
|
2017-01-12 20:43:36 +01:00
|
|
|
</label>
|
|
|
|
</div>
|
2015-08-02 20:59:11 +02:00
|
|
|
{% endif %}
|
2017-02-25 13:28:57 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-sm-12">
|
2020-02-03 04:22:00 +01:00
|
|
|
<button type="submit" id="submit" class="btn btn-default">{{_('Save')}}</button>
|
2016-11-12 10:52:59 +01:00
|
|
|
{% if not profile %}
|
2020-02-03 04:22:00 +01:00
|
|
|
<a href="{{ url_for('admin.admin') }}" id="back" class="btn btn-default">{{_('Cancel')}}</a>
|
2016-11-12 10:52:59 +01:00
|
|
|
{% endif %}
|
2018-09-29 15:44:42 +02:00
|
|
|
</div>
|
2015-08-02 20:59:11 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if downloads %}
|
2017-02-25 13:34:33 +01:00
|
|
|
<div class="col-sm-12">
|
2016-11-09 19:24:33 +01:00
|
|
|
<h2>{{_('Recent Downloads')}}</h2>
|
2015-08-02 20:59:11 +02:00
|
|
|
{% for entry in downloads %}
|
|
|
|
<div class="col-sm-2">
|
2019-07-13 20:45:48 +02:00
|
|
|
<a class="pull-left" href="{{ url_for('web.show_book', book_id=entry.id) }}">
|
2020-02-13 21:05:24 +01:00
|
|
|
<img class="media-object cover-small" src="{{ url_for('web.get_cover', book_id=entry.id) }}" alt="...">
|
2015-08-02 20:59:11 +02:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2017-02-25 13:34:33 +01:00
|
|
|
</div>
|
2015-08-02 20:59:11 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2020-01-11 19:10:39 +01:00
|
|
|
<div class="modal fade" id="modal_kobo_token" tabindex="-1" role="dialog" aria-labelledby="kobo_tokenModalLabel">
|
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
|
|
<h4 class="modal-title" id="kobo_tokenModalLabel">{{_('Generate Kobo Auth URL')}}</h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">...</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Close')}}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="modalDeleteToken" class="modal fade" role="dialog">
|
|
|
|
<div class="modal-dialog modal-sm">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header bg-danger">
|
|
|
|
</div>
|
|
|
|
<div class="modal-body text-center">
|
|
|
|
<p>{{_('Do you really want to delete the Kobo Token?')}}</p>
|
|
|
|
<button type="button" class="btn btn-danger" id="btndeletetoken" value="{{content.id}}">{{_('Delete')}}</button>
|
|
|
|
<button type="button" class="btn btn-default" id="btncancel" data-dismiss="modal">{{_('Back')}}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2015-08-02 20:59:11 +02:00
|
|
|
{% endblock %}
|
2020-01-01 17:26:47 +01:00
|
|
|
{% block modal %}
|
|
|
|
{{ restrict_modal() }}
|
|
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-editable.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-editable.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/table.js') }}"></script>
|
|
|
|
{% endblock %}
|