From 6e5061250c48a998061714a10b19b2b4e0716fe0 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 14 Jan 2022 18:10:50 +0100 Subject: [PATCH] Improve admin views (2) Signed-off-by: Thomas Citharel --- js/src/components/Account/ActorCard.vue | 40 +- js/src/components/Utils/Breadcrumbs.vue | 8 +- js/src/graphql/admin.ts | 23 + js/src/graphql/user.ts | 20 +- js/src/i18n/en_US.json | 23 +- js/src/i18n/fr_FR.json | 25 +- js/src/views/Admin/AdminProfile.vue | 20 +- js/src/views/Admin/AdminUserProfile.vue | 429 +++- js/src/views/Admin/Instance.vue | 21 +- js/src/views/Admin/Users.vue | 93 +- lib/graphql/resolvers/admin.ex | 120 +- lib/graphql/resolvers/user.ex | 4 +- lib/graphql/schema/admin.ex | 2 +- lib/graphql/schema/user.ex | 5 + lib/mobilizon/users/users.ex | 33 +- lib/web/email/admin.ex | 96 + lib/web/templates/email/admin/_role.html.heex | 8 + lib/web/templates/email/admin/_role.text.eex | 1 + .../email/admin_user_confirmation.html.heex | 82 + .../email/admin_user_confirmation.text.eex | 7 + .../admin_user_email_changed_new.html.heex | 56 + .../admin_user_email_changed_new.text.eex | 4 + .../admin_user_email_changed_old.html.heex | 56 + .../admin_user_email_changed_old.text.eex | 4 + .../email/admin_user_role_changed.html.heex | 78 + .../email/admin_user_role_changed.text.eex | 8 + .../email/email_changed_new.text.eex | 2 +- priv/gettext/activity.pot | 36 +- priv/gettext/ar/LC_MESSAGES/activity.po | 36 +- priv/gettext/ar/LC_MESSAGES/default.po | 175 +- priv/gettext/ar/LC_MESSAGES/errors.po | 164 +- priv/gettext/be/LC_MESSAGES/activity.po | 36 +- priv/gettext/be/LC_MESSAGES/default.po | 175 +- priv/gettext/be/LC_MESSAGES/errors.po | 164 +- priv/gettext/ca/LC_MESSAGES/activity.po | 36 +- priv/gettext/ca/LC_MESSAGES/default.po | 179 +- priv/gettext/ca/LC_MESSAGES/errors.po | 164 +- priv/gettext/cs/LC_MESSAGES/activity.po | 36 +- priv/gettext/cs/LC_MESSAGES/default.po | 179 +- priv/gettext/cs/LC_MESSAGES/errors.po | 165 +- priv/gettext/de/LC_MESSAGES/activity.po | 36 +- priv/gettext/de/LC_MESSAGES/default.po | 180 +- priv/gettext/de/LC_MESSAGES/errors.po | 166 +- priv/gettext/default.pot | 175 +- priv/gettext/en/LC_MESSAGES/activity.po | 36 +- priv/gettext/en/LC_MESSAGES/default.po | 175 +- priv/gettext/en/LC_MESSAGES/errors.po | 164 +- priv/gettext/errors.pot | 164 +- priv/gettext/es/LC_MESSAGES/activity.po | 36 +- priv/gettext/es/LC_MESSAGES/default.po | 179 +- priv/gettext/es/LC_MESSAGES/errors.po | 166 +- priv/gettext/fi/LC_MESSAGES/activity.po | 36 +- priv/gettext/fi/LC_MESSAGES/default.po | 179 +- priv/gettext/fi/LC_MESSAGES/errors.po | 164 +- priv/gettext/fr/LC_MESSAGES/activity.po | 36 +- priv/gettext/fr/LC_MESSAGES/default.po | 603 ++---- priv/gettext/fr/LC_MESSAGES/errors.po | 168 +- priv/gettext/gd/LC_MESSAGES/activity.po | 36 +- priv/gettext/gd/LC_MESSAGES/default.po | 175 +- priv/gettext/gd/LC_MESSAGES/errors.po | 164 +- priv/gettext/gl/LC_MESSAGES/activity.po | 36 +- priv/gettext/gl/LC_MESSAGES/default.po | 179 +- priv/gettext/gl/LC_MESSAGES/errors.po | 166 +- priv/gettext/he/LC_MESSAGES/activity.po | 188 +- priv/gettext/he/LC_MESSAGES/default.po | 1821 +++++++++++++++++ priv/gettext/he/LC_MESSAGES/errors.po | 1092 ++++++++++ priv/gettext/hr/LC_MESSAGES/activity.po | 36 +- priv/gettext/hr/LC_MESSAGES/default.po | 175 +- priv/gettext/hr/LC_MESSAGES/errors.po | 164 +- priv/gettext/hu/LC_MESSAGES/activity.po | 36 +- priv/gettext/hu/LC_MESSAGES/default.po | 175 +- priv/gettext/hu/LC_MESSAGES/errors.po | 166 +- priv/gettext/id/LC_MESSAGES/activity.po | 36 +- priv/gettext/id/LC_MESSAGES/default.po | 175 +- priv/gettext/id/LC_MESSAGES/errors.po | 164 +- priv/gettext/it/LC_MESSAGES/activity.po | 36 +- priv/gettext/it/LC_MESSAGES/default.po | 179 +- priv/gettext/it/LC_MESSAGES/errors.po | 166 +- priv/gettext/ja/LC_MESSAGES/activity.po | 36 +- priv/gettext/ja/LC_MESSAGES/default.po | 175 +- priv/gettext/ja/LC_MESSAGES/errors.po | 164 +- priv/gettext/nl/LC_MESSAGES/activity.po | 36 +- priv/gettext/nl/LC_MESSAGES/default.po | 167 +- priv/gettext/nl/LC_MESSAGES/errors.po | 164 +- priv/gettext/nn/LC_MESSAGES/activity.po | 36 +- priv/gettext/nn/LC_MESSAGES/default.po | 179 +- priv/gettext/nn/LC_MESSAGES/errors.po | 166 +- priv/gettext/oc/LC_MESSAGES/activity.po | 36 +- priv/gettext/oc/LC_MESSAGES/default.po | 175 +- priv/gettext/oc/LC_MESSAGES/errors.po | 164 +- priv/gettext/pl/LC_MESSAGES/activity.po | 36 +- priv/gettext/pl/LC_MESSAGES/default.po | 179 +- priv/gettext/pl/LC_MESSAGES/errors.po | 166 +- priv/gettext/pt/LC_MESSAGES/activity.po | 36 +- priv/gettext/pt/LC_MESSAGES/default.po | 175 +- priv/gettext/pt/LC_MESSAGES/errors.po | 164 +- priv/gettext/pt_BR/LC_MESSAGES/activity.po | 36 +- priv/gettext/pt_BR/LC_MESSAGES/default.po | 175 +- priv/gettext/pt_BR/LC_MESSAGES/errors.po | 164 +- priv/gettext/ru/LC_MESSAGES/activity.po | 36 +- priv/gettext/ru/LC_MESSAGES/default.po | 179 +- priv/gettext/ru/LC_MESSAGES/errors.po | 166 +- priv/gettext/sv/LC_MESSAGES/activity.po | 48 +- priv/gettext/sv/LC_MESSAGES/default.po | 175 +- priv/gettext/sv/LC_MESSAGES/errors.po | 164 +- test/graphql/resolvers/admin_test.exs | 250 ++- test/graphql/resolvers/user_test.exs | 74 +- test/mobilizon/users/users_test.exs | 5 +- 108 files changed, 12041 insertions(+), 2526 deletions(-) create mode 100644 lib/web/templates/email/admin/_role.html.heex create mode 100644 lib/web/templates/email/admin/_role.text.eex create mode 100644 lib/web/templates/email/admin_user_confirmation.html.heex create mode 100644 lib/web/templates/email/admin_user_confirmation.text.eex create mode 100644 lib/web/templates/email/admin_user_email_changed_new.html.heex create mode 100644 lib/web/templates/email/admin_user_email_changed_new.text.eex create mode 100644 lib/web/templates/email/admin_user_email_changed_old.html.heex create mode 100644 lib/web/templates/email/admin_user_email_changed_old.text.eex create mode 100644 lib/web/templates/email/admin_user_role_changed.html.heex create mode 100644 lib/web/templates/email/admin_user_role_changed.text.eex create mode 100644 priv/gettext/he/LC_MESSAGES/default.po create mode 100644 priv/gettext/he/LC_MESSAGES/errors.po diff --git a/js/src/components/Account/ActorCard.vue b/js/src/components/Account/ActorCard.vue index daead16b4..7d48b4fc6 100644 --- a/js/src/components/Account/ActorCard.vue +++ b/js/src/components/Account/ActorCard.vue @@ -1,6 +1,36 @@ diff --git a/js/src/views/Admin/Instance.vue b/js/src/views/Admin/Instance.vue index 399b8a558..fc4801fa7 100644 --- a/js/src/views/Admin/Instance.vue +++ b/js/src/views/Admin/Instance.vue @@ -9,13 +9,12 @@ />

{{ instance.domain }}

-
+
{{ instance.personCount @@ -23,13 +22,12 @@ {{ $t("Profiles") }}
-
+
{{ instance.groupCount @@ -37,26 +35,21 @@ {{ $t("Groups") }}
-
+
{{ instance.followingsCount }} {{ $t("Followings") }}
-
+
{{ instance.followersCount }} {{ $t("Followers") }}
-
+
{{ instance.reportsCount @@ -64,9 +57,7 @@ {{ $t("Reports") }}
-
+
{{ formatBytes(instance.mediaSize) }} diff --git a/js/src/views/Admin/Users.vue b/js/src/views/Admin/Users.vue index 3f52b2563..70bb912ac 100644 --- a/js/src/views/Admin/Users.vue +++ b/js/src/views/Admin/Users.vue @@ -10,12 +10,27 @@ ]" />
+
+ + + + + + + +

+ {{ + $t("Filter") + }} +

+
+
{{ props.row.id }} - - +