From 9b10811d6915c80387e445a239b452f8b2606012 Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 19 Dec 2024 04:55:25 -0300 Subject: [PATCH 1/3] fix: ux modal for the admin to a group --- decidim-core/app/cells/decidim/group_admins/show.erb | 2 +- decidim-core/app/cells/decidim/group_members/show.erb | 4 ++-- decidim-core/app/packs/stylesheets/decidim/_modal.scss | 2 +- .../app/views/decidim/shared/_confirm_modal.html.erb | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/decidim-core/app/cells/decidim/group_admins/show.erb b/decidim-core/app/cells/decidim/group_admins/show.erb index 0b4e1323d2e44..78eb64ccfad73 100644 --- a/decidim-core/app/cells/decidim/group_admins/show.erb +++ b/decidim-core/app/cells/decidim/group_admins/show.erb @@ -21,7 +21,7 @@ <%= link_to( decidim.demote_group_manage_user_path(model.nickname, membership), method: :post, - data: { confirm: t("decidim.group_admins.actions.are_you_sure") }, + data: { confirm: t("decidim.group_admins.actions.remove_from_admin_confirm") }, class: "button button__sm button__transparent-secondary" ) do %> <%= t("decidim.group_admins.actions.demote_admin") %> diff --git a/decidim-core/app/cells/decidim/group_members/show.erb b/decidim-core/app/cells/decidim/group_members/show.erb index bb4a317b20e38..59ef528d8cd9e 100644 --- a/decidim-core/app/cells/decidim/group_members/show.erb +++ b/decidim-core/app/cells/decidim/group_members/show.erb @@ -24,14 +24,14 @@ t("decidim.group_members.actions.promote_to_admin"), decidim.promote_group_manage_user_path(model.nickname, membership), method: :post, - data: { confirm: t("decidim.group_members.actions.are_you_sure") }, + data: { confirm: t("decidim.group_members.actions.promote_to_admin_confirm") }, class: "button button__sm button__transparent-secondary" ) %> <%= link_to( decidim.group_manage_user_path(model.nickname, membership), method: :delete, - data: { confirm: t("decidim.group_members.actions.are_you_sure") }, + data: { confirm: t("decidim.group_members.actions.remove_from_group_confirm") }, class: "button button__sm button__transparent-secondary" ) do %> <%= t("decidim.group_members.actions.remove_from_group") %> diff --git a/decidim-core/app/packs/stylesheets/decidim/_modal.scss b/decidim-core/app/packs/stylesheets/decidim/_modal.scss index d5f937761663a..8f62b8029371b 100644 --- a/decidim-core/app/packs/stylesheets/decidim/_modal.scss +++ b/decidim-core/app/packs/stylesheets/decidim/_modal.scss @@ -18,7 +18,7 @@ } [data-dialog-container] { - @apply grid grid-cols-[auto_1fr] items-start md:items-center gap-2 text-left; + @apply flex flex-col items-start gap-2 text-left; > svg { @apply w-6 h-6 text-gray fill-current flex-none; diff --git a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb index b51913c268f7e..0b64d1b0e8101 100644 --- a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb +++ b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb @@ -1,7 +1,6 @@ <%= decidim_modal id: "confirm-modal" do %>
- <%= icon "delete-bin-line" %> -

<%= t("title", scope: "decidim.shared.confirm_modal") %>

+

<%= t("title", scope: "decidim.group_members.actions.confirm_modal") %>

@@ -11,7 +10,7 @@ <%= t("cancel", scope: "decidim.shared.confirm_modal") %> <% end %> From 7707b63e0ef0a36b196a137b3fa681b63e796e74 Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 19 Dec 2024 10:00:17 -0300 Subject: [PATCH 2/3] fix: ux add locales in modal for the groups --- decidim-core/app/cells/decidim/group_admins/show.erb | 2 +- decidim-core/app/cells/decidim/group_members/show.erb | 4 ++-- decidim-core/config/locales/en.yml | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/decidim-core/app/cells/decidim/group_admins/show.erb b/decidim-core/app/cells/decidim/group_admins/show.erb index 78eb64ccfad73..70988640343cb 100644 --- a/decidim-core/app/cells/decidim/group_admins/show.erb +++ b/decidim-core/app/cells/decidim/group_admins/show.erb @@ -21,7 +21,7 @@ <%= link_to( decidim.demote_group_manage_user_path(model.nickname, membership), method: :post, - data: { confirm: t("decidim.group_admins.actions.remove_from_admin_confirm") }, + data: { confirm: t("decidim.group_admins.actions.confirm_remove_from_admin") }, class: "button button__sm button__transparent-secondary" ) do %> <%= t("decidim.group_admins.actions.demote_admin") %> diff --git a/decidim-core/app/cells/decidim/group_members/show.erb b/decidim-core/app/cells/decidim/group_members/show.erb index 59ef528d8cd9e..1a04a8f883f9f 100644 --- a/decidim-core/app/cells/decidim/group_members/show.erb +++ b/decidim-core/app/cells/decidim/group_members/show.erb @@ -24,14 +24,14 @@ t("decidim.group_members.actions.promote_to_admin"), decidim.promote_group_manage_user_path(model.nickname, membership), method: :post, - data: { confirm: t("decidim.group_members.actions.promote_to_admin_confirm") }, + data: { confirm: t("decidim.group_members.actions.confirm_promote_to_admin") }, class: "button button__sm button__transparent-secondary" ) %> <%= link_to( decidim.group_manage_user_path(model.nickname, membership), method: :delete, - data: { confirm: t("decidim.group_members.actions.remove_from_group_confirm") }, + data: { confirm: t("decidim.group_members.actions.confirm_remove_from_group") }, class: "button button__sm button__transparent-secondary" ) do %> <%= t("decidim.group_members.actions.remove_from_group") %> diff --git a/decidim-core/config/locales/en.yml b/decidim-core/config/locales/en.yml index 836c6b84071db..e2c4b0a455ed7 100644 --- a/decidim-core/config/locales/en.yml +++ b/decidim-core/config/locales/en.yml @@ -1104,7 +1104,7 @@ en: title: What are the badges? group_admins: actions: - are_you_sure: Are you sure? This will not remove the participant from the group. + confirm_remove_from_admin: Are you sure you want to remove the administrator from this group? demote_admin: Remove admin demote: error: There was a problem removing this participant from the admins list. @@ -1134,6 +1134,11 @@ en: error: There was a problem accepting this join request. success: Join request successfully accepted. actions: + confirm_modal: + title: Confirm the new administrator + ok: Confirm + confirm_promote_to_admin: Are you sure you want to add this user as an administrator? + confirm_remove_from_group: Are you sure you want to remove the user from this group? are_you_sure: Are you sure? promote_to_admin: Make admin remove_from_group: Remove participant From 576b4622437c1f579588578163840a5b36e5a7b7 Mon Sep 17 00:00:00 2001 From: Renato Date: Thu, 19 Dec 2024 11:21:27 -0300 Subject: [PATCH 3/3] fix: add locales for add and remove admin from a group --- .../views/decidim/shared/_confirm_modal.html.erb | 13 ++++++++++--- decidim-core/config/locales/en.yml | 7 ++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb index 0b64d1b0e8101..619de26d44180 100644 --- a/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb +++ b/decidim-core/app/views/decidim/shared/_confirm_modal.html.erb @@ -1,7 +1,10 @@ <%= decidim_modal id: "confirm-modal" do %>
-

<%= t("title", scope: "decidim.group_members.actions.confirm_modal") %>

- + <% if @title_key == "group_admins" %> +

<%= t("title_remove", scope: "decidim.group_members.actions.confirm_modal") %>

+ <% else %> +

<%= t("title_add", scope: "decidim.group_members.actions.confirm_modal") %>

+ <% end %>
@@ -10,7 +13,11 @@ <%= t("cancel", scope: "decidim.shared.confirm_modal") %> <% end %> diff --git a/decidim-core/config/locales/en.yml b/decidim-core/config/locales/en.yml index e2c4b0a455ed7..b01802154ec04 100644 --- a/decidim-core/config/locales/en.yml +++ b/decidim-core/config/locales/en.yml @@ -1135,11 +1135,12 @@ en: success: Join request successfully accepted. actions: confirm_modal: - title: Confirm the new administrator - ok: Confirm + title_add: Confirm the new administrator + title_remove: Remove the administrator + ok_add: Ajouter un administrateur + ok_remove: Supprimer l'administrateur confirm_promote_to_admin: Are you sure you want to add this user as an administrator? confirm_remove_from_group: Are you sure you want to remove the user from this group? - are_you_sure: Are you sure? promote_to_admin: Make admin remove_from_group: Remove participant index: