2021-01-31 09:17:40 +00:00
|
|
|
{% extends "layout.html" %}
|
2021-04-25 08:42:41 +00:00
|
|
|
{% macro user_table_row(parameter, edit_text, show_text, validate, elements=False) -%}
|
2021-02-20 18:55:51 +00:00
|
|
|
<th data-field="{{ parameter }}" id="{{ parameter }}"
|
2021-02-13 12:17:02 +00:00
|
|
|
data-name="{{ parameter }}"
|
2021-08-28 13:47:57 +00:00
|
|
|
data-escape="true"
|
2021-02-13 12:17:02 +00:00
|
|
|
data-visible="{{visiblility.get(parameter)}}"
|
2021-01-31 09:17:40 +00:00
|
|
|
data-editable-type="text"
|
|
|
|
data-editable-url="{{ url_for('admin.edit_list_user', param=parameter)}}"
|
|
|
|
data-editable-title="{{ edit_text }}"
|
|
|
|
data-edit="true"
|
2021-02-20 18:55:51 +00:00
|
|
|
{% if not button %}
|
|
|
|
data-sortable="true"
|
|
|
|
{% endif %}
|
|
|
|
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}"{% endif %}>
|
2021-04-25 08:42:41 +00:00
|
|
|
{% if elements %}
|
|
|
|
<div class="multi_select">
|
|
|
|
<select class="multi_selector" id="{{ parameter }}" data-live-search="true" data-style="btn-default" data-dropup-auto="false" aria-disabled="true" multiple disabled>
|
|
|
|
{% for tag in elements %}
|
|
|
|
<option class="tags_click" value="{{tag.id}}">{% if tag.name %}{{tag.name}}{% else %}{{tag.value}}{% endif %}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
<div class="btn-group btn-group-justified" role="group">
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
<div class="multi_head btn btn-default hidden" data-set="remove" data-name="{{parameter}}" aria-disabled="true">{{_('Remove')}}</div>
|
|
|
|
</div>
|
|
|
|
<div class="btn-group" role="group">
|
|
|
|
<div class="multi_head btn btn-default hidden" data-set="add" data-name="{{parameter}}" aria-disabled="true">{{_('Add')}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-20 18:55:51 +00:00
|
|
|
{% endif %}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ show_text }}
|
|
|
|
</th>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2021-05-15 08:45:51 +00:00
|
|
|
{% macro user_single_checkbox_row(parameter, show_text) -%}
|
|
|
|
<th data-name="{{parameter}}" data-field="{{parameter}}"
|
|
|
|
data-formatter="singlecheckboxFormatter">
|
|
|
|
<div class="form-check">
|
|
|
|
<div>
|
|
|
|
<input type="radio" class="check_head" data-set="false" data-val="0" name="{{parameter}}" id="false_{{parameter}}" data-name="{{parameter}}" disabled>{{_('Deny')}}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input type="radio" class="check_head" data-set="true" data-val="1" name="{{parameter}}" data-name="{{parameter}}" disabled>{{_('Allow')}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{show_text}}
|
|
|
|
</th>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2021-02-14 12:09:31 +00:00
|
|
|
{% macro user_checkbox_row(parameter, array_field, show_text, element, value) -%}
|
|
|
|
<th data-name="{{array_field}}" data-field="{{parameter}}"
|
|
|
|
data-visible="{{element.get(array_field)}}"
|
|
|
|
data-column="{{value.get(array_field)}}"
|
|
|
|
data-formatter="checkboxFormatter">
|
2021-04-18 10:01:11 +00:00
|
|
|
<div class="form-check">
|
|
|
|
<div>
|
2021-05-15 08:45:51 +00:00
|
|
|
<input type="radio" class="check_head" data-set="false" data-val="{{value.get(array_field)}}" name="options_{{array_field}}" id="false_{{array_field}}" data-name="{{parameter}}" disabled>{{_('Deny')}}
|
2021-02-14 12:09:31 +00:00
|
|
|
</div>
|
2021-04-18 10:01:11 +00:00
|
|
|
<div>
|
2021-05-15 08:45:51 +00:00
|
|
|
<input type="radio" class="check_head" data-set="true" data-val="{{value.get(array_field)}}" name="options_{{array_field}}" data-name="{{parameter}}" disabled>{{_('Allow')}}
|
2021-02-14 12:09:31 +00:00
|
|
|
</div>
|
2021-04-18 10:01:11 +00:00
|
|
|
</div>
|
2021-02-14 12:09:31 +00:00
|
|
|
{{show_text}}
|
|
|
|
</th>
|
2021-01-31 09:17:40 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2021-02-20 18:55:51 +00:00
|
|
|
{% macro user_select_languages(parameter, url, show_text, validate) -%}
|
|
|
|
<th data-field="{{ parameter }}" id="{{ parameter }}"
|
2021-02-20 13:18:27 +00:00
|
|
|
data-name="{{ parameter }}"
|
|
|
|
data-visible="{{visiblility.get(parameter)}}"
|
|
|
|
data-edit="true"
|
2021-04-04 17:40:34 +00:00
|
|
|
data-sortable="true"
|
2021-08-29 09:31:10 +00:00
|
|
|
data-editable-type="select"
|
2021-02-20 13:18:27 +00:00
|
|
|
data-editable-url="{{ url_for('admin.edit_list_user', param=parameter)}}"
|
2021-08-29 09:31:10 +00:00
|
|
|
data-editable-source="{{url}}"
|
2021-02-20 18:55:51 +00:00
|
|
|
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}"{% endif %}>
|
|
|
|
<div>
|
2021-04-18 10:01:11 +00:00
|
|
|
<select id="select_{{ parameter }}" class="header_select" disabled="">
|
2021-04-25 08:42:41 +00:00
|
|
|
<option value="none">{{ _('Select...') }}</option>
|
2021-02-20 18:55:51 +00:00
|
|
|
<option value="all">{{ _('Show All') }}</option>
|
|
|
|
{% for language in languages %}
|
|
|
|
<option value="{{language.lang_code}}">{{language.name}}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2021-04-18 10:01:11 +00:00
|
|
|
</div>
|
2021-02-20 18:55:51 +00:00
|
|
|
{{ show_text }}
|
|
|
|
</th>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% macro user_select_translations(parameter, url, show_text, validate) -%}
|
|
|
|
<th data-field="{{ parameter }}" id="{{ parameter }}"
|
|
|
|
data-name="{{ parameter }}"
|
|
|
|
data-visible="{{visiblility.get(parameter)}}"
|
|
|
|
data-editable-type="select"
|
|
|
|
data-edit="true"
|
2021-04-04 17:40:34 +00:00
|
|
|
data-sortable="true"
|
2021-02-20 18:55:51 +00:00
|
|
|
data-editable-url="{{ url_for('admin.edit_list_user', param=parameter)}}"
|
2021-08-29 09:31:10 +00:00
|
|
|
data-editable-source="{{url}}"
|
2021-02-20 18:55:51 +00:00
|
|
|
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}"{% endif %}>
|
|
|
|
<div>
|
2021-04-18 10:01:11 +00:00
|
|
|
<select id="select_{{ parameter }}" class="header_select" disabled="">
|
2021-03-16 14:40:58 +00:00
|
|
|
<option value="None">{{_('Select...')}}</option>
|
2021-02-20 18:55:51 +00:00
|
|
|
{% for translation in translations %}
|
|
|
|
<option value="{{translation}}">{{translation.display_name|capitalize}}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2021-04-18 10:01:11 +00:00
|
|
|
</div>
|
2021-02-20 13:18:27 +00:00
|
|
|
{{ show_text }}
|
|
|
|
</th>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
|
2021-01-31 09:17:40 +00:00
|
|
|
{% block header %}
|
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-table.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-editable.css') }}" rel="stylesheet">
|
2021-04-25 08:42:41 +00:00
|
|
|
<link href="{{ url_for('static', filename='css/libs/bootstrap-select.min.css') }}" rel="stylesheet" >
|
2021-01-31 09:17:40 +00:00
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<h2 class="{{page}}">{{_(title)}}</h2>
|
2021-10-04 15:50:32 +00:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
2021-02-14 12:09:31 +00:00
|
|
|
<div class="col-xs-12 col-sm-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="btn btn-default disabled" id="user_delete_selection" aria-disabled="true">{{_('Remove Selections')}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-31 09:17:40 +00:00
|
|
|
<table id="user-table" class="table table-no-bordered table-striped"
|
2023-02-04 10:18:43 +00:00
|
|
|
data-url="{{url_for('admin.list_users')}}" data-locale="{{ current_user.locale }}">
|
2021-01-31 09:17:40 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-02-13 12:17:02 +00:00
|
|
|
<th data-name="edit" data-buttontext="{{_('Edit User')}}" data-visible="{{visiblility.get('edit')}}" data-formatter="singleUserFormatter">{{_('Edit')}}</th>
|
|
|
|
<th data-name="state" data-field="state" data-checkbox="true" data-visible="{{visiblility.get('state')}}" data-sortable="true"></th>
|
|
|
|
<th data-name="id" data-field="id" id="id" data-visible="false" data-switchable="false"></th>
|
2021-03-21 17:55:02 +00:00
|
|
|
{{ user_table_row('name', _('Enter Username'), _('Username'), true) }}
|
2023-01-04 02:30:13 +00:00
|
|
|
{{ user_table_row('email', _('Enter Email'), _('Email'), true) }}
|
|
|
|
{{ user_table_row('kindle_mail', _('Enter eReader Email'), _('eReader Email'), false) }}
|
2021-02-20 18:55:51 +00:00
|
|
|
{{ user_select_translations('locale', url_for('admin.table_get_locale'), _('Locale'), true) }}
|
|
|
|
{{ user_select_languages('default_language', url_for('admin.table_get_default_lang'), _('Visible Book Languages'), true) }}
|
2021-04-25 08:42:41 +00:00
|
|
|
{{ user_table_row('allowed_tags', _("Edit Allowed Tags"), _("Allowed Tags"), false, tags) }}
|
2021-05-14 07:29:24 +00:00
|
|
|
{{ user_table_row('denied_tags', _("Edit Denied Tags"), _("Denied Tags"), false, tags) }}
|
2021-04-25 08:42:41 +00:00
|
|
|
{{ user_table_row('allowed_column_value', _("Edit Allowed Column Values"), _("Allowed Column Values"), false, custom_values) }}
|
2021-09-25 15:15:44 +00:00
|
|
|
{{ user_table_row('denied_column_value', _("Edit Denied Column Values"), _("Denied Column Values"), false, custom_values) }}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("role", "admin_role", _('Admin'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "passwd_role", _('Change Password'), visiblility, all_roles)}}
|
2021-04-07 15:46:17 +00:00
|
|
|
{{ user_checkbox_row("role", "upload_role",_('Upload'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "download_role", _('Download'), visiblility, all_roles)}}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("role", "viewer_role", _('View'), visiblility, all_roles)}}
|
2021-04-07 15:46:17 +00:00
|
|
|
{{ user_checkbox_row("role", "edit_role", _('Edit'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "delete_role", _('Delete'), visiblility, all_roles)}}
|
2021-05-15 08:45:51 +00:00
|
|
|
{{ user_checkbox_row("role", "edit_shelf_role", _('Edit Public Shelves'), visiblility, all_roles)}}
|
|
|
|
{% if kobo_support %}
|
2021-08-01 15:27:18 +00:00
|
|
|
{{ user_single_checkbox_row("kobo_only_shelves_sync", _('Sync selected Shelves with Kobo'))}}
|
2021-05-15 08:45:51 +00:00
|
|
|
{% endif %}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "detail_random", _('Show Random Books in Detail View'), visiblility, sidebar_settings)}}
|
2023-01-04 02:30:13 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_language", _('Show Language Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_read_and_unread", _('Show Read/Unread Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_series", _('Show Series Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_category", _('Show Category Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_random", _('Show Random Books'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_author", _('Show Author Section'), visiblility, sidebar_settings)}}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_best_rated", _('Show Top Rated Books'), visiblility, sidebar_settings)}}
|
2021-05-16 07:37:45 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_read_and_unread", _('Show Random Books'), visiblility, sidebar_settings)}}
|
2023-01-04 02:30:13 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_publisher", _('Show Publisher Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_rating", _('Show Ratings Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_format", _('Show File Formats Section'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_archived", _('Show Archived Books'), visiblility, sidebar_settings)}}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_download", _('Show Downloaded Books'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_list", _('Show Books List'), visiblility, sidebar_settings)}}
|
2021-03-16 14:03:38 +00:00
|
|
|
<th data-align="right" data-formatter="UserActions" data-switchable="false"><div><div class="btn btn-default button_head disabled" aria-disabled="true">{{_('Delete User')}}</div></div><br>{{_('Delete User')}}</th>
|
2021-01-31 09:17:40 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
2021-04-17 16:30:55 +00:00
|
|
|
<div class="errorlink">
|
|
|
|
<div class="btn btn-default" data-back="{{ url_for('admin.admin') }}" id="back">{{_('Back')}}</div>
|
|
|
|
</div>
|
2021-01-31 09:17:40 +00:00
|
|
|
{% endblock %}
|
2021-01-31 13:54:45 +00:00
|
|
|
{% block modal %}
|
|
|
|
{{ delete_confirm_modal() }}
|
2021-03-16 14:40:58 +00:00
|
|
|
{{ change_confirm_modal() }}
|
2021-03-16 14:03:38 +00:00
|
|
|
{{ restrict_modal() }}
|
2021-01-31 13:54:45 +00:00
|
|
|
{% endblock %}
|
2021-01-31 09:17:40 +00:00
|
|
|
{% block js %}
|
2021-04-11 18:01:40 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table.min.js') }}"></script>
|
2021-09-30 12:09:02 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-table/bootstrap-table-locale-all.min.js') }}"></script>
|
2021-01-31 09:17:40 +00:00
|
|
|
<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>
|
2021-04-25 08:42:41 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-select.min.js')}}"></script>
|
2023-02-04 10:18:43 +00:00
|
|
|
{% if not current_user.locale == 'en' %}
|
|
|
|
<script src="{{ url_for('static', filename='js/libs/bootstrap-select/defaults-' + current_user.locale + '.min.js') }}" charset="UTF-8"></script>
|
2021-10-03 06:01:33 +00:00
|
|
|
{% endif %}
|
2021-01-31 09:17:40 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/table.js') }}"></script>
|
|
|
|
{% endblock %}
|