diff --git a/cps/admin.py b/cps/admin.py index 8bedef8a..386e2125 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -220,12 +220,16 @@ def view_configuration(): @admin_required def edit_user_table(): visibility = current_user.view_settings.get('useredit', {}) + languages = calibre_db.speaking_language() + translations = babel.list_translations() + [LC('en')] allUser = ub.session.query(ub.User) if not config.config_anonbrowse: allUser = allUser.filter(ub.User.role.op('&')(constants.ROLE_ANONYMOUS) != constants.ROLE_ANONYMOUS) return render_title_template("user_table.html", users=allUser.all(), + translations=translations, + languages=languages, visiblility=visibility, all_roles=constants.ALL_ROLES, sidebar_settings=constants.sidebar_settings, diff --git a/cps/static/img/clear.png b/cps/static/img/clear.png new file mode 100644 index 00000000..580b52a5 Binary files /dev/null and b/cps/static/img/clear.png differ diff --git a/cps/static/img/loading.gif b/cps/static/img/loading.gif new file mode 100644 index 00000000..5b33f7e5 Binary files /dev/null and b/cps/static/img/loading.gif differ diff --git a/cps/templates/user_table.html b/cps/templates/user_table.html index f8acb8fc..be14ff1a 100644 --- a/cps/templates/user_table.html +++ b/cps/templates/user_table.html @@ -1,13 +1,19 @@ {% extends "layout.html" %} -{% macro user_table_row(parameter, edit_text, show_text, validate) -%} - + {% if not button %} + data-sortable="true" + {% endif %} + {% if validate %}data-edit-validate="{{ _('This Field is Required') }}"{% endif %}> + {% if button %} +
{{edit_text}}

+ {% endif %} {{ show_text }} {%- endmacro %} @@ -31,18 +37,47 @@ {%- endmacro %} -{% macro user_select_row(parameter, url, show_text, validate) -%} - + {% if validate %}data-edit-validate="{{ _('This Field is Required') }}"{% endif %}> +
+ +

+ + {{ show_text }} + +{%- endmacro %} + +{% macro user_select_translations(parameter, url, show_text, validate) -%} + +
+ +

{{ show_text }} - {%- endmacro %} @@ -66,13 +101,13 @@ {{ user_table_row('nickname', _('Enter Username'), _('Username'), true) }} {{ user_table_row('email', _('Enter E-mail Address'), _('E-mail Address'), true) }} - {{ 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) }} {{ user_table_row('kindle_mail', _('Enter Kindle E-mail Address'), _('Kindle E-mail'), true) }} - {{ 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) }} + {{ 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) }} + {{ user_table_row('denied_tags', _("Edit Denied Tags"), _("Denied Tags"), true, true) }} + {{ user_table_row('allowed_tags', _("Edit Allowed Tags"), _("Allowed Tags"), true, true) }} + {{ user_table_row('allowed_column_value', _("Edit Allowed Column Values"), _("Allowed Column Values"), true, true) }} + {{ user_table_row('denied_column_value', _("Edit Denied Column Values"), _("Denied Columns Values"), true, true) }} {{ 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)}} @@ -95,7 +130,7 @@ {{ 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)}} - {{_('Delete User')}} +
{{_('Delete User')}}

{{_('Delete User')}}