diff --git a/packages/ui-default/templates/components/user.html b/packages/ui-default/templates/components/user.html index 97697b2c0..61f9706ee 100644 --- a/packages/ui-default/templates/components/user.html +++ b/packages/ui-default/templates/components/user.html @@ -18,7 +18,7 @@ {% endif %} {% if levelbadge and udoc.level %} {% set level = udoc.level %} - LV {{ level }} + {{ _('LV '+ level) }} {% endif %} {% if modbadge %} {% if udoc.hasPriv(PRIV.PRIV_MOD_BADGE) %} diff --git a/packages/ui-default/templates/partials/manage_user_priv.html b/packages/ui-default/templates/partials/manage_user_priv.html index 9c121ed41..4443e655e 100644 --- a/packages/ui-default/templates/partials/manage_user_priv.html +++ b/packages/ui-default/templates/partials/manage_user_priv.html @@ -1,4 +1,21 @@ {% import "components/user.html" as user with context %} + +{% macro show_priv(upriv) %} +{%- if upriv == 0 -%} + PRIV_NONE +{%- elif upriv == -1 -%} + PRIV_ALL +{%- else -%} + {%- for name, priv in Priv -%} + {%- if priv|bitand(upriv) and not priv|bitand(defaultPriv) -%} +

+{{ name }}

+ {%- elif priv|bitand(defaultPriv) and not priv|bitand(upriv) -%} +

-{{ name }}

+ {%- endif -%} + {%- endfor -%} +{%- endif -%} +{% endmacro %} + @@ -21,35 +38,41 @@ {{ _('Edit') }} - {%- for udoc in udocs -%} - - - {{ udoc._id }} - - - {{ user.render_inline(udoc, badge=false) }} - - - {%- if udoc.priv == 0 -%} - PRIV_NONE - {%- elif udoc.priv == -1 -%} - PRIV_ALL - {%- else -%} - {%- for name, priv in Priv -%} - {%- if priv|bitand(udoc.priv) and not priv|bitand(defaultPriv) -%} -

+{{ name }}

- {%- elif priv|bitand(defaultPriv) and not priv|bitand(udoc.priv) -%} -

-{{ name }}

- {%- endif -%} - {%- endfor -%} - {%- endif -%} - - - {{ udoc.priv }} - - - {{ _('Edit') }} - - + {%- for priv, gudocs in udocs|groupby('priv') -%} + {%- if gudocs|length > 50 -%} + + +
+ {%- for udoc in gudocs -%} + [{{udoc._id}}]{{ user.render_inline(udoc, avatar=false, badge=false) }} + {{ _('Edit') }}    + {%- endfor -%} + + + {{ priv }}
+ {{ show_priv(priv) }} + + + {%- else -%} + {%- for udoc in gudocs -%} + + + {{ udoc._id }} + + + {{ user.render_inline(udoc, badge=false) }} + + + {{ show_priv(udoc.priv) }} + + + {{ udoc.priv }} + + + {{ _('Edit') }} + + + {%- endfor -%} + {%- endif -%} {%- endfor -%} \ No newline at end of file