2021-01-31 09:17:40 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% macro user_table_row(parameter, edit_text, show_text, validate) -%}
|
|
|
|
<th data-field="{{ parameter }}" id="{{ parameter }}" data-sortable="true"
|
2021-02-13 12:17:02 +00:00
|
|
|
data-name="{{ parameter }}"
|
|
|
|
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-14 12:09:31 +00:00
|
|
|
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}" {% endif %}>
|
|
|
|
{{ show_text }}
|
|
|
|
</th>
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
{% 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">
|
|
|
|
<div class="form-check">
|
|
|
|
<label>
|
2021-02-20 13:18:27 +00:00
|
|
|
<input type="radio" class="check_head" name="options_{{array_field}}" onchange="checkboxHeader('false', '{{parameter}}', {{value.get(array_field)}})" disabled>{{_('Deny')}}
|
2021-02-14 12:09:31 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="form-check">
|
|
|
|
<label>
|
2021-02-20 13:18:27 +00:00
|
|
|
<input type="radio" class="check_head" name="options_{{array_field}}" onchange="checkboxHeader('false', '{{parameter}}', {{value.get(array_field)}})" disabled>{{_('Allow')}}
|
2021-02-14 12:09:31 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{{show_text}}
|
|
|
|
</th>
|
2021-01-31 09:17:40 +00:00
|
|
|
{%- endmacro %}
|
|
|
|
|
2021-02-20 13:18:27 +00:00
|
|
|
{% macro user_select_row(parameter, url, show_text, validate) -%}
|
|
|
|
<th data-field="{{ parameter }}" id="{{ parameter }}" data-sortable="true"
|
|
|
|
data-name="{{ parameter }}"
|
|
|
|
data-visible="{{visiblility.get(parameter)}}"
|
|
|
|
data-editable-type="select"
|
|
|
|
data-edit="true"
|
|
|
|
data-editable-url="{{ url_for('admin.edit_list_user', param=parameter)}}"
|
|
|
|
data-editable-source={{url}}
|
|
|
|
{% if validate %}data-edit-validate="{{ _('This Field is Required') }}" {% endif %}>
|
|
|
|
{{ show_text }}
|
|
|
|
</th>
|
|
|
|
<!--data-editable-source="[{'value': '1', 'text':'bootstrap-table'},{'value': '2', 'text':'bootstrap2-table'}]"-->
|
|
|
|
{%- 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">
|
|
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
<h2 class="{{page}}">{{_(title)}}</h2>
|
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"
|
|
|
|
data-url="{{url_for('admin.list_users')}}">
|
|
|
|
<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-01-31 13:54:45 +00:00
|
|
|
{{ user_table_row('nickname', _('Enter Username'), _('Username'), true) }}
|
|
|
|
{{ user_table_row('email', _('Enter E-mail Address'), _('E-mail Address'), true) }}
|
2021-02-20 13:18:27 +00:00
|
|
|
{{ user_select_row('locale', url_for('admin.table_get_locale'), _('Locale'), true) }}
|
|
|
|
{{ user_select_row('default_language', url_for('admin.table_get_default_lang'), _('Visible Book Languages'), true) }}
|
2021-01-31 13:54:45 +00:00
|
|
|
{{ user_table_row('kindle_mail', _('Enter Kindle E-mail Address'), _('Kindle E-mail'), true) }}
|
2021-02-20 13:18:27 +00:00
|
|
|
{{ user_table_row('denied_tags', _("Enter Users's Locale"), _("Denied Tags"), true) }}
|
|
|
|
{{ user_table_row('allowed_tags', _("Edit Allowed Tags"), _("Allowed Tags"), true) }}
|
|
|
|
{{ user_table_row('allowed_column_value', _("Edit Allowed Column Values"), _("Allowed Column Values"), true) }}
|
|
|
|
{{ user_table_row('denied_column_value', _("Edit Denied Column Values"), _("Denied Columns Values"), true) }}
|
2021-02-14 12:09:31 +00:00
|
|
|
{{ user_checkbox_row("role", "admin_role", _('Admin'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "download_role",_('Upload'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "upload_role", _('Download'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "edit_role", _('Edit'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "passwd_role", _('Change Password'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "edit_shelf_role", _('Edit Public Shelfs'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "delete_role", _('Delete'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("role", "viewer_role", _('View'), visiblility, all_roles)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "detail_random", _('Show Random Books in Detail View'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_language", _('Show language selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_series", _('Show series selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_category", _('Show category selection'), 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 selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_best_rated", _('Show Top Rated Books'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_read_and_unread", _('Show random books'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_publisher", _('Show publisher selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_rating", _('Show ratings selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_format", _('Show file formats selection'), visiblility, sidebar_settings)}}
|
|
|
|
{{ user_checkbox_row("sidebar_view", "sidebar_archived", _('Show archived books'), visiblility, sidebar_settings)}}
|
|
|
|
{{ 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-01-31 13:54:45 +00:00
|
|
|
<th data-align="right" data-formatter="UserActions" data-switchable="false">{{_('Delete User')}}</th>
|
2021-01-31 09:17:40 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
|
|
|
{% endblock %}
|
2021-01-31 13:54:45 +00:00
|
|
|
{% block modal %}
|
|
|
|
{{ delete_confirm_modal() }}
|
|
|
|
{% endblock %}
|
2021-01-31 09:17:40 +00:00
|
|
|
{% 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>
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|