diff --git a/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb b/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb index 205b3cdc83807..0ce59e8755dd1 100644 --- a/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb +++ b/decidim-admin/app/controllers/decidim/admin/block_user_controller.rb @@ -22,7 +22,7 @@ def create BlockUser.call(@form) do on(:ok) do flash[:notice] = I18n.t("officializations.block.success", scope: "decidim.admin") - redirect_to moderated_users_path(blocked: true), notice: + redirect_to moderated_users_path, notice: end on(:invalid) do diff --git a/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb b/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb index bd777df1d2605..3f197003a9240 100644 --- a/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb +++ b/decidim-admin/app/views/decidim/admin/moderated_users/index.html.erb @@ -51,9 +51,9 @@ <% end %> <% if allowed_to?(:block, :moderate_users) %> <% if moderation.user.blocked? %> - <%= icon_link_to "forbid-2-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> + <%= icon_link_to "refresh-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %> <% else %> - <%= icon_link_to "forbid-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> + <%= icon_link_to "lock-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %> <% end %> <% end %> diff --git a/decidim-admin/lib/decidim/admin/engine.rb b/decidim-admin/lib/decidim/admin/engine.rb index bf2d427b75574..316e184a72bd7 100644 --- a/decidim-admin/lib/decidim/admin/engine.rb +++ b/decidim-admin/lib/decidim/admin/engine.rb @@ -26,6 +26,7 @@ class Engine < ::Rails::Engine end initializer "decidim_admin.register_icons" do |_app| + Decidim.icons.register(name: "lock-2-line", icon: "lock-2-line", category: "system", description: "Block user icon", engine: :admin) Decidim.icons.register(name: "layout-masonry-line", icon: "layout-masonry-line", category: "system", description: "", engine: :admin) Decidim.icons.register(name: "service-line", icon: "service-line", category: "system", description: "", engine: :admin) Decidim.icons.register(name: "fullscreen-line", icon: "fullscreen-line", category: "system", description: "", engine: :admin) diff --git a/decidim-admin/spec/controllers/block_user_controller_spec.rb b/decidim-admin/spec/controllers/block_user_controller_spec.rb index af1bd582d5e46..a99bc480980a8 100644 --- a/decidim-admin/spec/controllers/block_user_controller_spec.rb +++ b/decidim-admin/spec/controllers/block_user_controller_spec.rb @@ -75,6 +75,7 @@ module Admin expect(flash[:notice]).to be_present expect(user.reload.blocked?).to be(true) + expect(response).not_to redirect_to(moderated_users_path(blocked: true)) end end diff --git a/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb b/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb index b1bfe5717ab3a..f04b07eb97f19 100644 --- a/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb +++ b/decidim-assemblies/app/controllers/decidim/assemblies/admin/assembly_landing_page_content_blocks_controller.rb @@ -10,6 +10,8 @@ class AssemblyLandingPageContentBlocksController < Decidim::Assemblies::Admin::A layout "decidim/admin/assemblies" + helper_method :parent_assembly + private def content_block_scope @@ -29,6 +31,10 @@ def edit_resource_landing_page_path def resource_landing_page_content_block_path assembly_landing_page_content_block_path(scoped_resource, params[:id]) end + + def parent_assembly + scoped_resource.parent + end end end end diff --git a/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb b/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb new file mode 100644 index 0000000000000..cd76485dd5eaa --- /dev/null +++ b/decidim-assemblies/spec/system/admin/admin_manages_assembly_landing_page_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe "Admin manages assembly landing page" do + include_context "when admin administrating an assembly" + let!(:resource) { assembly } + let(:scope_name) { :assembly_homepage } + let(:edit_landing_page_path) { decidim_admin_assemblies.edit_assembly_landing_page_path(resource) } + + def edit_content_block_path(resource, content_block) + decidim_admin_assemblies.edit_assembly_landing_page_content_block_path(resource, content_block) + end + + before do + switch_to_host(organization.host) + login_as user, scope: :user + end + + context "when editing related assemblies" do + let!(:related_assemblies_content_block) { create(:content_block, organization:, scope_name: "assembly_homepage", manifest_name: "related_assemblies", scoped_resource_id: resource.id, settings: { "max_results" => "6" }) } + + it "updates the related assemblies content block" do + visit edit_content_block_path(resource, related_assemblies_content_block) + + expect(related_assemblies_content_block.settings["max_results"]).to eq(6) + select 12, from: :content_block_settings_max_results + click_on "Update" + + expect(page).to have_content("Related assemblies") + expect(related_assemblies_content_block.reload.settings["max_results"]).to eq(12) + end + end +end diff --git a/decidim-core/app/cells/decidim/translation_bar/show.erb b/decidim-core/app/cells/decidim/translation_bar/show.erb index 52a2ae75e4206..715a9f9c4f9d2 100644 --- a/decidim-core/app/cells/decidim/translation_bar/show.erb +++ b/decidim-core/app/cells/decidim/translation_bar/show.erb @@ -1,6 +1,6 @@ -