2015-08-02 11:59:11 -07:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% block body %}
|
|
|
|
<div class="discover">
|
|
|
|
<h1>{{title}}</h1>
|
2016-06-17 11:01:44 -07:00
|
|
|
<form role="form" method="POST" autocomplete="off">
|
2016-04-27 01:39:52 -07:00
|
|
|
{% if g.user and g.user.role_admin() and new_user %}
|
2015-10-13 09:07:17 -07:00
|
|
|
<div class="form-group required">
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="nickname">{{_('Username')}}</label>
|
2016-06-17 11:01:44 -07:00
|
|
|
<input type="text" class="form-control" name="nickname" id="nickname" value="{{ content.nickname if content.nickname != None }}" autocomplete="off">
|
2015-10-13 09:07:17 -07:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
2015-08-02 11:59:11 -07:00
|
|
|
<div class="form-group">
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="email">{{_('Email address')}}</label>
|
2016-06-17 11:01:44 -07:00
|
|
|
<input type="email" class="form-control" name="email" id="email" value="{{ content.email if content.email != None }}" autocomplete="off" required>
|
2015-08-02 11:59:11 -07:00
|
|
|
</div>
|
2017-01-12 11:43:36 -08:00
|
|
|
{% if ( g.user and g.user.role_passwd() or g.user.role_admin() ) and not content.role_anonymous() %}
|
2015-08-02 11:59:11 -07:00
|
|
|
<div class="form-group">
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="password">{{_('Password')}}</label>
|
2016-06-17 11:01:44 -07:00
|
|
|
<input type="password" class="form-control" name="password" id="password" value="" autocomplete="off">
|
2015-08-02 11:59:11 -07:00
|
|
|
</div>
|
2016-04-27 07:00:58 -07:00
|
|
|
{% endif %}
|
2015-08-02 11:59:11 -07:00
|
|
|
<div class="form-group">
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="kindle_mail">{{_('Kindle E-Mail')}}</label>
|
2016-08-08 12:01:38 -07: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 11:59:11 -07:00
|
|
|
</div>
|
2016-11-09 10:24:33 -08:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="locale">{{_('Language')}}</label>
|
|
|
|
<select name="locale" id="locale" class="form-control">
|
|
|
|
{% for translation in translations %}
|
2017-01-22 05:07:54 -08:00
|
|
|
<option value="{{translation.language}}" {% if translation.language == content.locale %}selected{% endif %} {% if new_user == 1 and loop.first %}selected{% endif %}>{{ translation.display_name }}</option>
|
2016-11-09 10:24:33 -08:00
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="default_language">{{_('Show books with language')}}</label>
|
|
|
|
<select name="default_language" id="default_language" class="form-control">
|
2017-01-22 05:07:54 -08:00
|
|
|
<option value="all" {% if new_user == 1 %}selected{% endif %}>{{ _('Show all') }}</option>
|
2016-11-09 10:24:33 -08: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>
|
2015-08-02 11:59:11 -07:00
|
|
|
<div class="form-group">
|
2017-01-22 07:44:37 -08:00
|
|
|
<input type="checkbox" name="show_random" id="show_random" {% if content.random_books %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="show_random">{{_('Show random books')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-01-22 07:44:37 -08:00
|
|
|
<input type="checkbox" name="show_hot" id="show_hot" {% if content.hot_books %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="show_hot">{{_('Show hot books')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-01-22 07:44:37 -08:00
|
|
|
<input type="checkbox" name="show_language" id="show_language" {% if content.language_books %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="show_language">{{_('Show language selection')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-01-22 07:44:37 -08:00
|
|
|
<input type="checkbox" name="show_series" id="show_series" {% if content.series_books %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="show_series">{{_('Show series selection')}}</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-01-22 07:44:37 -08:00
|
|
|
<input type="checkbox" name="show_category" id="show_category" {% if content.category_books %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="show_category">{{_('Show category selection')}}</label>
|
|
|
|
</div>
|
|
|
|
|
2016-12-23 00:53:39 -08:00
|
|
|
{% if g.user and g.user.role_admin() and not profile %}
|
2017-01-12 11:43:36 -08:00
|
|
|
{% if not content.role_anonymous() %}
|
2016-11-09 10:24:33 -08:00
|
|
|
<div class="form-group">
|
2016-04-27 01:35:23 -07:00
|
|
|
<input type="checkbox" name="admin_role" id="admin_role" {% if content.role_admin() %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="admin_role">{{_('Admin user')}}</label>
|
2016-04-27 01:35:23 -07:00
|
|
|
</div>
|
2017-01-12 11:43:36 -08:00
|
|
|
{% endif %}
|
2016-04-27 01:35:23 -07:00
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="download_role" id="download_role" {% if content.role_download() %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="download_role">{{_('Allow Downloads')}}</label>
|
2016-04-27 01:35:23 -07:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="upload_role" id="upload_role" {% if content.role_upload() %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="upload_role">{{_('Allow Uploads')}}</label>
|
2016-04-27 01:35:23 -07:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="checkbox" name="edit_role" id="edit_role" {% if content.role_edit() %}checked{% endif %}>
|
2016-11-09 10:24:33 -08:00
|
|
|
<label for="edit_role">{{_('Allow Edit')}}</label>
|
2015-08-02 11:59:11 -07:00
|
|
|
</div>
|
2017-01-12 11:43:36 -08: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>
|
|
|
|
{% endif %}
|
2015-10-13 09:07:17 -07:00
|
|
|
{% endif %}
|
2017-01-12 11:43:36 -08: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>
|
|
|
|
<input type="checkbox" name="delete"> {{_('Delete this user')}}
|
|
|
|
</label>
|
|
|
|
</div>
|
2015-08-02 11:59:11 -07:00
|
|
|
{% endif %}
|
2017-01-12 11:43:36 -08:00
|
|
|
<button type="submit" id="submit" class="btn btn-default">{{_('Submit')}}</button>
|
2016-11-12 01:52:59 -08:00
|
|
|
{% if not profile %}
|
2017-01-02 09:52:33 -08:00
|
|
|
<a href="{{ url_for('admin') }}" class="btn btn-default">{{_('Back')}}</a>
|
2016-11-12 01:52:59 -08:00
|
|
|
{% endif %}
|
2015-08-02 11:59:11 -07:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if downloads %}
|
2016-11-09 10:24:33 -08:00
|
|
|
<h2>{{_('Recent Downloads')}}</h2>
|
2015-08-02 11:59:11 -07:00
|
|
|
{% for entry in downloads %}
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<a class="pull-left" href="{{ url_for('show_book', id=entry.id) }}">
|
|
|
|
<img class="media-object" width="100" src="{{ url_for('get_cover', cover_path=entry.path) }}" alt="...">
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|