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 @@ -
-
+
+
<%= link %> - <%= help_text %> + <%= help_text %>
diff --git a/decidim-core/app/cells/decidim/translation_bar_cell.rb b/decidim-core/app/cells/decidim/translation_bar_cell.rb index cd4f1c6d0764f..5076768a40838 100644 --- a/decidim-core/app/cells/decidim/translation_bar_cell.rb +++ b/decidim-core/app/cells/decidim/translation_bar_cell.rb @@ -34,7 +34,7 @@ def link parsed_url.query = new_query url = parsed_url.to_s - link_to button_text, url, class: "button small hollow" + link_to button_text, url, class: "button button__sm button__transparent-secondary" end def button_text diff --git a/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb b/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb index 8b49c2f94066b..e083ea3923577 100644 --- a/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb +++ b/decidim-meetings/app/cells/decidim/meetings/meeting_l_cell.rb @@ -15,6 +15,11 @@ def extra_class "card__calendar-list__reset" end + # Renders the date in the meeting card list + def has_image? + true + end + def image render end diff --git a/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss b/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss index 99833b3ffbe35..04203bd2e5334 100644 --- a/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss +++ b/decidim-meetings/app/packs/stylesheets/decidim/meetings/_item.scss @@ -13,7 +13,7 @@ } &-container { - @apply grid grid-cols-[auto_1fr] md:grid-cols-[auto_1fr_1fr] items-center gap-0 md:gap-x-5 border-4 border-background rounded md:h-[140px] overflow-hidden; + @apply grid grid-cols-[auto_1fr] md:grid-cols-[auto_1fr_1fr] items-center gap-0 md:gap-x-5 border-4 border-background rounded overflow-hidden; > *:nth-child(2) { @apply p-4 md:p-0; @@ -28,7 +28,7 @@ } > *:nth-child(3) { - @apply order-1 md:order-2 h-[135px] md:h-full; + @apply order-1 md:order-2 h-[135px]; } } diff --git a/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb b/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb new file mode 100644 index 0000000000000..d6f16ebcc1009 --- /dev/null +++ b/decidim-meetings/spec/cells/decidim/meetings/meeting_l_cell_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require "spec_helper" + +module Decidim::Meetings + describe MeetingLCell, type: :cell do + controller Decidim::Meetings::MeetingsController + include Decidim::SanitizeHelper + + subject { my_cell.call } + + let!(:meeting) { create(:meeting, :published, start_time: Time.new(2020, 10, 15, 10, 4, 5, 0)) } + let(:my_cell) { cell("decidim/meetings/meeting_l", meeting) } + + context "when rendering" do + it "renders the card" do + expect(subject).to have_css("#meetings__meeting_#{meeting.id}.card__calendar-list__reset") + end + + it "shows the start time's month" do + expect(subject).to have_css(".card__calendar-month", text: "Oct") + end + + it "shows the start time's day" do + expect(subject).to have_css(".card__calendar-day", text: "15") + end + + it "shows the start time's year" do + expect(subject).to have_css(".card__calendar-year", text: "2020") + end + end + + context "when title contains special html entities" do + let!(:original_title) { meeting.title["en"] } + + before do + meeting.update!(title: { en: "#{original_title} &'<" }) + meeting.reload + end + + it "escapes them correctly" do + title = decidim_html_escape(original_title).gsub(""", '"') + expect(subject.to_s).to include("<strong>#{title}</strong> &'<") + end + end + end +end diff --git a/packages/core/package.json b/packages/core/package.json index ecdf8d7c2f661..0e07e4385caf2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -12,7 +12,7 @@ "dependencies": { "@picmo/popup-picker": "^5.8.4", "@rails/activestorage": "^6.0.4", - "@tarekraafat/autocomplete.js": "^10.2.6", + "@tarekraafat/autocomplete.js": "10.2.7", "@tiptap/core": "2.1.13", "@tiptap/extension-blockquote": "2.1.13", "@tiptap/extension-bold": "2.1.13",