From 81c30d5fd578f9cf0652810f4d627fee3c86fc37 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Feb 2021 19:55:51 +0100 Subject: [PATCH] Add missing files from bootstrap editable Added user-table single-select header for locale and default-language --- cps/admin.py | 4 +++ cps/static/img/clear.png | Bin 0 -> 509 bytes cps/static/img/loading.gif | Bin 0 -> 1849 bytes cps/templates/user_table.html | 63 ++++++++++++++++++++++++++-------- 4 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 cps/static/img/clear.png create mode 100644 cps/static/img/loading.gif 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 0000000000000000000000000000000000000000..580b52a5be8a644f826def0c7ed6a13f90c0915c GIT binary patch literal 509 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4u6ByT*@`3|I*lDyqr82-2SpV<%OaTa()76WMy zFm^kcZ3hx8D{xE)(qO#|GLJ6IVqjoo^>lFzk+^JnVSiR|B17B9``_m-NuMxfR?C!* zh07MrSo)3sr09zP_wDzlhX=fPF>UDu=?vANf(w(JrZ%)>D41|8J9+Zugm01epVrPx zINBDzitE|2b$6T`9`!DJFmdU=eKrTz=_*cb3=s8r9VQ%8yxBf7d%v=5Nxh^7ZP6=ia-yr`GWA z@1JRG_RM@X%BIyHqImbIN_g6wl?zIFvhME$`)4a}gbAnqdolZft=%U7gPsvQH z#I2z#?2;8wgCxj?;QX|b^2DN42FH~Aq*MjZ+{Ezopr E0Crl)MgRZ+ literal 0 HcmV?d00001 diff --git a/cps/static/img/loading.gif b/cps/static/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..5b33f7e54f4e55b6b8774d86d96895db9af044b4 GIT binary patch literal 1849 zcma*odr(tX9tZI2z31lM+(&YVk%mZ}5P~KlG2s=WSbGzm0!x7^P##Mnh7t-jP!X0Q zk_SQ}Po-L1tlDK;6l?(>v)e5ZBQx4|Y-Q?nr@Px3?9h(3ZWr3^tj=`TP57gKr87N$ zp2wWee1GRRCwo_xahnw)5cxNPJbCg2L6DV|6`#+yw6v6!mDS$f9-JvFD^n;GQ&UrZ zzh5jCkByB101O60U0q#p_1BM>Cv-vP?&s4@g_((4_1L=L$(a91)0=J91Gas#R{McE znYG^9*0A5YZ>#;~+Wkn(W5B0^yELIYLP!K}mB~<)AM@1&nqekynuaEGqPrzoH|KodRXJy)%+w_fu3nE5>@Bd_b zqC$EQ;{c`T&?EsNO|igL9gC7Ygxv?aQUEXMq?~>wg{EyW;VcJ37CUF#HjrT=KQO_* zS>M9yydXk18D(+QDJ1>r);Lav_uYKp$T?4vr{Q$lTo&pKv^?(>L-)G2*lwH!Ah7k? z7oH<8h-(KTKt5V6$8gF)C7Io&P5=SjTh)=zV=E2EUhQZP##L8S{d%UK>>+y82>+FV+#^BzW7u3F)Bb>=lYQ%%j`F>ASe zo*cw@V#u6T`A2He;70mR(V&iV&-7{qP~=SRf&jm9-T{*ZeZ}$rd0#6c&fLG^xJcf5 z+p<`wJYgW+_s*V{uI$nMB;%8`S_3>PfGOj3Rq}@Cx^+j?rk92fANSFDBYnOqQ>Vdj z)(|$AhP4t&Lb=Gvo2#3Gl%9<=Gv`Mz?Po@P4iLF!x}GUWJICDlFk-hS^Whyh7x~VH z@0vD1>HYD4&e+~yzS*-sFR{9`{QEEZO1zg7>R&7cHts-6j!xHVdA8eI+ZlVzd%`es zJT@$#GX(gvCJ1oJN%yLBK}{V=V;seo;!w|Yte!W1%5qLNFWqvZW>h&IiH+oPT=b@E zPhGzv5=(Un*X>v`>%8h_nj^NdYcE6NHS_ifkCV$*D)Tqrbu`s;<=t<4 zAHNqNV?6(g<1PY-w@#I-WYFViz?9TrkMr)u0g`O`u|>T;k|2sV*YF^punvT;$SuTy{j3Gv)yqD!R_CF>yR)MzmmYS5v+~R zXAdD%ng9?df;wd8GxR#%3O+gz};Vo;)sK%Bj-q>Oq%R7JU-KD?vYu>#2UjaDo z&8$>5xW~?KPD_#XFToU1hIb*VOMidUr6iYiO0N|i-7s`T8!cFT`rN!^1Pt78J93i6 z5HI1wIM$94m{3SLDvISDe6$ZG1;eq_D9RTaaC>=cO{@Bs>$IlPCPJJ$h$)-3vzNUQ6OsN#_zWxey!_9%hxwH2_dEJi=yY|1c7nDm2_Lm!Cof8-R_+9UkS zcBE(o47yE)oMR(Q=dp1a2wTX5KvvGyLqlWTa7V&!A*|w|)ax~1_~aJ0=_Lilg*0iQk7#ZD EAHN$8j{pDw literal 0 HcmV?d00001 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')}}